From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id A850E1B754 for ; Tue, 24 Oct 2017 10:25:52 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id z3so7500700wme.5 for ; Tue, 24 Oct 2017 01:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nRIDkDwzJgJlNsDeGDaS9uGMKl/QpieOoz0uoFso+1c=; b=zSvp2UM38Di+Ysv2VxxL8OC1iyxuYEM5bascaQcklEr5frCHSbhMEkLEfmgvMcNgTJ HVgr08CIH+BhlqlWWE0c+oBaKGeVSr4pp8jPNJXHDQphZzAIccAtHeg2UpW7OmSILr5q XPsHkain7nxNOJK78ERND5I6t1iIcqgdne/oBSMsytESgcagZ1+s5JwR2WGx9uGPn7/l mgRbU0OnWrNcs4gvPy+Vp9vcCnpXXMHmuGeu5vW/7ig7ImZawiGnO/jt5y4a3qxLwgAp 1W1DR4yCiz+3hgsv+p3u0p/S4HKxEqRleZ/IpDRuzzahuB0MmYkdP1x//AN+WScSvpAd dqWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=nRIDkDwzJgJlNsDeGDaS9uGMKl/QpieOoz0uoFso+1c=; b=q50I26/dp/l/4y01iDaig2/rR5MeJg6Rw9r/7tvLZSuB1tgDoAtLaPa4yOI0MsEd5I 5nSahQnis3tLcOfKV0aFb4+3T/vfpJ5pWoy3uWf/cAZMvh1A6J4a6E3xn9Z+ZexuRXlJ Yqtfq9VvirEOkJ69/+XONpk+xz/CJpn6A82/WnwDQ+f5wzFyVfWLJYwW5T3y7h+Sk0Dq 0342rcH8yzB4ONVjNnWSLwImym98Vq4tKBv8d7g4Z88jqaZktjzlsRkLgliXt8J4Ye/S PZUDaZCuSFTuIA33HjLWwFvv05pjfPRqhrPNAsFx//PRYTt1vA1GvJuA01b3cW7hqn3k atGA== X-Gm-Message-State: AMCzsaVglRodY08vZc9LjppqhRocOKdbY421LEnnknp1+M/8Y6GRs24/ oc4QtJ2FqdC9+diomjZK2lITx51y X-Google-Smtp-Source: ABhQp+QvWHpUlLkFlmg5GOMiuJ9Qb8SV7i2PsZ5khvdaaFTCBQH7q2ORK2RWqAkLbDHsX9HlC21uEw== X-Received: by 10.28.144.140 with SMTP id s134mr8167980wmd.82.1508833552171; Tue, 24 Oct 2017 01:25:52 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id b15sm5514270wrh.35.2017.10.24.01.25.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 01:25:51 -0700 (PDT) Date: Tue, 24 Oct 2017 10:25:40 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Jianfeng Tan Cc: dev@dpdk.org Message-ID: <20171024082540.GO3596@bidouze.vm.6wind.com> References: <1508411909-63954-1-git-send-email-jianfeng.tan@intel.com> <1508831093-139486-1-git-send-email-jianfeng.tan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1508831093-139486-1-git-send-email-jianfeng.tan@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v2] pci: fix check uio bind 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: , X-List-Received-Date: Tue, 24 Oct 2017 08:25:52 -0000 On Tue, Oct 24, 2017 at 07:44:53AM +0000, Jianfeng Tan wrote: > When checking if any devices bound to uio, we did not exclud > those which are blacklisted (or in the case that a whitelist > is specified). > > This patch fixes it by only checking whitelisted devices, or > not-blacklisted devices depending on the bus scan mode. > > Fixes: 815c7deaed2d ("pci: get IOMMU class on Linux") > > Signed-off-by: Jianfeng Tan Small nit below, but otherwise: Reviewed-by: Gaetan Rivet > --- > v2: > - Accept two suggestions from Gaetan. > > lib/librte_eal/linuxapp/eal/eal_pci.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index b4dbf95..4d1de07 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -516,8 +516,29 @@ static inline int > pci_one_device_bound_uio(void) > { > struct rte_pci_device *dev = NULL; > + struct rte_devargs *devargs; > + int need_check; Both could have been declared within the loop instead, but this is really a detail and isn't worth a v3 IMO, so do as you please. > > FOREACH_DEVICE_ON_PCIBUS(dev) { > + devargs = dev->device.devargs; > + > + need_check = 0; > + switch (rte_pci_bus.bus.conf.scan_mode) { > + case RTE_BUS_SCAN_WHITELIST: > + if (devargs && devargs->policy == RTE_DEV_WHITELISTED) > + need_check = 1; > + break; > + case RTE_BUS_SCAN_UNDEFINED: > + case RTE_BUS_SCAN_BLACKLIST: > + if (devargs == NULL || > + devargs->policy != RTE_DEV_BLACKLISTED) > + need_check = 1; > + break; > + } > + > + if (!need_check) > + continue; > + > if (dev->kdrv == RTE_KDRV_IGB_UIO || > dev->kdrv == RTE_KDRV_UIO_GENERIC) { > return 1; > -- > 2.7.4 > -- Gaëtan Rivet 6WIND