From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by dpdk.org (Postfix) with ESMTP id 3E59A6A73 for ; Fri, 16 Sep 2016 06:32:41 +0200 (CEST) Received: from BY2PR03CA073.namprd03.prod.outlook.com (10.141.249.46) 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.619.10; Fri, 16 Sep 2016 04:32:40 +0000 Received: from BN1AFFO11FD013.protection.gbl (2a01:111:f400:7c10::173) by BY2PR03CA073.outlook.office365.com (2a01:111:e400:2c5d::46) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8 via Frontend Transport; Fri, 16 Sep 2016 04:32:39 +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 BN1AFFO11FD013.mail.protection.outlook.com (10.58.52.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:32:39 +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 u8G4Trfs029256; Thu, 15 Sep 2016 21:32:36 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:47 +0530 Message-ID: <1474000200-16705-13-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739595685372; (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)(199003)(189002)(305945005)(50466002)(68736007)(47776003)(104016004)(50226002)(8936002)(2906002)(36756003)(5660300001)(77096005)(86362001)(586003)(5890100001)(81156014)(50986999)(8676002)(8666005)(76176999)(7846002)(85426001)(110136003)(87936001)(189998001)(48376002)(97736004)(11100500001)(5003940100001)(81166006)(626004)(19580395003)(19580405001)(33646002)(105606002)(2351001)(106466001)(92566002)(356003)(229853001)(2950100001)(4326007)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2448; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD013; 1:JISAaYeEQWHwHfSM/WwHGJdnvJTR8p1JQWSCEsgF175cB4VCOmiSic7k2RG81MCRHPjZsLjocueHQhSfBV5IqFX3cQEHsJrmT43/AMb9A6VaGbvPrnEmJ9PmT6fMq+w+4VcuEs62bfYiifD4asB3V1grx5pXbW/UECeae8MlD8O4mEMyBDNWkcYfgKtZS2VP0gUUWanQflHglULG5ZgTXmqNoFnunbAuFbvYpjvMOtQ3WiyaKKd1mTW5QHRSQJgjLImK+sKViAeRM/1WifqWzXVm4rI4HFm36d7EJLOOClao8ZctD3xo+fcwyIleS065WXTn+/dCOzw7QgvW5G4q8mCTj6I5kR07FRI3pB3nGsIgK3mVYCMGG/qOIniL409J7kMZCAzNVMcpJGo9FAyLaKhUwyUVKrw1ytuu4f39/7utAuRAPPlIA5BJLgE5AcEyXD3DpsmarU29bikBI6Fqd+Mfoi8cvaa3fbhtIeFUNsByrtchT2r7tn4wdMZ4NYeNxOI55xMQLfuxmK5o67mJ9YEBBNOqGkCRV6S8rvcAF0dQgRdELgRk3FiGda4fSHYrS+WsEVrC4jGshzArn+1M4meZaMvpJPABXzQkHoQiRTKNZ/exVgkznJXXL35uxv2Germ6EsUQfTsfllaPaG/53tW6KCk7EErF1BhFMdrKE+YosjcAGu94ayl4nxvV56z1303d1Q7VA7wX2ZEC/HaIAKYvm+eaV1Q22ebrXzxSyQo= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 917f1c2f-86f2-42f4-830c-08d3ddea7df1 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 2:/zrVS8DuY2FoWDw3EuYeJVhHOlfqO3akpbNqV7Zk6GCZGPus697jBntHkwiq91rBe9NjVmIgBnTGw17N5H/elZwrWLLB6xTtQqXLvn2Hv/zGoCtVdKt3VSQcHHxD4BbfIf5wEd/1I/rPmFUgVWHiKkE8hoIHIb1S4tei2yE3J8AGgCGpwRkvIn6JptOBdgrD; 3:KiTqao5cLMlApzwR2/kjFntUWTTCnzJOlK1UH/Ym1scZn6w+juZqm706ApS+93s8kHJUgWRNCh+T1wJ9kkPg+kXz1JMO8MrRNOLTnzCKSeu8xmvskkKYxe8fJ4+OI6v32JFhBl7+j6CbePR5al1svCXCboPcWCcat3/rKbrlcuYSoeX6JqH+ocoiPB3jlpRE4046Idhrzq2hUuPnrTlyLsnFfpFBJ1SWCe1FXuvDQlI=; 25:Ui13mFk9Y2gEODq7BF33RQoP+MO0I6/BxMEDeRQaZvKrnfe9U9UJPP64NoNdTLqPpUZTo1VnoXCVVWeEKKp7gzLu2kSCd+jY9wcPGNnnf/W0/E+SThb7IX+IXEUCqvNE48W3hd8VCG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YESxrnMxFDL6F/thDbkHSKI89qYm7d5JvwWX3Z/tBLmBX02Ez41Es4670FkwRrOTK//o7sYKjToru09/RQDhVGHUJQIGN0WQyiWnqNeMQ= 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)(13015025)(8121501046)(5005006)(13017025)(13018025)(13023025)(13024025)(10201501046)(3002001)(6055026); SRVR:MWHPR03MB2448; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2448; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2448; 23:GWiEqjLismOP6TFqxy4kARLDUDRBmEZRme/AUOnI+?= =?us-ascii?Q?/skNQpKg+qgFYkg31dvkiEq5WwgrKYAIPi+P0NsZnDP5LksGoDZFy6uEoOHF?= =?us-ascii?Q?G897x2SEx8HvfDu/4VrLni/4WZMWZDzTZnfQmZA+egCNzHWZNUn6k93E/WXR?= =?us-ascii?Q?XzmTxTWyIeF+r9A2uigUiLHxDsxKdPoiOl5WjilYZXWZlVKvnOM+c2Octpps?= =?us-ascii?Q?64hdEN8lIrY+BeQ5/Ktz05Erm8QfRx+eJwBi81T9zhIvYdE+WgZrXwmIgS3r?= =?us-ascii?Q?M0La5zp1cKZdPg8ri97BC7XCgGHDl1VectUDnAx+lgcvf5q7V7MnHXwQEg99?= =?us-ascii?Q?KBL+8Dgpz5AwODOAZH+tVPcoh4NiT5Ks4lljspi3JRqsPHs5QyZfRGK4IQX7?= =?us-ascii?Q?f7MmrqM1exLSebWDGVUjBHv+v0G8Mr/ow0A7jZ7G0lvOUBAEgUyFhqc9St4d?= =?us-ascii?Q?NQ728BcvjkRsrlhwu++REboqxFrIV/cKJifOVLblGZ+9l8vzMTxG7Z9G4Jeh?= =?us-ascii?Q?sXJq29l5AFNqsQtpZTMxOUF/nOjCuAc6icdntYnaw98r3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dfBmyqlXaJVFl4x9faXu2hCkGqU3SvA/amGjA+i+wCzzQYYmMoXOdV9a+OwVRToC2A=; 5:XjOQwt8WZu0zvJVPH0lxAbCTlLY4tXgrcMIvnambJ00Wb8RBj14kjJPVoYVPVSYHZTxNkb7S1zDAHqBl46A32JWX1Kj61PBwQe39EvZKIeN+f8Ghss5e8vF8rnpmWR+5RcecTOcqHZrmK2HjWe0c5vViG7NJE++PwofCVJt9eFo=; 24:69t053rRoKc02tlvfjqAKlhL6J4BHDqG4gBy5ODGkS838ai41O2U3F3Z+jRARKZxqqf+6hb6UygFw3/6zqAwFTlRrgo1eTjOiK2gUOx8Ku4=; 7:0/U3ElooYAPL0s+EvAo4c+q0RCOMuv2Wu9aStkUTX5ztyqwYt+o1EjSjv4A8VPObBhP2TKCghHbVK3GlbMqP7S5fAUceQVo9cWoNnvoVKuaqnRCqT1jW397J1wXFzlltKKm7rp4zve7Z9fLpPU/MCaCR2YbLWOyLB2WoaCyl4KU29oeBwdpsAaYR1kc/48hQ4yNKkkENjfGFqimd2xdpisu9rDzo9+tshry1PQ/hAHTz0YFJDjF8cbFjuarFa0Sp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:32:39.2565 (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 v10 12/25] 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: Fri, 16 Sep 2016 04:32:42 -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 e80cab4..3ef5c84 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