From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0088.outbound.protection.outlook.com [65.55.169.88]) by dpdk.org (Postfix) with ESMTP id AFB7ECB48 for ; Thu, 16 Jun 2016 16:07:09 +0200 (CEST) Received: from BY2PR03CA043.namprd03.prod.outlook.com (10.141.249.16) by CY1PR0301MB1626.namprd03.prod.outlook.com (10.162.166.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8; Thu, 16 Jun 2016 14:07:08 +0000 Received: from BY2FFO11FD026.protection.gbl (2a01:111:f400:7c0c::165) by BY2PR03CA043.outlook.office365.com (2a01:111:e400:2c5d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.517.8 via Frontend Transport; Thu, 16 Jun 2016 14:07:08 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD026.mail.protection.outlook.com (10.1.15.215) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Thu, 16 Jun 2016 14:07:08 +0000 Received: from Tophie.ap.freescale.net (Tophie.ap.freescale.net [10.232.14.199]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u5GE6XoF026530; Thu, 16 Jun 2016 07:07:06 -0700 From: Shreyansh Jain To: CC: , , David Marchand Date: Thu, 16 Jun 2016 19:36:48 +0530 Message-ID: <1466086011-11920-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> References: <1454076516-21591-1-git-send-email-david.marchand@6wind.com> <1466086011-11920-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131105596285027050; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(229853001)(2950100001)(5003940100001)(77096005)(8936002)(92566002)(19580405001)(87936001)(68736007)(85426001)(69596002)(48376002)(19580395003)(50466002)(33646002)(50226002)(106466001)(86362001)(105606002)(575784001)(36756003)(586003)(97736004)(81156014)(81166006)(2906002)(11100500001)(110136002)(8676002)(189998001)(47776003)(6806005)(5890100001)(104016004)(5008740100001)(356003)(50986999)(76176999)(4326007)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1626; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD026; 1:OcCNwbS/MMgk/JjH9ZGZ/42hYh9B9tBDL4nA9HRdI8ICJUv2IKngvhqwoV/epf13i95zGf975xY8FT2ghevpIadxbhgM3tHiBTtJAV2QBrw6a/AnkjifvDYXzzaaqV6X0mpjBUNHMI8GV4dECdekzamhyOHzBsLFQ6R66I/Ao0szuo+f8PjFIXtW2zzHiFTSo6MLTxV4ymnJkngccoTj0MotHsBmFhYIKnIfgEoXskRyvdA+E3AEiDREJA3RvLEEZzwHcMCviYjwJdWtIB98R3vQrc131Inrdk6jAKu+Wbr4YO3Xqe/jc/qK+X5W6JvByAVVkeO5Bbn0W70Zlu6IwCnw/xh3c+NkBJKlq8DevRCux+nuJwK4cOe1p/wP+TiZq70h75gH5tzIBXmNYc1sY4Hqpi+E4S4Fn5Jvx2/znfgjfueKYjNNdAM+DxQl9JuuURMiZbcFGqi/cFXO3k8mLYHvDRvtgXyL/u+14aeg+qcfmDllk7QFWYwuow/sjVWpFTj/cPvUmBMoPhdctlYiLvVLiRLvjXZpCqpzgsZoROCIzo5cSw9ykp/W2nEmixArXq8Hz85iWqNQKQK8aFXZjw== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: cd587063-0942-4fc2-218a-08d395ef8117 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1626; 2:UBmi4izaFelkj+ygYSrIiY/XD9iAOQQe6XrNftz2hNJTn4bZZrJhqlKLnLYpuIJSwXFKfJ0x3b9PaluuZ2885rwa8EmsVGWYtmJtYUTHrZSr/ivEW9XTtURWE4uO9bBGd5rJAVjLLEy9lXt6rlY3GEggOhrU8EtUSuonVA5Autn5Ic8pTPKF6iRfC72wyvi/; 3:16KSg8x3CrD05CJTX2jGWJ0YCasZgzvrhljkQHZ6sPCCDtqAW8KQUJU0bwlvibHgWAQW4GSWH63CwS+cYWjf9pQwyhq03pljcdIAadiGyB5dmBJ+kFeSlPJhsi7dcNZTOFrmmOi/oSoMW2aSYsyuoUNaj++DmfDJtjJ0TLYge6NKNAHy869DQw1WzLyAxSNbK68+vtagTCpUMUj0JMjbssmmW49pvpTM0UuKOG0Uo7c=; 25:aD2mDz+mk7toNzqk0FAEMtaQJ7z1IvZwQlBnOBtXgHaQfzobzBjVfBwCbkZghdL+sq4iQY9CTOZuA4w/PmIXW/T4+NHd20W0jix6OYeU5696fwGBwFWFvicDUbIll75/1HWFZR+aBmBnkeUFAlTvrX7wGrqT/MK+YHWISWntubvLy8hGbTW5RGZ8YkDiNSNRexqNclLHaL7QQzXtnCoGsZ+C9rq2riLjPvWkrjYmED/VuUq+V5R0KKVeECQ9KJZ2niw88WtxTweGGJpyefDkoM+9BTR3dwd6/0tN0XHUQIR4ZTRUmeZDwyPTMR9PNgRwjZWREgfJYD2ABvWaakwwhLjbo3S9sxeqn5TObEXOeDoKMh1bqekhKkWYESYZKzXGHFNl6HkmaGDtAsJuud68lGvHViaAfsTaEis5esjMSfM= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1626; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13023025)(13017025)(13024025)(13015025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB1626; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB1626; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1626; 4:qmiulDzWduQLr6qGjYThk2gkowp8UFWvU4TyfGd9izAVKdJj+RFoqDZxjPp8QmLa6BEFog5kSNU9ED5/jm1fnxSoXENMswW3Eh/tk6QmZqOufA6lq3CvhcaCx2qH7+3otS3k4O1L4ud0cfYJdkFNT0XQXezf/hAClbfPhqlOknGb/iaR3MNEjaw0ebKZZjnPUc4+sZKRMsnfB4JCNsVgskat+xSbW/FNvSHKhvoCiCMqx9q4khanz95AI7NjjbXCx0ZRTbZhAnr3FEfHFrTWEm1gUHBpKSnZhArTP4rTgspV0s7zMJ1T1b1vLN3kIhM7xsUgpbLskjy4QHGxlT5Ftn+JTzpPxubH//f961pnCRDjmdh7D4UDquX5oSDjGek3I1v8TfAk/5uaJV1JYs1cK3UtblJ1OgeMHiqagbOXzos3KIu7LMYCOCVtcXrqG3eoQwo+n7tzj9IR7DstkI+zcLbE3VjVPiHiAIHNI7BuvqU= X-Forefront-PRVS: 09752BC779 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1626; 23:2otPU2pbYR71IUZq8cXYtkXbMWxqrrLPyPPqBHh?= =?us-ascii?Q?iKcbkCzjgRha6NTWAgs5YtugxMWvtFjICjgYE4JOEePoveNF4RJsIUnVJy1w?= =?us-ascii?Q?hEXv16B29yUUjMNBpvsJ4s8s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yFq/t8vXnsX3YmbFUYzA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2016 14:07:08.3779 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1626 Subject: [dpdk-dev] [PATCH v3 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: Thu, 16 Jun 2016 14:07:10 -0000 From: David Marchand No need to scan all devices, we only need to update the device being attached. Signed-off-by: David Marchand --- 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 dfd0a8c..d05dda4 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 5bcf610..a496521 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -463,9 +463,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