[dpdk@localhost ~]$ diff dpdk-stable-21.11.2-backup/drivers/net/virtio/ dpdk-stable-21.11.2-testing/drivers/net/virtio/
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_ethdev.c dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_ethdev.c
567c567,571
<         vq->vq_ring_mem = mz->iova;
---
> 	if (hw->use_va)
> 		vq->vq_ring_mem = mz->addr_64;
> 	else
> 		vq->vq_ring_mem = mz->iova;
>
620c624,627
< 		txvq->virtio_net_hdr_mem = hdr_mz->iova;
---
> 		if (hw->use_va)
> 			txvq->virtio_net_hdr_mem = hdr_mz->addr_64;
> 		else
> 			txvq->virtio_net_hdr_mem = hdr_mz->iova;
625c632,635
< 		cvq->virtio_net_hdr_mem = hdr_mz->iova;
---
> 		if (hw->use_va)
> 			cvq->virtio_net_hdr_mem = hdr_mz->addr_64;
> 		else
> 			cvq->virtio_net_hdr_mem = hdr_mz->iova;
629a640,644
>
> 	if (hw->use_va)
> 		vq->mbuf_addr_offset = offsetof(struct rte_mbuf, buf_addr);
> 	else
> 		vq->mbuf_addr_offset = offsetof(struct rte_mbuf, buf_iova);
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio.h
229a230
> 	bool use_va;
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_rxtx.c dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_rxtx.c
265c265
< 		start_dp[idx].addr = cookies[i]->buf_iova +
---
> 		start_dp[idx].addr = VIRTIO_MBUF_ADDR(cookies[i], vq) +
304c304
< 		start_dp[idx].addr = cookie[i]->buf_iova +
---
> 		start_dp[idx].addr = VIRTIO_MBUF_ADDR(cookie[i], vq) +
330c330
< 	dp->addr = cookie->buf_iova + RTE_PKTMBUF_HEADROOM - hw->vtnet_hdr_size;
---
> 	dp->addr = VIRTIO_MBUF_ADDR(cookie, vq) + RTE_PKTMBUF_HEADROOM - hw->vtnet_hdr_size;
473c473
< 		start_dp[idx].addr = rte_mbuf_data_iova(cookies[i]) - head_size;
---
> 		start_dp[idx].addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookies[i], vq) - head_size;
520c520
< 	dp->addr = rte_mbuf_data_iova(cookie) - head_size;
---
> 	dp->addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq) - head_size;
608c608
< 		start_dp[idx].addr = rte_mbuf_data_iova(cookie);
---
> 		start_dp[idx].addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_rxtx_packed_avx.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_rxtx_packed_avx.h
74c74
< 		 	tx_pkts[3]->buf_iova,
---
> 			VIRTIO_MBUF_ADDR(tx_pkts[3], vq),
76c76
< 		 	tx_pkts[2]->buf_iova,
---
> 			VIRTIO_MBUF_ADDR(tx_pkts[2], vq),
78c78
< 		 	tx_pkts[1]->buf_iova,
---
> 			VIRTIO_MBUF_ADDR(tx_pkts[1], vq),
80c80
< 		 	tx_pkts[0]->buf_iova);
---
> 			VIRTIO_MBUF_ADDR(tx_pkts[0], vq));
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_rxtx_packed.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_rxtx_packed.h
290c290
< 			addr = cookie[total_num + i]->buf_iova +
---
> 			addr = VIRTIO_MBUF_ADDR(cookie[total_num + i], vq) +
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_rxtx_packed_neon.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_rxtx_packed_neon.h
100,101c100,101
< 	 	tx_pkts[0]->buf_iova + tx_pkts[0]->data_off,
< 		tx_pkts[1]->buf_iova + tx_pkts[1]->data_off
---
> 		VIRTIO_MBUF_ADDR(tx_pkts[0], vq) + tx_pkts[0]->data_off,
> 		VIRTIO_MBUF_ADDR(tx_pkts[1], vq) + tx_pkts[1]->data_off
104,105c104,105
< 	 	tx_pkts[2]->buf_iova + tx_pkts[2]->data_off,
< 		tx_pkts[3]->buf_iova + tx_pkts[3]->data_off
---
> 		VIRTIO_MBUF_ADDR(tx_pkts[2], vq) + tx_pkts[2]->data_off,
> 		VIRTIO_MBUF_ADDR(tx_pkts[3], vq) + tx_pkts[3]->data_off
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_rxtx_simple.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_rxtx_simple.h
46c46
< 		start_dp[i].addr = sw_ring[i]->buf_iova +
---
> 		start_dp[i].addr = VIRTIO_MBUF_ADDR(sw_ring[i], vq) +
Common subdirectories: dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_user and dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_user
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtio_user_ethdev.c dpdk-stable-21.11.2-testing/drivers/net/virtio/virtio_user_ethdev.c
659a660,665
> 	/*
> 	 * Virtio-user requires using virtual addresses for the descriptors
> 	 * buffers, whatever other devices require
> 	 */
> 	hw->use_va = true;
>
773d778
< 	.drv_flags = RTE_VDEV_DRV_NEED_IOVA_AS_VA,
diff dpdk-stable-21.11.2-backup/drivers/net/virtio/virtqueue.h dpdk-stable-21.11.2-testing/drivers/net/virtio/virtqueue.h
115a116,134
> /**
>  * Return the IOVA (or virtual address in case of virtio-user) of mbuf
>  * data buffer.
>  *
>  * The address is firstly casted to the word size (sizeof(uintptr_t))
>  * before casting it to uint64_t. This is to make it work with different
>  * combination of word size (64 bit and 32 bit) and virtio device
>  * (virtio-pci and virtio-user).
>  */
> #define VIRTIO_MBUF_ADDR(mb, vq) \
> 	((uint64_t)(*(uintptr_t *)((uintptr_t)(mb) + (vq)->mbuf_addr_offset)))
>
> /**
>  * Return the physical address (or virtual address in case of
>  * virtio-user) of mbuf data buffer, taking care of mbuf data offset
>  */
> #define VIRTIO_MBUF_DATA_DMA_ADDR(mb, vq) \
> 	(VIRTIO_MBUF_ADDR(mb, vq) + (mb)->data_off)
>
279a299
> 	uint16_t mbuf_addr_offset;
773c793
< 		start_dp[idx].addr = rte_mbuf_data_iova(cookie);
---
> 		start_dp[idx].addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);
[dpdk@localhost ~]$