From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0075.outbound.protection.outlook.com [157.56.111.75]) by dpdk.org (Postfix) with ESMTP id DCCC0B436 for ; Tue, 21 Jun 2016 14:03:14 +0200 (CEST) Received: from BN3PR0301CA0040.namprd03.prod.outlook.com (10.160.180.178) by SN1PR0301MB1630.namprd03.prod.outlook.com (10.162.130.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Tue, 21 Jun 2016 12:03:13 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::191) by BN3PR0301CA0040.outlook.office365.com (2a01:111:e400:4000::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Tue, 21 Jun 2016 12:03:13 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Tue, 21 Jun 2016 12:03:12 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u5LC2TDV004076; Tue, 21 Jun 2016 05:03:10 -0700 From: Shreyansh Jain To: CC: , Date: Tue, 21 Jun 2016 17:32:43 +0530 Message-ID: <1466510566-9240-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131109841932669355; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(36756003)(586003)(76176999)(11100500001)(77096005)(104016004)(8676002)(189998001)(110136002)(229853001)(97736004)(92566002)(50466002)(7846002)(81166006)(6806005)(50986999)(87936001)(5890100001)(5003940100001)(356003)(81156014)(48376002)(33646002)(85426001)(575784001)(2351001)(2950100001)(19580405001)(47776003)(106466001)(19580395003)(68736007)(86362001)(2906002)(4326007)(69596002)(50226002)(8936002)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0301MB1630; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD015; 1:MF2IMtRHrEG1Xibx9PpoRgvgtkj9PosWyg9ukjWrS7wFESpp8Z029fKXXB/odw86o+XLhJUvgadJZhg3qzuoEtZXdFJHEUl4/cQdB4/6F102Wztm+8DFXSqI+RaeJ5Gfb0bFU7QPaaoOjHH7tHj7ng4O2JicoIikLVztXiY2nVsFIUSx8NIo41mySH2Uox86mbE18HHKJLn8Ard9nubGFwqTb0d8/vvba3eE+jpiflldFH7iI1TvSPu7i6oJ4E1SxdDZbZQAdJ7fh5UASc7m4A6YHUz5EmwP93yqNg5UwPiwSCZiHBbmnFgeSXpvuxj3ZaUShpVIlvZmVHPtgO4Zpy2LklS+eJNMRm6xnAXNv8vnQiNZzyO+ONv4HFQeUQ8JlhMEuKKT2P262aF5hrqj4BjgsrhSD21qI9kGDOSCStqG6ZXIn4HGngGJACTYYL4I6sUGPDiHKj5i1LbPj9QXyvoLkboURjEt/hsDrsCVUye4v/cyLOsRQKDLWgkY05EPn4styAYLP4FdUkR2Lx0g3FBbEfHbRWEbnEg1uGg3/XGKC87s/6SdnUhIA6Omddd00AlXIsnfAUW/ssGudDjxhA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 733f5dd0-7c87-45d9-8eef-08d399cc0566 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1630; 2:UaMPmRqWIKKYZ8PZ0TaVqmfg12nRzknTXEKf66oAZAUkFe1HK7uTC62GeCZ81Y9a6I3F9x/Xp/bvFtRSN7LrAKb07Kp3JaWovEw9SOzSO7sjmCAZLfisRqTQJRVDahbKj0pOS20fet7yC1I46r2mHunknD2gFDRDRQpVHn/6lWnidka6AERoN2uSBtSqlers; 3:jgLIm73P7W+ih4+H2kgflKI3dZpsZFaU1m+hdm5+zQlU9fgl3vlg5CT7kcatA9G1olb6SsksniFWqftt5ZdUGf2dIDUuq981OI8SlG3JVrE/cnBpy3xSOUIfrovSFmocBUJhZgF8DuBDKXsh18gizL5dmc91kCyhn6VoiaXRShEfzx+t11AQeMRVK00bR7wj2/+ML30Ld7ZBB2nCu1Py/IEqL9BReA/YG766nev3bU8=; 25:8YIOsoowO62JWH3uQ6o3ZLQfB3rt3bc0wilH63hX27IKM26xrqH6GpAO4gg54S6jSMYNey+av2P/7ylTtA2fWuWaV3YPeXHeyotZpUI2BjuO0ryxUHhlIt0c5CobEHlwI2lzlSEYankVHTMTw57mnRLRe47mI0Wrx3FKqRt0SY9tzQ/JWifL9CxwgnggRg8GbyEynBvOGHQghZ/2/RjtnIyZaslA/a84yVAPWzAezztqmGiy1f6oUjtf7LmO3Kj1N4+MBnkpsrfJBwAsCJV9hrRXdsQnjDWmfRkgG3aCAbtSmVWvhLUSbFdTetUIlLk9ynXoakBAmyM8N5KKk8fXLoDBvKyySb432fbrVrOE4dCNqQsT5wCPnOq9gFF2p6i0VUjLbvBX7Yw0F7Yeby6e3GG+LD8iXzzEVc5fB+CYEnU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1630; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13023025)(5005006)(13024025)(13018025)(13015025)(8121501046)(10201501046)(3002001)(6055026); SRVR:SN1PR0301MB1630; BCL:0; PCL:0; RULEID:(400006); SRVR:SN1PR0301MB1630; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1630; 4:R+0oTaxTSSUGa88UxzrZiZRCxKKipfTMti5A5DswaeJ1rOaJcxbeuhhz8eGZDh36WSGdMJB3gyMo/Uh6jgwmALIb6l/CyBPNYCH+ypHey64/QAkdOgGiGWA1NCepDp6SdXjpfnrq84I0IjHuuQyg3g8VDHfSrT7ngN56pZr9uDJc2K7GEZdHj2zDMGiXqyTQQYXlQcAyESpzzRoU9xEoNqOVWNOOb/HMt5GOCOytLokE6FCOeuUNOYx+H93zijpTSDIjMfb6gXDspF5VAqsvYM97Xsl3cXjs5XXnhVdqgS9O+tDesORRDYiSH4e7E/KXQwO42phCJR9FHzILVyUIZyHAk+u/rn1D0jWiJSN3pr/LTP7J3C9e+s8A7WUtQfQGqzSY+er+VfRjv/x+VvbrkZxFTPCRACRj+mbXYcI9ReNIfOLlSapuPhEgTxUXw4QSnPIIqTYrMsjxYo9d8DE3iDtoAEj1gGYJr4SPn5tjyAJTnGPa/hHVjhv3D638EFZDveUYRydQz4F/dy8hHGIeJA== X-Forefront-PRVS: 098076C36C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1630; 23:fMcAxKnFL5N+Lpiw/a46zUTiX0N+Lk9SLXo5RNf?= =?us-ascii?Q?a17YXKMbing8tIMjir41CM+htfR/4PyvgegNAfpgDZlo8SP63uRqKtZnHH6v?= =?us-ascii?Q?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1ypzgQrZItq9xgyZ20EwXEoKkbRP74/Zq1UhMGZlM78aKFpr4TB3lAcpXah4hX3RTE2l5osUM3hTguCU8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 12:03:12.9081 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1630 Subject: [dpdk-dev] [PATCH v4 14/17] 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, 21 Jun 2016 12:03:15 -0000 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 | 11 ++++++++--- lib/librte_ether/rte_ethdev.c | 3 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index dfd0a8c..d05dda4 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -339,6 +339,11 @@ 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; @@ -351,9 +356,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 ace8353..6f2b169 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -469,9 +469,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