From: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
To: David Marchand <david.marchand@redhat.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "anatoly.burakov@intel.com" <anatoly.burakov@intel.com>,
"tyos@jp.ibm.com" <tyos@jp.ibm.com>,
"drc@linux.vnet.ibm.com" <drc@linux.vnet.ibm.com>
Subject: Re: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities
Date: Sat, 3 Aug 2019 18:22:09 +0000 [thread overview]
Message-ID: <BYAPR18MB2424E1665B6E24DB290838B3C8D80@BYAPR18MB2424.namprd18.prod.outlook.com> (raw)
In-Reply-To: <1564740872-27225-1-git-send-email-david.marchand@redhat.com>
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of David Marchand
> Sent: Friday, August 2, 2019 3:45 PM
> To: dev@dpdk.org
> Cc: anatoly.burakov@intel.com; tyos@jp.ibm.com; drc@linux.vnet.ibm.com
> Subject: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities
>
> IOMMU capabilities won't change and must be checked even if no PCI device
> seem to be supported yet when EAL initialised.
>
> This is to accommodate with SPDK that registers its drivers after
> rte_eal_init(), especially on PPC platform where the IOMMU does not
> support VA.
>
> Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode")
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> drivers/bus/pci/bsd/pci.c | 6 ++++++
> drivers/bus/pci/linux/pci.c | 25 ++++++-------------------
> drivers/bus/pci/pci_common.c | 16 +++++++++++++++-
> drivers/bus/pci/private.h | 5 ++++-
> 4 files changed, 31 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index 9794552..8d1d6ab 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -616,8 +616,16 @@ rte_pci_get_iommu_class(void)
> const struct rte_pci_driver *drv;
> bool devices_want_va = false;
> bool devices_want_pa = false;
> + static int iommu_no_va = -1;
I think, "static" is not required in this context of rte_pci_get_iommu_class()
function. Not a big deal, Trying to avoid unnecessary global variable here.
Either way,
Acked-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
> FOREACH_DEVICE_ON_PCIBUS(dev) {
> + /*
> + * We can check this only once, because the IOMMU
> hardware is
> + * the same for all of them.
> + */
> + if (iommu_no_va == -1)
> + iommu_no_va =
> pci_device_iommu_support_va(dev)
> + ? 0 : 1;
> if (pci_ignore_device(dev))
> continue;
> if (dev->kdrv == RTE_KDRV_UNKNOWN ||
> @@ -643,7 +651,13 @@ rte_pci_get_iommu_class(void)
> devices_want_va = true;
> }
> }
next prev parent reply other threads:[~2019-08-03 18:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 10:14 David Marchand
2019-08-02 10:20 ` David Marchand
2019-08-02 17:13 ` David Christensen
2019-08-02 17:10 ` David Christensen
2019-08-03 18:22 ` Jerin Jacob Kollanukkaran [this message]
2019-08-05 3:57 ` Takeshi T Yoshimura
2019-08-05 6:16 ` David Marchand
2019-08-05 6:23 ` [dpdk-dev] [PATCH v2] " David Marchand
2019-08-05 10:09 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BYAPR18MB2424E1665B6E24DB290838B3C8D80@BYAPR18MB2424.namprd18.prod.outlook.com \
--to=jerinj@marvell.com \
--cc=anatoly.burakov@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=drc@linux.vnet.ibm.com \
--cc=tyos@jp.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).