From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0048.outbound.protection.outlook.com [104.47.32.48]) by dpdk.org (Postfix) with ESMTP id 5CC3E5688 for ; Tue, 12 Jul 2016 08:01:36 +0200 (CEST) Received: from BN3PR0301CA0080.namprd03.prod.outlook.com (10.160.152.176) by DM2PR0301MB0784.namprd03.prod.outlook.com (10.160.97.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Tue, 12 Jul 2016 06:01:34 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:181) by BN3PR0301CA0080.outlook.office365.com (2a01:111:e400:401e::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.528.16 via Frontend Transport; Tue, 12 Jul 2016 06:01:34 +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 BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 12 Jul 2016 06:01:33 +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 u6C60qWm006202; Mon, 11 Jul 2016 23:01:31 -0700 From: Shreyansh Jain To: CC: , , Date: Tue, 12 Jul 2016 11:31:19 +0530 Message-ID: <1468303282-2806-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1468303282-2806-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131127768938276003; (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)(1110001)(1109001)(339900001)(189002)(199003)(19580405001)(6806005)(4326007)(86362001)(68736007)(7846002)(229853001)(48376002)(97736004)(19580395003)(11100500001)(8936002)(85426001)(104016004)(81166006)(575784001)(36756003)(77096005)(50226002)(305945005)(92566002)(87936001)(2906002)(2351001)(50986999)(189998001)(81156014)(356003)(50466002)(110136002)(106466001)(33646002)(105606002)(47776003)(76176999)(2950100001)(5890100001)(586003)(8676002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0784; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:MQIDiYRRjuK+8NhP+QUpo41h8I/Z7ejIP6SMNCi/mcHoDabQy7R6/KNfSN8RzClx39Ro3pmiNukq7W5JjTW/bL0Gtm4988sCMBNp+nM5nddFrzjPEbFcMaTLbJ/Dg2QU+pE/rQ/afPBXiIlJ/q8ZywlJSVkJPHSqXibP5e+xytbArUaoAOov7P+lq7I0n4lF6nC0IpGl12xIM/W2qFh8NcdqHCFSHE+C2dSZBzj7zb0Z6bvCwslbsngQLop1GzkIh/S7BHmypiJgrKImSafvx05ZSa2+QjzwXhvGKsncVDRqWbIrgKQyHU4m/rP3RPt+JwLOKUlu0F2xiHQyJoFoG5ZxQfge1gKiLtOJ5fHQra69Va2J34oNQ65lPu5FhdPjQusSQcmJWvN6P62jeD866UF5cVi2JBTfrkpVgwVyrKFIqJ4zRK4++Nz9ItGl5yj2U0Mqdbm4t/K4yHB5yi0ZIgVnLHo6M17wtaQtLAatnV9SZf9iquKF9SdbGPMJMaxZSWPFODq5Qiv0izsZcsNHhiOHiHEH2ERtly3ytY/qInllDXQkD0jN7m82fkfyKUXn5X55UCxPuTWj5cBz2NjdhOwoln7vpDwaVMQg6gIfR+7y6JllD5dZ1mRarIBafE57 MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0807c331-a4b4-43b0-64a3-08d3aa19fa38 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0784; 2:+yKxDwJXXqzSYfp+H26e6qAOW/VmV43gccZR7BSejJeybbPYb4vlbrrxS7vnrJdAxU0AFE+PCld4zWXnnPPBRMpa+0zWsuCLgK5t5rflZmeCnN72xAv0CFCzOwebCc1BLHGe4OSxtNPP393A0fI18RIvU9RdqWRXwTrUT9FciId+zgxOExh/SBoSY1NJsTUn; 3:jTBfVnrV/h8rphMDEGNHvRKcsrrCfYllNuEWAa9huBhChSNSsHO5I9c32thPBDQEMLiIJqGsXJgSWGCDB0vOhHd47jkGdkbPJi67E2za1ZnVtUwd3u/Pf+/hdRLNl+le8xHsGW8gpuqORPy/3Gz01TiBhiwN251pvn9LjArK5K6EYCUeTktXLlnwltb7n18cuL0TfGlhSIBP9WAq5iso1f8L3YcXqN/4KgrHFQNnjb4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0784; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0784; 25:PwPXAfrzrBCQNfqIEvn5erifsGZMN3oJHfzsus/IoEBQgatrQcdpJI15SRhNAGiEuPKSi11hwx5NCEzY6M53k2zGPS/1XCNDoOZKtHknB80vie5xt8ytvSEIbiad+U6cF1mwOb2hHvbHQSWpCWrFJvnILAC6yevF1PKD9W3vWVg4nZnBXUVrZI7l4tXlPajFu5aAhutlQMECliLOKkyR+z4rusvCPokZ7xCRDIywQ9Kq00lLxQjHct4CLXZ54Wqheh25NCqTr1GQla74XYp+c9I66J82PDU/1bcDTbtNvo8+RkQjaQrdFrSp1JW3r44CZS3d6LppLCzO3WISs74Qi1lAh9rb+qoePmE60NY3hyv+I8Oa/AduZfNkMhefX/3P1lwduP3xzeijbNkszHhqAf4LxgzwgB8iVVenFoYe/ZBVOl5pGTSi6pfAAD8r3E90X+pKsYf20aU8tVr/9aI4YWcj2qNi2gdnrPliVzBye0h48mSrIqudI9hV7Be0heDqzpxjJsKIKTEjqmjB+K9rZCWu6YxEbVNrJUKfVhdt/SKtpnAh3mIaGa1EwqkYLv+0f3WsitMBrO9NVUx70k5RPVY8vNYC3g+gx/XTTLN2K2UxJCENv7yYOdBC5FHhYAsFL82JADNdLfqh3BRGfPdHbEdetCWOMnVC0KaI/Nk3x2x2q0dEvdO6ry4GEEeZbJfy/r1LQLf3nelIX4pVO6rVMKOSVJ16F2chPcrM6di2MYP8DRrjG5HjrlVrtNjmqoTwuLv9b/NuXj3fi1fR/ffGrQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13024025)(13017025)(13015025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0784; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0784; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0784; 4:sm5kuSpaTT4J/aO+bYSjhMlVnEILmjxnrSHC8usD4RJ0K1IsZQiEqDcMmNQ3R7mZwXnaT+znJsdF9MBCj29pVHTlIRs9hZGiwGbqfAaUH9wFwLBhvDXxN/cIISdJ+b8QYf9iT9txteCdFvwtCDAWmetshcIqbQ4JXaIddsKfl9WX1hdIwwfN4t3cw49CYj0KYBd8FrChZjoV+b84DgLaoxprgBPqIn24mk5zg6z6xbZkbpx84L4ixa5mPSthPUl0/dCI6BJZq1MR0PZ4iFqhMr0mG46gfmf8vbDjAg1sjskIZ3xKG3BahYqB2zr5Z8+f3//QGTxaSO5mPPf41BehTFfQXPT8XR2GicFnHCQjQ7cX4+vs2P35nBu0o8lOKLUNkyFGFYPPLCqCQFj5VdDHAg82dcuyiv9v5Hk0z6FTCLQ08ympLH2PUWSFrFslk8y9OKU/WHYy/itLgnG4/Be/mc9nJqobwb2/rVesScxD4fPMjjl537cJ9OASnuJROlYqCOtmfaWjCTzxV1ebP2hQ6Q== X-Forefront-PRVS: 0001227049 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0784; 23:4Xg8Lh0gmBvo1qrXeVRaiMnaJ75P15ihsApCNMn?= =?us-ascii?Q?mL6C/llGTVuIEPJemfzciBYCUHLCpMCXke/bw/IFxyUXdWuNpzRmxjIM4f2g?= =?us-ascii?Q?X4oyAYBofydhQWcKaipbtKU2zqRM5z3byeSM+ACB6hiwUXnGqBHQ4JjOZYWv?= =?us-ascii?Q?KvnTtX3VVyxKXUASVOqgrCDTlApQUYGLRtZk1AZEhOEPQRyglaZLWDgWKj4i?= =?us-ascii?Q?y2t5jshoy3IsoFRyBQsmTDV36yQNrNEDRHvlCsHPOvepwCUk5Ja/B5fkiXUN?= =?us-ascii?Q?/ebL6OVVedsOAvy3mws8EWRRv1uEgvtnzcDAHmKgXIdXJw7xMnFsfhAQr+DF?= =?us-ascii?Q?9p3aE2EuBAmtOM7nyP6QWxjV7senhS08ZHXBX5QK6J/FLZKpbE6Ar5jQfsfH?= =?us-ascii?Q?WGW1jnY2x/d76Du5woiThS2QJ8E82B8avQcafjVjHn9N8SSQSMuKs/dKul3B?= =?us-ascii?Q?7GQipJLFILQulFqPc9AsgBIGEz2xKWR1weUFpP/CBeLvzSdK0WZCuasQHOAg?= =?us-ascii?Q?p9rc2trrtrW1vRbJjX4AXvTScHTujofpAoEHDsTs6jE3Yjx/wN0iKc5AzEnM?= =?us-ascii?Q?3YituHcEzbMLedloyCKEuqTP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; 5:8CwgWb5Ykle8SSrT91hq1+PYel/uuHGbR5pyuTkueZ3/Bhs2Yhw8FEVOOLA6wOJeV7TsungiHMxLI/zlIt7ckQBEQI8ZMN4/h2mpkkwR5zEN8w573YH/hq0zInBhmwdhEoUS5/K3HlnskBtutRwFqOYhEIvZ/VHbZpoL32nUvPw=; 24:DDNkajf1ujdRBBhfJVVeyWD6p8fT3apCnwpvYVvKu6DMrcSvzizdvtncya0CyUB6zfOHzbwOSLTddoevzQI+hwveE/db5S7uYXz/3Y8SYWc=; 7:7sZNqlod67G+kxlUR3xF0eHIrJeq3G7ZtITYur80h+DqZpZhW6UzT2e4eBR1ZzXffaz5vR9BfibOCiDZN4UMjJEjgl3hd1LuA4yb5WzHH/1ewshf8sCgBwZCx8ZUPqBc3dHx/drbpCuZo+F+YGyFkv6q2ki314WVnYMCCbgHWTeEIQB1Kas+9tbZQV8KZ1SgLr94872OuwhSLnBU9sdB2NoHIbb9QgXW1VmodBy0mLx2G37WtO9w8OaCNJMkiQY7oFcCJ856ccFgJjEX5h3aUw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2016 06:01:33.6404 (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: DM2PR0301MB0784 Subject: [dpdk-dev] [PATCH v6 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, 12 Jul 2016 06:01:37 -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 58f0c74..e001837 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 147b26f..a667012 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