MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_vq_phys_addr_ok

Function check_vq_phys_addr_ok

dpdk/drivers/crypto/virtio/virtio_pci.c:26–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24struct virtio_hw_internal crypto_virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO];
25
26static inline int
27check_vq_phys_addr_ok(struct virtqueue *vq)
28{
29 /* Virtio PCI device VIRTIO_PCI_QUEUE_PF register is 32bit,
30 * and only accepts 32 bit page frame number.
31 * Check if the allocated physical memory exceeds 16TB.
32 */
33 if ((vq->vq_ring_mem + vq->vq_ring_size - 1) >>
34 (VIRTIO_PCI_QUEUE_ADDR_SHIFT + 32)) {
35 VIRTIO_CRYPTO_INIT_LOG_ERR("vring address shouldn't be above 16TB!");
36 return 0;
37 }
38
39 return 1;
40}
41
42static inline void
43io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi)

Callers 1

modern_setup_queueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected