From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0056.outbound.protection.outlook.com [104.47.36.56]) by dpdk.org (Postfix) with ESMTP id 0BDB96CC9 for ; Tue, 20 Sep 2016 14:42:39 +0200 (CEST) Received: from DM5PR03CA0024.namprd03.prod.outlook.com (10.175.104.34) by MWHPR03MB2448.namprd03.prod.outlook.com (10.169.200.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:42:37 +0000 Received: from BL2FFO11OLC011.protection.gbl (2a01:111:f400:7c09::197) by DM5PR03CA0024.outlook.office365.com (2603:10b6:3:118::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8 via Frontend Transport; Tue, 20 Sep 2016 12:42:37 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC011.mail.protection.outlook.com (10.173.160.157) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:42:37 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8KCexsd006559; Tue, 20 Sep 2016 05:42:34 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:23 +0530 Message-ID: <1474375296-26078-12-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489578457910; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(2351001)(7846002)(5003940100001)(19580405001)(11100500001)(81156014)(50466002)(81166006)(2906002)(305945005)(19580395003)(8676002)(50226002)(50986999)(97736004)(626004)(85426001)(76176999)(68736007)(8936002)(87936001)(110136003)(8666005)(5660300001)(48376002)(356003)(189998001)(5890100001)(104016004)(2950100001)(86362001)(92566002)(229853001)(33646002)(47776003)(77096005)(106466001)(586003)(4326007)(105606002)(36756003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2448; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC011; 1:84jr7RFzv/LDaBt1GbklHQUhwm9WmDBV4b7Niv5I242s6TdphP+GXkKFflEW74L/07EJ3ymiwOGwzh2GDxxPegkO841StNI/5cvBZXO9Eoq9T+Z9Bp/ig6Xzd6K8RfJwqZzJ6vB/HdVFx4y0OJn7RoxsTjTEivQucTMaTmYzbz5kMYasVyDEP1lpOhdFyKzUdfV2wxcbbdjCIGLY43fRGIIKmlRrzvyp6xClBrU+qCnsr1EfMPzqnePcoTpEwOG3RHTYc9fgvNGvAIkC76wsz8WZnGiMExOK23uQ6RYNkSsjy/UhQA3x3Or4yf1thlBmnFNgZZRiKTFWJaJ+s1QrpVJfYw26OQuon+8yeSyi9bqDkt4LytgUaISk7IEkU+QmEamHCHOLbL5SukMRLv+9fPWmkuUYWXb6RUTVTO83inOLg+coE0hCYiqJ9A886x9ULiAspvij7Cx99/vsfdJRsKxAFHZt09Uql+PCM0quNAYti1wDSjuYHuaj8ZVFI7DuLR/duyadABlzoqZ2RpjBG7lQzyqyPRy3nmHihRBaqHSL88F2iMJxDRENCZXshbefhZrh2n8EnR3YQuNFr2ayzEfyUTYUF/dFzsumnLJf6Sn6ou1A4nVG+6zZ4nY2UCGVYRqoPWPfy9BUlASmjw46iujjBCYs12B8BrdhX1ELJinkFu7DLXPoSz4zQKbMRTXed2eYZw/Q0lPCmZn86EhcTftM6Hjp8iaU5pJCNzG8eRo= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0b900d99-04a5-4cb0-49d8-08d3e1539a66 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 2:DOQN+qPooKzQhm9LsbuOdssMXHI8ohfJMZMSjGP/ShFloLkc99JPG1wURtXKqIz1i4HNfa89mI2Ed72Bn5fD+1q+hmaj1E+12sTEtMyCBH9cPKlOzfkyCZsu1D+g4+ULxOeIXQ47P48K+RsXofFufqOis3RMZoCFMSdemko1gI2rb45VagmpHPy3dakwYbfw; 3:UkNuy+roL3HIHsVX0G0llvWUmXaorqVkk5qubzL+YCGkZJ+M3gtHTisEj8LyKmdQhvqSIDzwY9jtWt4ozqoUp506yyCoc7TQvEHlgI0XFo7I9EKktgbigt8FCUH04+85hGg65K0u1z7AFXKWVF/sQRcSHxznVQP0fcWidUHqxNsHvz2PUPvLDjf5vhOZxaXEVUPyyNoiMhme+ohY9xrgTGJFGtfMpmb1Ifvks4e1XS0=; 25:stcKCSk1SP2vf6hbGcrOCQEyxiiB3W4RiKFJkWv510waF1E/9Qi9JJicQcYJP23w+ZlSqzOGw1tDUroyBXCTQXJWxdv8bMCYaV0sVkp4nw3/2yqVrfKk51twjF75r6fgj5ju8nZYG4EmD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TZ78IFpk4ZFaCLkC3NVAoZ4fyLWyChwSoRU6EksXIkQwvCQOBZEwsDZsc6+rPhzCDGJLEe5jYtMUfZ2FvTvRXsfQ61/MH6gnCMnsmAB6hO/hmPKiY0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(13018025)(13017025)(13024025)(13015025)(13023025)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2448; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2448; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2448; 23:OGtD/2AyLe62LPT7TW8E0NCMHqOuDNjJs0vDEGsGK?= =?us-ascii?Q?q2hQ9ErFiyFLrOljEQpZ6s+AL9Dvp5pj9CwB+fctx1magiEd8pNYhBVXkeZG?= =?us-ascii?Q?84aFToMrHKImHOr6dC2vVIO4RoFqpwAVx3W5N3kmxaWRcNBzZ8DOw4N7eYxK?= =?us-ascii?Q?lNvQGEc/TPLCGPIPZo+qPmuQ6yBNTwHWQ6JZctyKApHruhZ1FWF2YBye/96E?= =?us-ascii?Q?6cM5Q2tmBU+FyfpBZSNGdZ3a3G7Lk9KMrU9+1KkoqGlDpJ5rJmch0d6IOQKG?= =?us-ascii?Q?XTJBjo+DGEunrMGJxWJuN/hI0nNFduZJaAQABckfV0x4jKjEpAUoT0gTOngP?= =?us-ascii?Q?95FTqFmHyugb1ixt11BuXIqcQinAJMa9VYN+ud/nouDZPVfxjmJMFwNqIEZk?= =?us-ascii?Q?fiPendMtiyBoeJWwPRbxDoTZAv/iaEDgdvAwswrta3D2OXU2r2E4Xgud+fyk?= =?us-ascii?Q?QmpYyW1srj1iZ2ACnxkanioqcepDsQ9uxyipZ9fcUJIei9ogIMpDF56rwLLc?= =?us-ascii?Q?CrajQ6Zxy9qFvlZbM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tYnfpboWzSUHDHVm0SsV6rQciW65AqvNvBq5r66SQGF2kejo5lRN09R8C27+trlqDyEcDiNCum7dGysDKTq7yI=; 5:j7m5Gu2j+yljlgHYZ22noGJH5JbyxkIYkXq53rXCvFwG8+cQ+f5Iv9QVO7mHpmeCaJh9McaHmvcJPVrHkkMz+bRmovrfROKPdYzOOB2XuGy75Uw6DYEjV8rJL1RNeRihf41Mlez1xV/x0CwYi3S4IJ7WX7dRLM5t5hhv30CRcfo=; 24:1C/zJVI/f7ERgp0p3JVIhJiJPVwOqb3R0z37Lsi8Y+CNX5p/Ta7wawjRvYkT8WXqMFpTQFhNCQN40eFP4eK0V4yhsibEIi2EGAY66qWvns0=; 7:TEPsIc5l3FOndGMbw+sPCf+0hbQfSmk9vY6v5gt3NZ2SBSTg+K614tFWPshclVj5Dhz0eU4FCQPyWRYQ9t4YuvwobyBDQU4oE2vEWkFQOc2TYFR+7yN/T1DKuTeBYisEM+AofU2PFEZfKouJkrlcpBN4dUtI3d4b7UTBZoEsazoKoH7yUKdzTwBMzUJxnWXVdBeabFAx4ecqF3TEIT/tyruHa4sz0A9402rkQPtRVu0aVjH1EpmOv4lhC8sFBQZtnmxjM3t/JWXYUqYOOPKX7AEutQa/MgGyh+JYHuLQYvI0XXh9K2QsKmlOQHIsD20S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:42:37.6585 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2448 Subject: [dpdk-dev] [PATCH v11 11/24] ethdev: do not scan all PCI devices on attach X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2016 12:42:39 -0000 From: David Marchand No need to scan all devices, we only need to update the device being attached. Signed-off-by: David Marchand Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/eal_common_pci.c | 12 +++++++++--- lib/librte_ether/rte_ethdev.c | 3 --- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index db8cba0..bef7ee8 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -341,6 +341,12 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr) if (addr == NULL) return -1; + /* update current pci device in global list, kernel bindings might have + * changed since last time we looked at it. + */ + if (pci_update_device(addr) < 0) + goto err_return; + TAILQ_FOREACH(dev, &pci_device_list, next) { if (rte_eal_compare_pci_addr(&dev->addr, addr)) continue; @@ -353,9 +359,9 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr) return -1; err_return: - RTE_LOG(WARNING, EAL, "Requested device " PCI_PRI_FMT - " cannot be used\n", dev->addr.domain, dev->addr.bus, - dev->addr.devid, dev->addr.function); + RTE_LOG(WARNING, EAL, + "Requested device " PCI_PRI_FMT " cannot be used\n", + addr->domain, addr->bus, addr->devid, addr->function); return -1; } diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0753b42..11329cf 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -468,9 +468,6 @@ rte_eth_dev_is_detachable(uint8_t port_id) static int rte_eth_dev_attach_pdev(struct rte_pci_addr *addr, uint8_t *port_id) { - /* re-construct pci_device_list */ - if (rte_eal_pci_scan()) - goto err; /* Invoke probe func of the driver can handle the new device. */ if (rte_eal_pci_probe_one(addr)) goto err; -- 2.7.4