From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3934A10DA for ; Fri, 2 Aug 2019 12:20:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C9361C236; Fri, 2 Aug 2019 12:20:50 +0200 (CEST) Received: from mail-ua1-f68.google.com (mail-ua1-f68.google.com [209.85.222.68]) by dpdk.org (Postfix) with ESMTP id C70891C234 for ; Fri, 2 Aug 2019 12:20:49 +0200 (CEST) Received: by mail-ua1-f68.google.com with SMTP id 34so29481979uar.8 for ; Fri, 02 Aug 2019 03:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2OqJJxsMxe3K6IFAWBER1MNWONIDo7PjZ8KYWOEQQu8=; b=JLLG8XA6UiCobsVNbd9AhUerPRrg7OEzPf+QRWLK/ZLzPKQrFhMBq5zyfzdkMPcqSr GW6m0+i/wiezzVMQuNA1MQr+eglbgJ72kkwLQ93DgqhOP/77fWzFaWyV0qmW/yM0JX2N s6TIQes0qg3TvIgXCQmX59ZmhckSnyjWBs5NA9siJ68Js8shcr7CEtYiairGmrsWtqdK ZP5E2VrTQ2dt4yWv/OArP4DJjAzr6FbKE6ab1ezkxQ3fq0XBW2gDUVo125bXP46e9cHO P++e2H7Tyz08pvF+dM3tKhXOjGibykqjf/av2vTo2k3qSUn5yTH6xjNFcaeAr6/JwJLo iHGg== X-Gm-Message-State: APjAAAXao6IxdR4s061fqK6gHbZkSnrhqTeYIzvAqGFteXzczw1H/GGh G7o6ODY999E+wriWI8wRYn4fFjgPa8Yi12xn4eQmhw== X-Google-Smtp-Source: APXvYqw2MIHJwKvTf9YjW4mVDtU0CMd15ob+bZOAWPUP0RvXR3SK/cljM6Lf+uPvlc6YT4qy5+Pa9STfYQpS7GDxUNc= X-Received: by 2002:ab0:168a:: with SMTP id e10mr37194866uaf.87.1564741249115; Fri, 02 Aug 2019 03:20:49 -0700 (PDT) MIME-Version: 1.0 References: <1564740872-27225-1-git-send-email-david.marchand@redhat.com> In-Reply-To: <1564740872-27225-1-git-send-email-david.marchand@redhat.com> From: David Marchand Date: Fri, 2 Aug 2019 12:20:38 +0200 Message-ID: To: Takeshi Yoshimura , David Christensen Cc: "Burakov, Anatoly" , dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Aug 2, 2019 at 12:14 PM David Marchand wrote: > > 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. David, Takeshi, Can you test your setups with (only) this patch? This should address both of your issues. > > Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode") > > Signed-off-by: David Marchand > --- > 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(-) > [snip] > 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 [snip] > @@ -643,7 +651,13 @@ rte_pci_get_iommu_class(void) > devices_want_va = true; > } > } > - if (devices_want_va && !devices_want_pa) { > + if (iommu_no_va == 1) { > + iova_mode = RTE_IOVA_PA; > + if (devices_want_va) { > + RTE_LOG(WARNING, EAL, "Some devices want 'VA' but because IOMMU does not support 'VA'.\n"); Note to self, s/but because/but/ > + RTE_LOG(WARNING, EAL, "The devices that want 'VA' won't initialize.\n"); > + } > + } else if (devices_want_va && !devices_want_pa) { > iova_mode = RTE_IOVA_VA; > } else if (devices_want_pa && !devices_want_va) { > iova_mode = RTE_IOVA_PA; -- David Marchand