Message ID | 1418106629-22227-19-git-send-email-mukawa@igel.co.jp (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 007EE80B7; Tue, 9 Dec 2014 07:31:36 +0100 (CET) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id EDC0D804F for <dev@dpdk.org>; Tue, 9 Dec 2014 07:31:30 +0100 (CET) Received: by mail-pd0-f170.google.com with SMTP id v10so6676216pde.15 for <dev@dpdk.org>; Mon, 08 Dec 2014 22:31:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GJxQo3BTaU9vbB4KVsqsjQ9tObcQGix1GOOCsAiUS5Y=; b=g3122dZdKj9uWmiHaWR0eHv3hR+qUQcO3xLx/Up6bysl4gQCdDMRfCIOFOagSsflkO /rFG551+0w+DJBx36rYl0AuunedYmCiPb98lVoBCEwd21LlYFs11HUBk2DiCUpBl1+ZC 6ZsWy9Fl+p8x4MWHZYkzQ2kh7L9Icu/qHkNaDMJzHGqyaLLkOz2c7PA7rsbK9FSOWeg8 mFSLtQpuxRXWOPUo4lmp7BHtETNymU7QYzQuOt49y8P7KzHjGLyjwaHioT4rcsz1BZw6 u/2qmMgDp5bHTnx8sR7/Qpt1dcVqMuQdSvJpRIQ1iUu/6DgWqm4gLmU8gXPxcEnpWK60 NvIQ== X-Gm-Message-State: ALoCoQnso/12tBrCoZP+m50vVjPj4RnhDcuap02W33Iw5bxC12zdf42AZn3LaWQaKAgVkCBek1ml X-Received: by 10.66.246.130 with SMTP id xw2mr2260350pac.55.1418106690311; Mon, 08 Dec 2014 22:31:30 -0800 (PST) Received: from eris.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id f12sm403088pat.43.2014.12.08.22.31.27 for <multiple recipients> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Dec 2014 22:31:29 -0800 (PST) From: Tetsuya Mukawa <mukawa@igel.co.jp> To: dev@dpdk.org Date: Tue, 9 Dec 2014 15:30:19 +0900 Message-Id: <1418106629-22227-19-git-send-email-mukawa@igel.co.jp> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418106629-22227-1-git-send-email-mukawa@igel.co.jp> References: <1416474399-16851-1-git-send-email-mukawa@igel.co.jp> <1418106629-22227-1-git-send-email-mukawa@igel.co.jp> Cc: nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com, masutani.hitoshi@lab.ntt.co.jp Subject: [dpdk-dev] [PATCH v3 18/28] eal/pci: Prevent double registrations for pci_device_list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Tetsuya Mukawa
Dec. 9, 2014, 6:30 a.m. UTC
The patch fixes pci_scan_one() not to register same pci devices twice.
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
lib/librte_eal/linuxapp/eal/eal_pci.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
If you modify one function, make sure all places, where call the function, have been modified accordingly in same patch. Please do not split it. Because we must make sure every patch could make dpdk work( I think without this patch, it will have some issue after you applied "Replace pci address comparison code by eal_compare_pci_addr"). What's more, with your patch set, if someone wants to find out the commit, which result in bugs or issues, use git bisect, it may be fail by your patch, although it's none of your patch's business. So please merge this patch to [PATCH v3 03/28] eal/pci: Replace pci address comparison code by eal_compare_pci_addr If other patch, I missed, with the same issue, please take same action. Thanks, Michael On 12/9/2014 2:33 PM, Tetsuya Mukawa wrote: > The patch fixes pci_scan_one() not to register same pci devices twice. > > Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> > --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index fe212d1..355c858 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -306,14 +306,17 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, > } > else { > struct rte_pci_device *dev2 = NULL; > + int ret; > > TAILQ_FOREACH(dev2, &pci_device_list, next) { > - if (eal_compare_pci_addr(&dev->addr, &dev2->addr) != 0) > + ret = eal_compare_pci_addr(&dev->addr, &dev2->addr); > + if (ret > 0) > continue; > - else { > + else if (ret < 0) { > TAILQ_INSERT_BEFORE(dev2, dev, next); > return 0; > - } > + } else /* already registered */ > + return 0; > } > TAILQ_INSERT_TAIL(&pci_device_list, dev, next); > }
(2014/12/11 12:24), Qiu, Michael wrote: > If you modify one function, make sure all places, where call the > function, have been modified accordingly in same patch. > > Please do not split it. Because we must make sure every patch could > make dpdk work( I think without this patch, it will have some issue > after you applied "Replace pci address comparison code by > eal_compare_pci_addr"). > > What's more, with your patch set, if someone wants to find out the > commit, which result in bugs or issues, use git bisect, it may be fail > by your patch, although it's none of your patch's business. > > So please merge this patch to > [PATCH v3 03/28] eal/pci: Replace pci address comparison code by > eal_compare_pci_addr I appreciate your comment. You are right. The following patch has a runtime issue. [PATCH v3 03/28] eal/pci: Replace pci address comparison code by eal_compare_pci_addr And it will be fixed in following. [dpdk-dev] [PATCH v3 18/28] eal/pci: Prevent double registrations for pci_device_list I will merge it. Thanks, Tetsuya > If other patch, I missed, with the same issue, please take same action. > > Thanks, > Michael > On 12/9/2014 2:33 PM, Tetsuya Mukawa wrote: >> The patch fixes pci_scan_one() not to register same pci devices twice. >> >> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> >> --- >> lib/librte_eal/linuxapp/eal/eal_pci.c | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c >> index fe212d1..355c858 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal_pci.c >> +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c >> @@ -306,14 +306,17 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, >> } >> else { >> struct rte_pci_device *dev2 = NULL; >> + int ret; >> >> TAILQ_FOREACH(dev2, &pci_device_list, next) { >> - if (eal_compare_pci_addr(&dev->addr, &dev2->addr) != 0) >> + ret = eal_compare_pci_addr(&dev->addr, &dev2->addr); >> + if (ret > 0) >> continue; >> - else { >> + else if (ret < 0) { >> TAILQ_INSERT_BEFORE(dev2, dev, next); >> return 0; >> - } >> + } else /* already registered */ >> + return 0; >> } >> TAILQ_INSERT_TAIL(&pci_device_list, dev, next); >> }
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index fe212d1..355c858 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -306,14 +306,17 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, } else { struct rte_pci_device *dev2 = NULL; + int ret; TAILQ_FOREACH(dev2, &pci_device_list, next) { - if (eal_compare_pci_addr(&dev->addr, &dev2->addr) != 0) + ret = eal_compare_pci_addr(&dev->addr, &dev2->addr); + if (ret > 0) continue; - else { + else if (ret < 0) { TAILQ_INSERT_BEFORE(dev2, dev, next); return 0; - } + } else /* already registered */ + return 0; } TAILQ_INSERT_TAIL(&pci_device_list, dev, next); }