/* The alignment to use between consumer and producer parts of vring. */
#define VIRTIO_PCI_VRING_ALIGN 4096
-/*
- * Address translatio is between gva<->hva,
- * rather than gpa<->hva in virito spec.
- */
-#define RTE_MBUF_DATA_DMA_ADDR(mb) \
- ((uint64_t)(uintptr_t)rte_pktmbuf_mtod(mb, void *))
-
enum { VTNET_RQ = 0, VTNET_TQ = 1, VTNET_CQ = 2 };
/**
static inline int __attribute__((always_inline))
virtqueue_full(const struct virtqueue *vq)
{
- return (vq->vq_free_cnt == 0);
+ return vq->vq_free_cnt == 0;
}
#define VIRTQUEUE_NUSED(vq) ((uint16_t)((vq)->vq_ring.used->idx - (vq)->vq_used_cons_idx))
start_dp[idx].flags = VRING_DESC_F_NEXT;
start_dp[idx].addr = (uintptr_t)NULL;
idx = start_dp[idx].next;
- start_dp[idx].addr = RTE_MBUF_DATA_DMA_ADDR(cookie);
+ start_dp[idx].addr = rte_pktmbuf_mtod(cookie, uint64_t);
start_dp[idx].len = cookie->data_len;
start_dp[idx].flags = 0;
idx = start_dp[idx].next;