From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0048.outbound.protection.outlook.com [104.47.40.48]) by dpdk.org (Postfix) with ESMTP id E84CB5A41 for ; Mon, 1 Aug 2016 12:45:25 +0200 (CEST) Received: from BN3PR0301CA0024.namprd03.prod.outlook.com (10.160.180.162) by BY2PR0301MB2054.namprd03.prod.outlook.com (10.163.196.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Mon, 1 Aug 2016 10:45:24 +0000 Received: from BY2FFO11FD033.protection.gbl (2a01:111:f400:7c0c::164) by BN3PR0301CA0024.outlook.office365.com (2a01:111:e400:4000::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15 via Frontend Transport; Mon, 1 Aug 2016 10:45:23 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD033.mail.protection.outlook.com (10.1.14.218) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.549.5 via Frontend Transport; Mon, 1 Aug 2016 10:45:23 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u71Aibju018422; Mon, 1 Aug 2016 03:45:21 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Mon, 1 Aug 2016 16:15:29 +0530 Message-ID: <1470048332-27318-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1470048332-27318-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131145219235081863; (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)(36756003)(575784001)(77096005)(86362001)(97736004)(68736007)(356003)(104016004)(4326007)(586003)(5890100001)(8676002)(81156014)(19580395003)(92566002)(19580405001)(7846002)(105606002)(305945005)(2351001)(229853001)(8936002)(2950100001)(2906002)(87936001)(110136002)(33646002)(50986999)(85426001)(5003940100001)(47776003)(50466002)(50226002)(11100500001)(189998001)(81166006)(106466001)(48376002)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2054; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD033; 1:GJmqNUXJOG755VYzbSDoVl7kCT9sHTkFSBck3EvtSQLF1dD6uw6OGVqre0FmD4UcN9/U2MmDArI2Gjs2AFYF5htyoC3/8ExwN802Ur5LHoG+vAs0MigzQurJqLpnhHiGeg2z3fNLw0lZAeBiC1IuBw1jRY1R5EEMMKpDiKzRbD6qmILHWb55MBGGIIhfk/UL8XIWZVPj36Q4LESwjSBoS3cZLkeKSJhh7wxC6dyKoCNxXakksorClQ6Z1optY2Kj5w8mvhu9usb9j70UvQUzdjv2pPeCur6TVxmSeuLiOWJpg8YRU2N5mAjmUoX4yqRUrRsrhw2wMuLhysn1Jco4CnHlcqrbl0n18+IH85DVDQRDnHSkdSVBdFVhL6Yhzz58mIymNL8Ie2ujshdWWrGpKVPSaUnwDjxsutYGz1dbgb3Zmzc3V55Vnp8PuLw1yRxUFCcUXs5Ng1PREaHZljIF0hQp0+yuXtMIm122lcy4hOIdyaW1XV59+65OZj9kj2sjkNpQLPzGLeyw6fOd2mIvlUDbUGKqFaQIdB+THJ15IabncytwYuXe1o69uydPEj6Z1FqNp2eXGeCbI3tivclsBoz00fihMRH+NOFVVUedCH4RkG3DbVgvKZH892aAAznT MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e8907071-14bd-4c5e-6e87-08d3b9f8f0f6 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2054; 2:IWiCTBfJTfvfNHI5bQzqn90jkrWX3LQs9iRmRQcanMisEQMY73UTb703LFYaUw03Fra1708Vd7XbZgyi7PKjyPct5LucdXspCw+0Hg2CBiU8KGtShJ1VOry20xURS9AK2eaJ01hEcbNFMJvXqFza4uho9MwBfI1cSS2Qx1VIvzRytZm8sBu77EzyZZNxfaGq; 3:1+03IRyHpRwvx2R0diPRTxoJtLVUxl0XGD7+WyR5wMMdgmYCDhZXpLJkXwY0gQTnwjfDZ/iHR8c18i07xC7SETBcyuRG0qwKNGXFLw8IJvF5zRmS+l9aq05pPFvi04LJH8Ul7QGivLt59Z+VUcliBT0o3SNsWeJZG3F0wru4H4i7kzoVEOEYnztCZOWtpCbMbB9fFQKZklqImRyWKwWtRHDFrfKsKHe6VQPHcxwWzHo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2054; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2054; 25:c6kua7maN6PEUyxhRhUNyXWhJ8AGCkwSKMr8d2LKzJtTAAj1M6Km4NvdfLov7EJBqcPvmCSRVAVCOv+UVN1kZDryurY+FU3TpG7oa+ofpIJU1Ap+sDPlEniaFgcqLFy8TDbTR7K8bWqCX8rBz6NfzM+T8ns3HnwL/yfaCtV4+7UuQspMsXoVYkylPrM5GkT1ALOnHND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D4WEJZnrK5SREXpYxFb94vvHAdbG+wncZxCpcUbCJZwy3icYK/rwXStbmzgIIv1+lMV0zaGNdPsFa5T0hDe5H8/uDEenvWGmVEzHtdLmkfuy/vAg+WV6TFpvSO8RMrHE947b1hBUBcX0FmXPtCmmT23CNuPvvw0/QyIK8BXcWUqwvFgGB99wm/bPwqCXdAB/m19A6+OOGDd8h17dtzl9/7oz79sE07wgrSldL88UsmGopJQ1HlBYR0e2TJn5eHb6cq4s7GRCJ6v603JqwfpGF8Z8OHaygWSJ7n7CuK0vZd0FzHA8ecAvrACLimuZ4i+BjEAw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13024025)(13015025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2054; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2054; X-Forefront-PRVS: 0021920B5A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2054; 23:vdwXyzmQdUHDk1g615Hp/KgkRPMCKJgxhnz8shK?= =?us-ascii?Q?vNGgqd/xFcTYL/tqVDlin++6m1/pNH2MERl2pCdsS14ECotxkBTzoy+cPqf0?= =?us-ascii?Q?BoNZ7MyPD8zlgpxth1qjMz9rthQ204LC1W94Paz/7Bj5hJmr/ypl1UHTjilO?= =?us-ascii?Q?tu39ir3iuSzx5aDLuAdmWryY9tTXnk6Jc/5qtKZKn42wVbHosU1dct0hyL78?= =?us-ascii?Q?vZiaVw2Uu9v0cL++Pk6bjqxHMaGWApxnxB8XJWWRyHEpOEiv9tGVmDIhK92I?= =?us-ascii?Q?3/H6r3JUS1JSvs6WZJbLUoEoFOHh5NYS3kr4xBKLAGVsGLwOLSh43PUbhg3D?= =?us-ascii?Q?TB4VDmCE8Ei5G7TCm8Gl5qD8lCF7EZBFFNKN8OZBbUIe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amdtvFz4yFHA/qfUwpnm1AGNjQCAeFklXAIvhI42Bfj/LQucurfxdmH3V/2xKM7uxeX8oFURaqBTvIOZ6UOV7UIC1Xk4cauaLchNxPdWYNnUxF8YBzHhMHQa0Zdc61QyjnZBFdVeVfdfGt/0YVxsd3MuGcQB2PxOoR0MrlRCdFzp5Y94tqUtZTUSSsjbfCpAXXF2VM/3c9BrPfHhAPyh6G4=; 5:jFZ94WzkVWWDHBWOJ/QXCZVs/5P3SRNu1Qy0fmSMjEZHSW5dMQbVJ2XYhFZn0+/v6KJNmx/YRKk/P3x/fORbb1acYWHq4d3NGugtNj25ly4wT54wTFEwaNIkJ7XY0feqL7PA9nL4HJlAvT0AWUBgryB5tAOVpwuFOcaefrYLtqQ=; 24:ZUF49gtJoe5r1edoZBZ1q/NclvipTgsIHSVs4qy0cMa3yILKXUYlDibY3+q5jilmM9KkTk8K0TXW4RrzR2ttM5S2CFsw0xzkuf4uMo63TDc=; 7:wwuCmWc0a+0QCGo8WnpumXXEmG1crHKvQvkS8wzCW5WjfUkNdln28UJMdAp66a/IdLSmmHnVn2oSygrVyfEG9Qc15aJ4k1pTHcgda3LGHrWrIy4JATwatjhzzdNp19KdKM9BGKr9lwHUEQzzd12mHc8wzAGv+qVuSXvBhZAGhk1WaLkqcClvSEwhFoHWwPP5KXhUbfeCSjgBmRPrjLoeIGWI99ba7ANgXEd7udx9ewuQ7d2XJjusHdwmC4qNcBOy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2016 10:45:23.3053 (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: BY2PR0301MB2054 Subject: [dpdk-dev] [PATCH v7 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: Mon, 01 Aug 2016 10:45:26 -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 6a0f6ac..da0038f 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -341,6 +341,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; @@ -353,9 +358,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 a1bb043..fdeac86 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