[PATCH v3 1/3] net/virtio_user: convert cq descriptor IOVA address to Virtual address
David Marchand
david.marchand at redhat.com
Fri Jul 12 13:22:49 CEST 2024
Hello,
On Wed, Jul 3, 2024 at 12:19 PM Jerin Jacob <jerinjacobk at gmail.com> wrote:
>
> On Wed, Jul 3, 2024 at 3:43 PM Srujana Challa <schalla at marvell.com> 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 <schalla at 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)
>
> There is RTE_IOVA_DC as well. So we may put positive logic. i.e
> rte_eal_iova_mode() == RTE_IOVA_VA
Buses can provide RTE_IOVA_VA, RTE_IOVA_PA or RTE_IOVA_DC hints to EAL.
https://doc.dpdk.org/guides/prog_guide/env_abstraction_layer.html#iova-mode-detection
But at the point drivers are probed (and as a consequence when
handling descriptors here), the iova mode is fixed to be either
RTE_IOVA_PA or RTE_IOVA_VA.
https://git.dpdk.org/dpdk/tree/lib/eal/linux/eal.c#n1077
https://git.dpdk.org/dpdk/tree/lib/eal/linux/eal.c#n1124
https://git.dpdk.org/dpdk/tree/lib/eal/linux/eal.c#n1288
--
David Marchand
More information about the dev
mailing list