From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0079.outbound.protection.outlook.com [104.47.38.79]) by dpdk.org (Postfix) with ESMTP id D1D348E7D for ; Wed, 7 Sep 2016 16:10:02 +0200 (CEST) Received: from BN3PR0301CA0067.namprd03.prod.outlook.com (10.160.152.163) by MWHPR03MB2448.namprd03.prod.outlook.com (10.169.200.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Wed, 7 Sep 2016 14:10:01 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::124) by BN3PR0301CA0067.outlook.office365.com (2a01:111:e400:401e::35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 7 Sep 2016 14:10:01 +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 BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 7 Sep 2016 14:10:00 +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 u87E8BCu013556; Wed, 7 Sep 2016 07:09:58 -0700 From: Shreyansh Jain To: CC: , Shreyansh Jain , "David Marchand" Date: Wed, 7 Sep 2016 19:38:03 +0530 Message-ID: <1473257297-7221-12-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177310008390527; (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)(5890100001)(5003940100001)(356003)(7846002)(8676002)(8936002)(81156014)(81166006)(2950100001)(36756003)(97736004)(48376002)(5660300001)(2906002)(92566002)(50226002)(19580395003)(626004)(19580405001)(104016004)(8666005)(189998001)(11100500001)(110136002)(50986999)(4326007)(33646002)(85426001)(50466002)(105606002)(229853001)(106466001)(2351001)(87936001)(76176999)(575784001)(47776003)(586003)(305945005)(68736007)(86362001)(77096005)(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; BY2FFO11FD046; 1:hoBzRCZ4txIfQkM45Jk6+o9UXnIgYIT9QhFfRMdd409VNDoJcmSJIw9ST/15Ygm/1cJlBtwIEH/0ClWDuYcy64LK8RqhjeUdawPIkgZQJXyYi452YO+dFozFLH5kJ7NtTNj0f+8k9vOT2WZyxartv/XAl9QnEOnnRsiJY4eVytIeLm6F4s126AIZkMIJblIa3fuwtjPmlAXbaFdyyeI/VIu1ONU/WCytH78Y/ZQXppxnwV0TS9EJYj+BWVDiFRi4tQi1xksSYS4pQSA1d1NceSDYRu23kCMeZYw7sQvzO4069KN45jR3EUrpXKHabXi+5NKiuWZp+56OQosN2MC/RW3ZvU2VUbj1EiJBazoyJ+1IQNPFV+zQ0xh5f/qxTF6n8X8Hkx2whKhjt3MmYvim3gToOBWZi9JNFi2Goobt2Ks+OKUGm0xtycki0lHvpzG7oGyn974HNtcJuV1egVivBnpuNUndY1d2XSqIKdLe0iB81T5m1aEmCzGsqK5gI3rrPtThYpg2uGSZZesuTwVmSylRy9qalHxRC7HIDMU6Vv9RDHPK073Q3d/EFjhbYyirRI0XzFn/zQbF4wMFzb2D17BymqoCwj6bopBfKotcIe/zAoS0YsVFA/7QK/TfZ58B MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a6ff2527-48c6-4dcb-2887-08d3d728a808 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 2:ZGq29mk6850Ef044GpgVnUi+er1euwbzBXa4+XkmBEvVpzRKrwW21UDhEEicdlEzBgRVN3ufMIGM1mXgyUkj/OH4A6OArKo8v0yFvWA6HMWYKqIK6C02lIw1mZS7NOM3zIYdHrg/a3BvyAKw1Y/WpMT8BZEDMwGmJ77HGRv2ab42Zo1vw10j1OzbGCVDpRha; 3:hrtutT/mP7HQ6VjLjURi3/KsoGjSysod/ljmiK03l07eVA33AQfYZmLDFVp5vnP3s1uC1+Okd9YIIhDWGFJAhPjy6db+ILbZ0EEYi8WFEELc52EIPlJt4jiDPqhjg8+QvoXRso3khkoag/m594DNF0x4Du92BoMEmMg7Q5qfk4k1x+mUF1oaAir8AWXZKmS9x+yPVR23CmvjkLXC1LQBC1YtuUvQP3JCTvyHLfqfDdA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2448; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 25:bZySEwWfc0nTieL5eH6F4hsQwS2mYgj7ET0CCmTg5HiWb6m2rskk6mwO7OpeitJvxmgVwaXMnFr2avKJ6yVp9MFN/9jjvK+GBxIovjDekNbd80VtgL3I/dDhfkXEnD5dVxilnafkuS6m8DLNdCYhlwrmKgRSh0JChRquMlIbZ3EBiiOY2SOqEFXsIDR0WNVZ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N89GwInTUQG8eGCwTuWbERYuR7UBtEtgkU+Xu5B9wiq5Q+9y2TShQy725CTo5DyRBmA8NndR3jDii1+h2s+1Ir/6RD60wQXDsXZfNZYKn4re1DJ+FzcCXscIPqbvRsIxJTQIXWrYvkZ+X36rkI6SLVsuMgyBABd7Dv3NCtkW1LE0XYjx+62XaqFVMZ+HOyGsVeAy0FUHdLXPYpkU3+NB6YcGgiXgOT2MSe1Dxhudlt2+GT7hnJOytOq9neHTV12b7PBzvXkpMmX+LGFLIKUES2QBiDx+/lTtDttGV1AmSDvHHYfyGKyz6FOh721fEY+cODdj2Qoi+a2C9dPk/x5aoa0+5alwCJjvzxSn0= 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)(13017025)(13023025)(13024025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2448; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2448; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2448; 23:JgZV/s0bdGA/pAqcqy/Y6RJ8hYtg00lWwkuRVvUaU?= =?us-ascii?Q?erVFPWWwgid9RMdj3u9dssr5Nt/EvsEJwRwb3bbQYvGgPcVwIXIW8KoZZUKD?= =?us-ascii?Q?aZ7FD3RhRmhOAAc5R47Myldt2N9vXdBHu6vDX6aBMrC2rILi8xn5m+RgCSp7?= =?us-ascii?Q?5eLmB9grP+xiYHFPiVfLiNeqtLgE8MqQIeBCD4tlcsTt3qW0GusRgGaoq5xE?= =?us-ascii?Q?opNxKFRbI78KFkvPltvC7nYx4UJ3PqRM+0MINjIJt9nC8+OuK2ZEctZ5Jmul?= =?us-ascii?Q?Ht/vQQTJoGdpYe862TGYii8SRrFYWD7pBtKsv+HI9GYxh4/Uad9tOKjKR8U4?= =?us-ascii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biTfxWLA/6Xw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2448; 6:FT3IClZpc1gYWwlVY4yTeMEZg5tzkeI/sL971tPvFlV/ovWHfY4oXroR9NyefxyHLSyRLdG2eCKaCdnezSxeq7pDWRbH0dU8wrE4ofAFjhZza59V4N4EFEpsEJV4YOLLUm/5eJK+obBfU+opV1sKI6csfH5b/y/KI3Uh0VwFwYkuG2poKw5F7nKMv5o/5gJEskNtaQgPpG/TkUBJ5hQ6w6ZGYjxof+fQmhpHRtQzBZHI9OhPBN09NC25jv84YSDidrD4eh2oOjRFmgZTTXdKVI1JsX+TuNfF966mX/vwBow=; 5:JwNjl3QD4+XukDYX7AFBl0ioZjwYXze8qwTqHXChv/FwL7K2SjXwwX4i36Mlxo/QuU+KP03ulX8ynvUK7ax/SlMFag+b3Knq0FXvQKfOCUiCNJrOxL3FFEdyDDKcqO4myANPmBUl4tdAY9brK9rF9zJuPDSl7Rp1HA9H2jZS710=; 24:SC2DlKHqPOjfN5Qo386Iii+Ogtj6YLlYtXPm2WwBpB2jlr9GrhKtV/lONWJwPCNQE1bBECIr28tW/Bnxb7DGt0Gmf9phDEkjdD85l1t6XWs=; 7:o6khL3fFbbKV8m8u2MSUJDXPEedQ1qa/DGUH+z8di2E7eTuZtRXl7YCEcwg0LeVKwI8H5pqZhOFZmVGIS2lJLVW1O2i5ii55s+XT7GFoy5v4dKVfLhJSMXZ2C2nZAzswnZoVZ1n3NQeRO2CQXkypy3vMnO6RPn7VnLVGY6+TBtUPArpovcA0wQLg47o8xOhtetZVLpENrkD8Nf9tfLFguuSc3Lgk1xQWo1YtnqMF1GSKFCrPkt37WTXgpEeeKdU2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2016 14:10:00.5114 (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 v9 11/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: Wed, 07 Sep 2016 14:10:03 -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