On 7/3/24 12:03, Srujana Challa wrote:
This patch modifies the code to convert descriptor buffer IOVA
addresses to virtual addresses during the processing of shadow
control queue when IOVA mode is PA. This change enables Virtio-user
to operate with IOVA as the descriptor buffer address.

Signed-off-by: Srujana Challa <scha...@marvell.com>
---
  .../net/virtio/virtio_user/virtio_user_dev.c  | 33 ++++++++++++-------
  1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c 
b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 1365c8a5c8..7f35f4b06b 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -896,6 +896,15 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, 
uint16_t q_pairs)
#define CVQ_MAX_DATA_DESCS 32 +static inline void *
+virtio_user_iova2virt(rte_iova_t iova)
+{
+       if (rte_eal_iova_mode() == RTE_IOVA_PA)
+               return rte_mem_iova2virt(iova);
+       else
+               return (void *)(uintptr_t)iova;
+}
+


Thanks for the last minute change.

With Jerin suggestion:
Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com>

Maxime

Reply via email to