From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0084.outbound.protection.outlook.com [104.47.42.84]) by dpdk.org (Postfix) with ESMTP id 9D8FA5A7B for ; Fri, 26 Aug 2016 15:57:57 +0200 (CEST) Received: from BN6PR03CA0060.namprd03.prod.outlook.com (10.173.137.22) by DM2PR0301MB0719.namprd03.prod.outlook.com (10.160.97.14) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Fri, 26 Aug 2016 13:57:55 +0000 Received: from BY2FFO11FD033.protection.gbl (2a01:111:f400:7c0c::146) by BN6PR03CA0060.outlook.office365.com (2603:10b6:404:4c::22) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Fri, 26 Aug 2016 13:57:54 +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 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.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:57:54 +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 u7QDvHpm023630; Fri, 26 Aug 2016 06:57:52 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:26:49 +0530 Message-ID: <1472219823-29486-12-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166934752198837; (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)(106466001)(105606002)(50226002)(2950100001)(92566002)(104016004)(7846002)(47776003)(2351001)(81156014)(229853001)(81166006)(8676002)(8936002)(4326007)(305945005)(2906002)(8666005)(33646002)(68736007)(5003940100001)(356003)(86362001)(626004)(36756003)(19580395003)(77096005)(575784001)(586003)(11100500001)(19580405001)(85426001)(189998001)(76176999)(5890100001)(110136002)(5660300001)(50986999)(97736004)(50466002)(48376002)(87936001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0719; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD033; 1:a+7NJ8Hl4Yn0gG79sFFmS+pD0N6drq5LbirKMqaJ/9h7NIfPqt+RRodM3T0UbpVS0cmlW0Sn3n+fjZ5gGBV8PM2mcF470dkrnC67yat3yZjJxkSgiK5rbz6cxE9OhxgU/K7Wvu0j5XE7wPiS46NpNd62UMuejzMiUjfrV4abJk1EIN4gBSuQNu4/Ag5Q2G41IdwQhk/7pyLObZkdk8n9/lrFLF32VxxUEaCYxRtiq0P69SqjXMYMn2aeSbXC/A9ZAP1gB5vPfyynucau4ltRz5YIuwTyJALIouryRAyR4yn3WzC/XWvsxexm/MSQjSVSg2SH73Kprh0t3TClLD0lZyI/9/s4rYQ3p1dJDaHf7rhnHX0oHNSW2lEwSFeaCCjmz/gfvoIv/j5ezRMC0zrldW5F6rJpu1KFLGLlPEMiF4xV+4c2V+1s/k74Q9+IJNR48qxImgTbFrNRy+EnM01X2yxKT9asxce94R5tiJpGErah9lR1DZesg4JQjrNcItZYIFrPn74Wzz6fB+Hvch4Nm63FGocD86LUkWbsJSpNxqIkTTkWTBfxMtjQWeofpvEalGePkQ5mgS9Hygyjys51qR9k8lP36FG41OOuxxWY+XCv7McHhzO5as3ElzgMMXbxbRQ35LsyAfIHUVI1USXGCDITkUlMEVgIc9iUW9LIkm+kzieCG6Q8NyjDxcHizwUGhcmN31kE+MnMKn8mcbb6ITibSrepWs655b+g1T5Sgts= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 6ed1f652-3907-4767-144c-08d3cdb8fa90 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0719; 2:BrSaQQQG0Mk7GDEN0uGjQ/tbQt8CyAl/OpXIJGt52ilqHSVv14PHR/ApA0ldT40vW9zFL+OAhGgb2bBRqDhGSE0GdVAKdYePuhEfAfgldEC4ia3HI9TOs85fFYk7ffxkTp6mg6VUDLxGHf648Rf6TAsZeuWTDPAQWZik5jBbLnTIWgBUxZJH0Fz9+P1Q3Evw; 3:LSvfWeqxF+GmQlMY5mLy5js/kknc08yBZSP+kse61LnanGKIc6G33TzwG1Ygl+Na9AgUXCL9yz8X8eA+MPr5V4MSc7yko5kBTw2NcAh1dF0gpTap78FU0B/J7eij1r/CeqhHBFrZG0b1NaNTykQ/nJmn+I713l/4899pBK0c5qLH4T6KgnmltBDmWmRQNFtR1Xy42A8H0qJoi52aaK5ybIPOG4VMxlzpPFYUJJjezHQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0719; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0719; 25:aZBjSM0nq8guhq5fnKJhxEYXfRpVlwOzB03WhYS+kSAqBhddNPXe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G+hWtvP/6vhSQ9efYvQcLTPzcDEAQcdEP+FT0PnFESMahTWAxn2mVQzwiAHS2SF7vRri0ql9lkQa+AQOWmLn+kxsryX0no3N4YI+bDdZuq88ZoD4ACzbW8QNQJt1TtjZowrxFIBAjEG+svY6e/tiQxQGJ6r0BiEChg5037M3NJtXfPVNnPt8r0mcA2C+H+gAfogXkGL9D7+dy9Hp0xUVG29fobQjeG5H3MBFv5nn27MHA8XEauqWraq5gHHjpIh2hH1EN88EXEWQG3uEHMfaZ+KCKeXlVK62a8y8IYrnaJzqiJMO8Pf2+TfGe6thwwEACj/xaStd+V7mBgO59QzXOt6rJacZs742IDK4jbhAR1HMXtEqMLC/ngBUV0iXAxGEYd65i8TTVMtRseLbDQqsi1PK6rcLXYHGUO/4fYVFSMIFDmuL9wXZscKRyceBdP4xx682jzTRE5nHOmikMIW/8Ls4l0p9kBxb1eSJA7cxM= 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)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:DM2PR0301MB0719; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0719; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0719; 23:fjBxqYXiEyip7x/OJ9rgFqkpcXj/KsCNwM+nTbe?= =?us-ascii?Q?b23diFLaqQQP0J+JDPEKywvCtWYdIh1umtPogPxD+1yyM6kaeislG32Be2Gl?= =?us-ascii?Q?RBgPCh6Gu745hbAfr76Gy4nF35tm/U2bA3me2OQSjXj7z7pCz21pxWya43LE?= =?us-ascii?Q?ZHbGgFbxF4PQRsucBD510RGIkawbRE3/cCkph4O/ZtyVpgrawX7zv5uwLAnz?= =?us-ascii?Q?D1vsw2VifIjI4qqMWRWo302PniWYDaJ+738+F0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Metadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:57:54.8922 (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: DM2PR0301MB0719 Subject: [dpdk-dev] [PATCH v8 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: Fri, 26 Aug 2016 13:57:58 -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