From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0061.outbound.protection.outlook.com [65.55.169.61]) by dpdk.org (Postfix) with ESMTP id 217F3C4C0 for ; Wed, 22 Jun 2016 11:06:50 +0200 (CEST) Received: from BN3PR0301CA0069.namprd03.prod.outlook.com (10.160.152.165) by CO2PR03MB2376.namprd03.prod.outlook.com (10.166.93.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12; Wed, 22 Jun 2016 09:06:49 +0000 Received: from BL2FFO11FD040.protection.gbl (2a01:111:f400:7c09::190) by BN3PR0301CA0069.outlook.office365.com (2a01:111:e400:401e::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.523.12 via Frontend Transport; Wed, 22 Jun 2016 09:06:49 +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 BL2FFO11FD040.mail.protection.outlook.com (10.173.161.136) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Wed, 22 Jun 2016 09:06:48 +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 u5M9663n022009; Wed, 22 Jun 2016 02:06:46 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 22 Jun 2016 14:36:33 +0530 Message-ID: <1466586396-22618-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1466586396-22618-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131110600085701626; (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)(1109001)(1110001)(339900001)(189002)(199003)(11100500001)(81156014)(2906002)(6806005)(5890100001)(586003)(68736007)(92566002)(19580395003)(5003940100001)(356003)(104016004)(7846002)(8676002)(81166006)(189998001)(50226002)(8936002)(110136002)(4326007)(76176999)(97736004)(229853001)(2351001)(77096005)(106466001)(87936001)(86362001)(48376002)(33646002)(50986999)(575784001)(2950100001)(50466002)(47776003)(36756003)(85426001)(69596002)(19580405001)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2376; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD040; 1:vlECXwVyRvPd8x4onUeESB1Bua5SC+suxjLr4jQ26uHV6SqoowVuZdEi3XzjEETM7JzHQfOpQ/mpqJOct1lmm2YtwzPCN5eH+NzquShl73XmBp+CcAKiVVQTLFk+nyhS03WS7KZf8fh4V+GI98skv0UaovtInT7AYjhnWV3PNdvvbYGOlSDFRIcMYKPq7+5s9YX1c6+ZVcb4FlgQ9cghaRrvFB7ECbn+bO2Lhqqifq/uKPsnWRGF9PYxKZCKT3r+5le9lRcFktrg865jawNlqRNSjUVo69eLN6h1ZU5TlxtFuCXuQKwyQX89JxfrHbizN+TxePjR7F3ZNnSppQk+N/T80kAv5n8E4kOzgrweQOgRNkZR9/08M4LklkPvYaBk0XH/3rpLaTBBC7M6wGlCasDYqURztJLJXhIoQMUllq/N6ZU3uz274dgIfkGh3qaIoAX3o6xDIooFpNV8W+LBOtpz9FfqUXzb8kzJassEXtPsJ74ATegk2X9jHWSasn6w4sfKvNAOv+43duYeTW2aLQ4YvktQPi4tQMagcAnUTqDA8dRWDwfGKgGd0SCTNfXz5tiZR+PRs+a8/zH6msSgRg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 32ca6fc2-3cfc-499a-2298-08d39a7c8ada X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2376; 2:ynBLXQUdlVLEFRaz8xqa0srZxP9+5vYyD5n+4owc67vTYoAHJgjmCe3nIoQMS9m8guDYBSRBEqoxDsGUbZtJx6BZnLR6zon13HKdHCLJKB8P3peVuvfieNmrJVB7AgclJ6ozaPkwROKN6NW99soRK5vdHb5l5Vk6blDjlnfRdEDtR82I+kWW+pEpoucohdZO; 3:OSV/7MJfHVbdNR6Zum3WNtt5Q0UH3iy4OV1qCZcIen2VvqMB4bAL0W1gn0eB6QeKCv+PMWV2XupJ07ONVTgrzWZAKY1xMkM0LvRano/79Hov5AppNYeqsgqJFlRVW28lRoaa6dVezv+eJgMxAPg6hEzxIFqp7lwa+XNUetYSesgiIkcbZG0Lgp7B1QocJNi/J8W8T1mX6J6w36hfIttrS5z65l+dqvXqVjNONqnUjRY=; 25:Rhhjla84ulksM7KDEK+0f9IwTPf8VAStdWVRCIF28UTZnWw9IeM3cr87/z/MGcFuSANhpQQ+POMXvZHv9X4Ada7UGI0yCzSLeIldCMCkE6qAz4oR/Nm+62hayrg/XhnDZLTF1OnGBA76eHskP9oKr/33GGwk1P0u9aTRXa5Q6hjorJd1EXOjm53LI9IR8S5pQaw44tBShW/fKQoB0VeoTfSCf/iGP1LWHerxZBaC1wO+X3ZPyHGGnbw5UQPZeZxwlD1oG0NAqjwApDlhl5eAmmfyM3VyzLMWFjw0sUigDT+nPEA7MS5qpECttB84V+LbH9/XVX6mLV98LnSQlUgGGz7NFlx0vn0t9P6CUAf3xLruPGG/kCAAgoJsvlAVy0koMTwz93Y/IAImsTAEETDwYH19FE8EuX/bH6+WDtjDD0g= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR03MB2376; 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)(13018025)(8121501046)(13017025)(13015025)(13024025)(5005006)(3002001)(10201501046)(6055026); SRVR:CO2PR03MB2376; BCL:0; PCL:0; RULEID:(400006); SRVR:CO2PR03MB2376; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2376; 4:tr5w5JzD0Ie0Q7vl50Vy6wQUUtFvxf0AyrqVCxQNBP5Qjf14Fyd2/dZRVv2W8RihbLwfuBHEms6m0ve13eUbo7KmTAefZpC2pnCKoE4B7qJXCjU/It+xZWfEHL8KU6/OIYli8ctFfeB7+qCoBhcQY7Y4Q8vVEarCVwlneBTzXvcNRk5Udh5SV/fO1lzhg/rQXQdH6LotGo1Lc4rmHKYMkJp2zNVnIGTi5SFxiy6M134OzYvjzn0Q/Ov5eXUvzmHaEmx2e6mo4gOh93pe017zuTBrM46NJ5Sc0SIKaOT4j/8jbl2KjFesNESqK/+AIxrpCPxZgQQFaySCHWAlNI76jAQW3e0uu/Pjny0LsWZ0Q5WP6p/iQsnEztXg0sOmR16d/fRvwekhWrwhbDLtVmvCz28h/ZvUfXKihOv9MFZvlk8xesmCKDODl/alWPXl+lHENX0+ZCDGEDLZG+lvXJZFViL2nVJUG7MjV7Wi8ohtrS1YGYWQEiQXFRqzJBpbC8Q1zAHNSeQA74xAtxrpNfVdWQ== X-Forefront-PRVS: 0981815F2F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2376; 23:3FN/cgh+QXIIyxxXdOlcdQ08cQF/NDCYU/Hdjww6o?= =?us-ascii?Q?3gqBW90nH7LckTyuDeHopja1Y/vp02iKVNVfu/mu4bHskmsQHTLQHH0KsWyc?= =?us-ascii?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sR3i8nHkjlNTqVDYqK6LgfE8+puKcrAz6TfVObP190IcNyjQeMKFr4M5hsM09Aa4mDCdRwX5xx/QjfaGnGe7BjZNfMtBUB7BpaU/lqw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2016 09:06:48.3361 (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: CO2PR03MB2376 Subject: [dpdk-dev] [PATCH v5 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: Wed, 22 Jun 2016 09:06:50 -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 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 ace8353..6f2b169 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