From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CBEC145610; Fri, 12 Jul 2024 13:23:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBF28402E5; Fri, 12 Jul 2024 13:23:06 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C8A7740261 for ; Fri, 12 Jul 2024 13:23:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720783384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=THsHY115iWNHGZy4kMMubSqc0TKzQqt7898yWtWlJXM=; b=NOywxi9iDv/1b5wjCA48P7hAXCW2TnD/USOG1qY0gWF3+f41Bpkj+fv8F+9B4ix9a8/CUW SCnQxs2xwGNgVw4/RSdio4SroYFikTrWE3MBJqUJ35e+vg2xz3R/kOj0uNvcQOJeRO+ZEL ePHaiyCDKNgKetGGwGea7kLKN9VrDBw= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-mSkAk4fkNfKYjLa8fMl7kA-1; Fri, 12 Jul 2024 07:23:03 -0400 X-MC-Unique: mSkAk4fkNfKYjLa8fMl7kA-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ee92048377so20912291fa.2 for ; Fri, 12 Jul 2024 04:23:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720783381; x=1721388181; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=THsHY115iWNHGZy4kMMubSqc0TKzQqt7898yWtWlJXM=; b=CIV6seGemGXLA5sg4uyobQjzpqjeWt7Y/iaVioRyuTwML/+w9ubY3MzOY+5aVsKSLJ 7DoQHoviUFJHvHg+EB9as3fSED3t1kYZ14Adce2NYM0Fr/vhOqsaDRfglu87XPTRjZlV Yw/dtrTD+PU/iHE130K4prgAbMhYvfeY5hISAN+A9jf2jsuNt+xdWSuf9kWw3xLeT1+Y +LAbs9TmXuDbqqxaj3OLVAn+GS1fLYP1lcqrwkC3TwKLAU0nqDMIkz7crRSaWgIijKXe mg7Gl7eMsaXPNeMEYrde6GppmIC8193K9ZU9nJBA5aVBw5O9L0aJrAETByKxsFyVlUn9 Q1kQ== X-Gm-Message-State: AOJu0YxfsX6q/CocGdhpEfeynnXRXiHERA6p8PTwHZSu/npsbg80sn4r bvBObmGxSWY90twSgOY+hghohVP5fFnE6ZEmJ13n1Q1iZ6PIVQt5v3IlCSWtu186lGYHXLefaMI bSjmYidlAAjRW1MNpfReuvg0BaIwlZVcZjmPR5ku7o9bZvWlBJrjrfDhSxvefflDb8QdrnFI4kS AVn248YIeGi1Cwkxc= X-Received: by 2002:a2e:9f16:0:b0:2ec:5a13:e19c with SMTP id 38308e7fff4ca-2eeb30e364dmr85736651fa.17.1720783381016; Fri, 12 Jul 2024 04:23:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiv1g62BRO3kZW8dDKtvu9LbDnzKcLX2lHYa9IJZSC4U5luhp94h6mzFU1xqzHQrcUKCzLaklD3qWLcXPZvBY= X-Received: by 2002:a2e:9f16:0:b0:2ec:5a13:e19c with SMTP id 38308e7fff4ca-2eeb30e364dmr85736541fa.17.1720783380628; Fri, 12 Jul 2024 04:23:00 -0700 (PDT) MIME-Version: 1.0 References: <20240229132919.2186118-2-schalla@marvell.com> <20240703100353.2243038-1-schalla@marvell.com> <20240703100353.2243038-2-schalla@marvell.com> In-Reply-To: From: David Marchand Date: Fri, 12 Jul 2024 13:22:49 +0200 Message-ID: Subject: Re: [PATCH v3 1/3] net/virtio_user: convert cq descriptor IOVA address to Virtual address To: Jerin Jacob , Srujana Challa Cc: dev@dpdk.org, maxime.coquelin@redhat.com, chenbox@nvidia.com, jerinj@marvell.com, ndabilpuram@marvell.com, vattunuru@marvell.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello, On Wed, Jul 3, 2024 at 12:19=E2=80=AFPM Jerin Jacob = wrote: > > On Wed, Jul 3, 2024 at 3:43=E2=80=AFPM 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 > > --- > > .../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() =3D=3D RTE_IOVA_PA) > > There is RTE_IOVA_DC as well. So we may put positive logic. i.e > rte_eal_iova_mode() =3D=3D 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 --=20 David Marchand