From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0064.outbound.protection.outlook.com [104.47.36.64]) by dpdk.org (Postfix) with ESMTP id D453D5598 for ; Fri, 25 Nov 2016 11:53:58 +0100 (CET) Received: from CY4PR03CA0008.namprd03.prod.outlook.com (10.168.162.18) by CY1PR0301MB0747.namprd03.prod.outlook.com (10.160.159.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8; Fri, 25 Nov 2016 10:53:57 +0000 Received: from BN1BFFO11FD046.protection.gbl (2a01:111:f400:7c10::1:159) by CY4PR03CA0008.outlook.office365.com (2603:10b6:903:33::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13 via Frontend Transport; Fri, 25 Nov 2016 10:53:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.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 BN1BFFO11FD046.mail.protection.outlook.com (10.58.145.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Fri, 25 Nov 2016 10:53:56 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1040; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAPArrU0016496; Fri, 25 Nov 2016 03:53:54 -0700 To: Ben Walker References: <1479929804-19614-1-git-send-email-benjamin.walker@intel.com> <1479931644-78960-1-git-send-email-benjamin.walker@intel.com> <1479931644-78960-6-git-send-email-benjamin.walker@intel.com> CC: , "david.marchand@6wind.com" , Ferruh Yigit From: Shreyansh Jain Message-ID: <8cb3476c-4605-89f1-99bb-2d1c40db1e5d@nxp.com> Date: Fri, 25 Nov 2016 16:26:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1479931644-78960-6-git-send-email-benjamin.walker@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131245448369271716; (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)(3190300001)(339900001)(336004)(377454003)(189002)(24454002)(199003)(39380400001)(2950100002)(23746002)(39410400001)(83506001)(4001350100001)(104016004)(65826007)(110136003)(85426001)(6916009)(81156014)(36756003)(230700001)(5660300001)(626004)(189998001)(86362001)(4326007)(6666003)(575784001)(97736004)(76176999)(47776003)(65956001)(7846002)(356003)(8936002)(106466001)(305945005)(39450400002)(31696002)(229853002)(33646002)(81166006)(31686004)(2906002)(54356999)(64126003)(50466002)(105606002)(68736007)(77096005)(38730400001)(92566002)(15395725005)(50986999)(8676002)(39400400001)(65806001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0747; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD046; 1:7xbB2BcFiLz1MsnPbVt4zfV0P1ivwaxbl6qbvnL/kT7yhGPXUvVvxadU7nkxZABM0tV6EJE/8xJnay/SRMmbZ62ns2vNQqQEcoN9OhhUd1BxFr5koTWXvBDpLXxo5Wfu8rZI/Yn5Yj9oh3HfeANIsIQhxih5FCZt0M3MNzKrM21SI9TaqUQSk310ZkPS8JvGHYTpfUmGgIoS9sMglaxqPunV0k6Isb0xPF86xxCWV6WDOvmAI0jZVudriShZF0oTY89CkiZc+o48SQDspop5jmlxfcV1vOnLZ8wQS9b9acz+hMhNn+/PUp27973rwTDMO38DL/ZTxJfmEfNwGPT44U7d62wygIkqmwGLYTcRYA1iOzfFd+SdfZObGuX8Ygv2y7gB67vi9lc0LkhrSQfsOZlgQHEJDsO/canaBZP/4qeVlYsH6St3oqr4u1xW/l2VTjE10Z/Fd9VAoPmiosAsleQPW6qBqgedOs3W6wuE+Nn/xcaSC+xhN3yfSRlciOkwL6bjvJsjVyFepLYRU5c4GEblq3thAoZ2HzXK1Ow9+5I7WqWMoAWtHBkmI08Y/OfZ35TRvUXGUYwoGaUNoNX0butyHtlbTrBwije70vnYu3kTrMrUeIVsyxHRcsFX5yNDP3d3+M40S6Z5Bj4tTcgCkruxcAydmLuP4I0HhZ/m+D4= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 2:HaiLhNgGZloEKYT8WghzMoLwdDFYuPHKc0BFuyf/tleTFWy2wYybt0E4wKTmFqSouRbEsWJ+6BOatUPd2uCg50jGKRTVAX3AyYUHr8Rkf+Fl/aciNngHNNFMd9/Q0U5qPaTkSc5bJEnI/y7P0Ov2fT7p2UWSxWcGWiGKA0lqVXA=; 3:Pi3qEwiRzpCncbhdlqiC13RJgCiWUX5JPPbcDjxJ0Q07qJCGJSr1sU4pCOx4Uv80F+G8gVnFq2J6nisZKanLZkuPqQIn1Y4uIV6JFb9oeO1NznGDQgXAdj6SLstBhGl5WOCrZrhk9iW1dvg3t30BHJq3PQd7gsgW3GT3dy8xIrGKi8WTgQarDp6wBmWQb7gX+OHhF92z0HG0jYnh5eKG8/ALPN3vK6aojlRBQNae+b5OcH6GOpnBkTHDfnRgVSGswkytzexQAwvyqklGHkBdKg== X-MS-Office365-Filtering-Correlation-Id: 7f3055ea-5ba8-45e4-f3a4-08d415215ae6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0747; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 25:mb1Nf438mG+AmBNPoF1JGRjUxcSB5xTtV7k/butkdDSo9NyAEyQ0R66VB8R3Yu3s0ueUcdqGsbHlMjj0NwWxHIUYU0ptRqmVfpSpvldrjaASaCeTeHDDfISrgKNvQJY5jMTgYJC8UtWil6Os463aAWI8h0yTpv5ZlPLjdzkJANPzsmuYAcUywy1KXL34WXRWN1jgPwm471C6NGnHlEawujHgM4WxC8VL7ZnzXuki1pgS7cfg99YoQjYlRKxtHm1vdWF/Bkcc5vXiCj5c41fLUBXjxmrfFyaXQ3yCimOR0KKO6j61Rccs1lOdYnWCHdrxI0beZwb2ORCtLvV6UJrjSZFBazeS628HsJqtQcx4eXle6ISbeSfFz0jxZTBHkzMbdojI9sLvLxB8Fkp97sqtKmrwLDlopFDoQJhlxl/2hqdYlmxOlZCfM46/YkEzd6lBAeCCfXdA2ISqpi6FxgE9Mnq7h0kOyfNXM0ZGDvuNcD84RhGr+JR68lfFhXhgcfLYbC3/LIBQrkkcdAnRFeeGd0rHZkTsTPv/vHWXZ+731YIsl9PXv9vYv8no5iKWeFjKtbmQupCUHm2oM8M0HRiFXoo47SI6pNfFkyJXCHQ479hKJ/S5hlqLZWR50MoEcAdgil2Wftk+kTMMIobexWO04MERGYZdgIAVNJB8IOethIZWdIufpOwn26EaOlJ1at3VpVuKO2Ed0AeWM3hLRzG22FCd8bjJwfnDgCddkf1EOUrCUNWQSJeRnFnkisrw3TC16kVCInnWmLve7PZ3LtSBsG/F75DzGyt0mI1nO9LOkzHkT4OdpZpfbXqXYGwNHyhr3OtZ3syTJIlHfMplS3eoFZDYijIyHIxDdwfXs4iPHEV9LatGui+4bpshakAS1/19 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 31:9WWKl+YCsI5S4t0t6gg7F+yYizkMVi5BhCHRBIkYZWgu06VumC7rP8NBkeZXQAdV9tJFq9pvh0ULcDiSFcJ6pt05bG/W9Uf0lzrxjA1NothT5nN32zQzdyfP8PhzTty+IcuqbMStaK4J7patxWXEYKV+DvfO26ZPLoMUN4kyXYVwBWkNTyVs9tETg8pn3q4QZmLu5Qt/iOCp5F/X5bN6vSE8nCfni2qMQW4W/fYvBgPaFXCN7+EO43FkZ5RR5TzPSmOytK5YLouftwy0jkxi5mPCIeInqo3xLuzYBOgA8VA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(8121501046)(13015025)(13017025)(13023025)(13024025)(5005006)(13018025)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123565025)(20161123559025)(20161123563025); SRVR:CY1PR0301MB0747; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0747; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 4:gTpOfV3F415kOl3w3rO0Xa2A6mDt7Mmb9QbKz594vVKjXuTkBdYwfN3d5Iie2Noz8lHy4gHxdHCX+V2SpoqT79S1JwjJf8PpaZbQNoH3JkLM7vi95wjYp7dqHB0DeRuUMv5p79XdKxj/87MeKqfwqyOu3wT+GAbAtsyQxAVDXg9eGiWKDRnjkLuIj6D8cQUfbpuDI/21TKEnpaIsNttKBM6FnYipQuE+B32RFGl/cvU9MX6hDqfeIZuOdPFcghrsjC39s4HFmvGwzuLgdUs2Wvz+Y+yvBLqi2lQeJU5Oh+TQQY26HO7OiYqmCMNf+8Hf0QvBWeTgNafCkaAhbPl03Qqr7I1jFGl/vAVRjTPd2mfCS16ZA0iykROV+SWv4clYStMg+j2q0gg6KYSVDquelHE1g3V4n83ws3AeaivLE2zeXC6QJ328K3qSQTmTJqxJejCr+3WZzOBqlM1gpONBEwjK6MODLUmzARhQCeiZ1qCDwL+2A1rt21iAVtDtWPd6QOiIl1sPO0RJBWtwlUNDPbEJbiKl1Rucbng2w77JfdigdHqsDvK8NXLkPf2mJqdXhr7d7ByZ5g3pMMmtoWKNqEw35rL2Pw8eFyrdeKTvSnrsJXhQKscmB1Yt6W27YaQzDiO88g+o4btluduabfA7NHorjhq5Ee4qDNxEej/YBuVI2M2WHVpWIwZ1XqJedpIek9qvO07MWtxXKgK+LR4/Z8pU3HC3EcYrmu8dnJqh8nssr3mZVKQ46xBpssOwvW/e X-Forefront-PRVS: 01371B902F X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR0301MB0747; 23:oYPn4BHNKFUkcgFkCo8BzDGfBzslEl0I4b/?= =?Windows-1252?Q?qPBQInviSH4bojAyPw6qz58UncTK64pmjbiiyXcdcgXn0vQhjFoOJjDz?= =?Windows-1252?Q?JrMA4yMHAPzzRjSSJH0/FyHCpEEKnJVYT/yJIJrX0EzL0Xg2hCZyOyW7?= =?Windows-1252?Q?G4QgWJ15lvKuXJ6HgF3zla3h4TpkskevzFqLj6Vr3QaGbwmIB57GfkEd?= =?Windows-1252?Q?RtHZyJGQyvoVwSBxhM/mK9eh7HTmbS1k22ngX48RLG/2VI94OCZYhlfk?= =?Windows-1252?Q?wZnwDC1VZCadNm6FWWm9zLCUeB9tSPGC/UFc1h55FZIewn4kz2JGG3TF?= =?Windows-1252?Q?/P9lq4g99sbM8RmFd1AeD3UCF34s2/SG7UUCOVMucLGEZvPnBBWEVxuj?= =?Windows-1252?Q?9fiMyBsdFgofo8Kld/8c6i42oY8n92XdSNgaGb0hcjerwmwzqyxNRc0X?= =?Windows-1252?Q?c+CVuwMX0aDA6dIHRQWhHvYpdxSa8lwZE0H/bQ8xtPaIgSYUa0CmFHYH?= =?Windows-1252?Q?vdsIUbEe9TIzvNo3PuBABF8i7nFJqUuh+CRNLlNxC5gosG5LTbEZTN7/?= =?Windows-1252?Q?IzkIWGQWEb7/ZSEZA5LK3rpL6Bj6ytEeB2GkUfdOL9iurb01u/58NIO6?= =?Windows-1252?Q?T8i9Hdpawmsn1WyBumxboLxzhMfY08eYmJhk4hnaH+bk50ijWVAf2I+d?= =?Windows-1252?Q?/DR+YS6M3A6w3jv4K26UgciGkQVprsjAxmajFbjOKPD9oRxc9e06ru3G?= =?Windows-1252?Q?cRtccWKfbPMzqRSBAfPOpVH457bp6h/cXLNyMcIxSX9H1GymbxHFgYfd?= =?Windows-1252?Q?LzVKd9e/HKeTfeZ11dvSNsTVugq6QqgnAprw2kf3q//exZPFCPb2yOrf?= =?Windows-1252?Q?EnBeimyffSLcqm65r2rO3/cufWXIUT/Icwipm24QsPELqTJl+G4Ttt3r?= =?Windows-1252?Q?2INMkcr/Dyq4UmnLUDZiFdGgI7brfeFVlqmPYC/q+rp2TxQXw01MOeBo?= =?Windows-1252?Q?NF06F997fIxoh9yFQ+d+VHb8ARi3P1jWlG/zmUKMLJl9TnQx0mMwIFc1?= =?Windows-1252?Q?k4B1M4SO+WL9S+IwsfDeBQOg3b8HosMlAdBEz819vZravnnFQ0/SCMET?= =?Windows-1252?Q?4GFpoApu73fF18Pa3InOIrctgzzVPYA+W2Iz/KaxCtadcxYAVFWtJaRc?= =?Windows-1252?Q?9yEIGMgmBnYyzUjZeGzutJ1OHLfu9JxBKvy5fd70XdxzOEGga7L/rF1k?= =?Windows-1252?Q?tkOdBCmUjgbFkMS5gUSyZo9amjvuTy0svq9SUgY9BVn1MReqmgRckT7l?= =?Windows-1252?Q?Tg0nF4AZWGeIZqpxSVSNOUOLQ3OsmZEUh0OGttmKd7kLpRSdMfcppSAd?= =?Windows-1252?Q?PfjyxvKJZTkmeoUQKU7M2pRhlpYsiw/6RopP6hiufWydn6j2bV82IVAj?= =?Windows-1252?Q?fhvOtl0YdsXXVO0klguYol4NvM3tOhnrsx8bIjh3OEGotWoGHVOtsvIX?= =?Windows-1252?Q?CQbhWspdGoN/VjHqtEvWIqHfwfvm0glpsTclhYaWgvilfTioXsI4Ng9n?= =?Windows-1252?Q?AtwYBEnHeYacQGjqTtPGoOWY0m8vRY7SUcwsG5wh+vmIXZv7p81d95tO?= =?Windows-1252?Q?DIw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 6:xG/AutlfUTU145NM2h8Qp5ddkF7ya1YzZjXeo5xcbpSoSfmvDDukM40lpCcvIaKDJoqL48Zy29gtaRCeLWvFnR1eiaVrU3+krom02Qyu8j+UGXHVEetq2uZnAGg3w58cPeUwjfT1RYppJ9Ghw3a46i0d+ngY/F0cfJP9N1maDKuHHbpIGLARzm43T/ZX3pZUkxx6Fy/XjP6/laUKNYv6mMQXAROP+Ndaa6R0OZUF5BU902d5tIdDq2fmsKDOeXwH5KJ79oEZ4KmynCWbbUrgNJUsa3BuvpkCQk+V7vOwcC81+CD4Q2Ba7dNnX15epYaz+ap0mr+OSAh5fdedpzFAVw==; 5:0A4ulH7UtGXsYU+RI9G1xo4kjcqbk/m6Im40MDyXQFnu2Iycr7b57rITQSCvyX5/JzrksTLkFEtpqPr8iyQAHXu8Ap+YFEnD4SnCD5GLodxySwKRUQhBocrqvWRRLdcgsdLIdaixk2h5BlBbvGU4Cd63MtBd6Gk/ZQ182tD+K+ggq4dHP9xAdX1i8glBD5DN; 24:vYW6r3zLq7h8rEtAvsxR9kfuuji1tolumbR/3YShtDAy1sw9EDHhPapDVlZNs3YV9l6dPCrZJMIzmqM3bS9mEunAGxlN61hEfb2vXNQrOYE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0747; 7:1nXfiTUg2TIlB1ZS/SoUfy2xhzGnakhFdJQscZI0vLkhZ4FKRDhmJqEI3mBDgbrHeeiSz4GPfj8I6cU4bUNjguV+IGFblu30Sy/A/gyDZMqZkSM0Lp339odF7IcUZvEpKHOx9yeYeo1Y8vRBTqHdRvxv/Em6UXieAJ7+gYwc5MZ3C7ZyIX+6/g2LkjimAlgnrg+QXU0sZGBvd8rChS2XsuWbngD87dPvVvry0s2laFdxERyfzzRY72SLm04JBipTUnY/A0r7IXN+dyedrffFFrSL53Yq7nkJBkX5fm7quB/XO0Ws68M7zeng1h3a8zaeA8SbYUS/kQ4qiVmm/SrHFny9aHCWZO68stBodij8Ok0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2016 10:53:56.6463 (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: CY1PR0301MB0747 Subject: Re: [dpdk-dev] [PATCH v2 6/7] pci: Combine rte_eal_pci_scan and rte_eal_pci_probe 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, 25 Nov 2016 10:53:59 -0000 On Thursday 24 November 2016 01:37 AM, Ben Walker wrote: > Two functions is both confusing and unnecessary. Previously, > rte_eal_pci_scan populated an internal list of devices by > scanning sysfs. Then, rte_eal_pci_probe would match registered > drivers to that internal list. These are not really useful > operations to perform separately, though, so > simplify the api down to just rte_eal_pci_probe which can > be called repeatedly through the lifetime of the application > to scan for new or removed PCI devices and load or unload > drivers as required. Agree with this. And similar case exists for rte_eal_dev_init() for which there is another patch floated by Jerin [1]. Also, I am already merging these two (EAL Bus model) [2]. So, we have: - Only a probe called from EAL for all devices, whether PCI, VDEV or another other type - Probe in turns performs all scans and driver->probes() Concern I have is that with the change of placement for device scan, would it impact the external modules/PMDs as currently the scanned list is created *before* eal_plugins_init(). But, now the list is created *after* plugin initialization. There are other similar inits like creation of slave threads. As well as concern raised by Ferruh about device enumeration. I don't have clear idea of all such dependencies. Maybe David and Ferruh in CC might be able to comment better. [1] http://dpdk.org/ml/archives/dev/2016-November/050415.html [2] http://dpdk.org/ml/archives/dev/2016-November/050301.html > > Signed-off-by: Ben Walker > --- > app/test/test_pci.c | 2 +- > lib/librte_eal/bsdapp/eal/eal.c | 3 --- > lib/librte_eal/bsdapp/eal/eal_pci.c | 17 +---------------- > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 - > lib/librte_eal/common/eal_common_pci.c | 6 ++++++ > lib/librte_eal/common/eal_private.h | 14 +++++--------- > lib/librte_eal/common/include/rte_pci.h | 17 +++++------------ > lib/librte_eal/linuxapp/eal/eal.c | 3 --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 18 +----------------- > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 - > 10 files changed, 19 insertions(+), 63 deletions(-) > > diff --git a/app/test/test_pci.c b/app/test/test_pci.c > index cda186d..fdd84f7 100644 > --- a/app/test/test_pci.c > +++ b/app/test/test_pci.c > @@ -180,7 +180,7 @@ test_pci_setup(void) > TAILQ_INSERT_TAIL(&real_pci_device_list, dev, next); > } > > - ret = rte_eal_pci_scan(); > + ret = rte_eal_pci_probe(); > TEST_ASSERT_SUCCESS(ret, "failed to scan PCI bus"); > rte_eal_pci_dump(stdout); > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c > index 35e3117..fd44528 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -561,9 +561,6 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_timer_init() < 0) > rte_panic("Cannot init HPET or TSC timers\n"); > > - if (rte_eal_pci_init() < 0) > - rte_panic("Cannot init PCI\n"); > - > eal_check_mem_on_local_socket(); > > if (eal_plugins_init() < 0) > diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c > index 8b3ed88..6c3a169 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_pci.c > +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c > @@ -361,7 +361,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) > * list. Call pci_scan_one() for each pci entry found. > */ > int > -rte_eal_pci_scan(void) > +pci_scan(void) > { > int fd; > unsigned dev_count = 0; > @@ -667,18 +667,3 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) > > return ret; > } > - > -/* Init the PCI EAL subsystem */ > -int > -rte_eal_pci_init(void) > -{ > - /* for debug purposes, PCI can be disabled */ > - if (internal_config.no_pci) > - return 0; > - > - if (rte_eal_pci_scan() < 0) { > - RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__); > - return -1; > - } > - return 0; > -} > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index 2f81f7c..67c469c 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -44,7 +44,6 @@ DPDK_2.0 { > rte_eal_pci_probe; > rte_eal_pci_probe_one; > rte_eal_pci_register; > - rte_eal_pci_scan; > rte_eal_pci_unregister; > rte_eal_process_type; > rte_eal_remote_launch; > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 4f8c3a0..d50a534 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -81,6 +81,7 @@ > #include > > #include "eal_private.h" > +#include "eal_internal_cfg.h" > > struct pci_driver_list pci_driver_list = > TAILQ_HEAD_INITIALIZER(pci_driver_list); > @@ -423,6 +424,11 @@ rte_eal_pci_probe(void) > int probe_all = 0; > int ret = 0; > > + if (internal_config.no_pci) > + return 0; > + > + pci_scan(); > + So, no check for error reported by scan? I think we should, 1) because pci_scan() returns one, and 2) because in case scan failed, there is no reason probe would do anything worthwhile. > if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) == 0) > probe_all = 1; > > diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h > index 9e7d8f6..54f18ea 100644 > --- a/lib/librte_eal/common/eal_private.h > +++ b/lib/librte_eal/common/eal_private.h > @@ -108,18 +108,14 @@ int rte_eal_timer_init(void); > */ > int rte_eal_log_init(const char *id, int facility); > > -/** > - * Init the PCI infrastructure > +struct rte_pci_driver; > +struct rte_pci_device; > + > +/* Scan the PCI bus for devices > * > * This function is private to EAL. > - * > - * @return > - * 0 on success, negative on error > */ > -int rte_eal_pci_init(void); > - > -struct rte_pci_driver; > -struct rte_pci_device; > +int pci_scan(void); > > /** > * Update a pci device object by asking the kernel for the latest information. > diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h > index 5d0feac..2154a54 100644 > --- a/lib/librte_eal/common/include/rte_pci.h > +++ b/lib/librte_eal/common/include/rte_pci.h > @@ -386,20 +386,13 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) > void rte_eal_pci_unregister(struct rte_pci_driver *driver); > > /** > - * Scan the content of the PCI bus, and the devices in the devices > - * list > - * > - * @return > - * 0 on success, negative on error > - */ > -int rte_eal_pci_scan(void); > - > -/** > - * Probe the PCI bus for registered drivers. > + * Scan the PCI bus for devices and match them to their driver. > * > * Scan the content of the PCI bus, and call the probe() function for > - * all registered drivers that have a matching entry in its id_table > - * for discovered devices. > + * all registered drivers that have a matching entry in their id_table. > + * If a device already has a driver loaded, probe will not be called. > + * If a previously discovered device is no longer present on the system, > + * the associated driver's remove() callback will be called. > * > * @return > * - 0 on success. > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index 2075282..f47f361 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -802,9 +802,6 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_log_init(logid, internal_config.syslog_facility) < 0) > rte_panic("Cannot init logs\n"); > > - if (rte_eal_pci_init() < 0) > - rte_panic("Cannot init PCI\n"); > - > #ifdef VFIO_PRESENT > if (rte_eal_vfio_setup() < 0) > rte_panic("Cannot init VFIO\n"); > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 936f076..5146385 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -479,7 +479,7 @@ parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr) > * list > */ > int > -rte_eal_pci_scan(void) > +pci_scan(void) > { > struct dirent *e; > DIR *dir; > @@ -810,19 +810,3 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) > > return ret; > } > - > -/* Init the PCI EAL subsystem */ > -int > -rte_eal_pci_init(void) > -{ > - /* for debug purposes, PCI can be disabled */ > - if (internal_config.no_pci) > - return 0; > - > - if (rte_eal_pci_scan() < 0) { > - RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__); > - return -1; > - } > - > - return 0; > -} > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > index 83721ba..856728e 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -44,7 +44,6 @@ DPDK_2.0 { > rte_eal_pci_probe; > rte_eal_pci_probe_one; > rte_eal_pci_register; > - rte_eal_pci_scan; > rte_eal_pci_unregister; > rte_eal_process_type; > rte_eal_remote_launch; > -- - Shreyansh