From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by dpdk.org (Postfix) with ESMTP id A44F11E29 for ; Wed, 2 Nov 2016 10:29:40 +0100 (CET) Received: from DM5PR03CA0001.namprd03.prod.outlook.com (10.175.104.11) by CY1PR03MB2379.namprd03.prod.outlook.com (10.166.207.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Wed, 2 Nov 2016 09:29:37 +0000 Received: from BL2FFO11FD047.protection.gbl (2a01:111:f400:7c09::108) by DM5PR03CA0001.outlook.office365.com (2603:10b6:3:118::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Wed, 2 Nov 2016 09:29:37 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.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 BL2FFO11FD047.mail.protection.outlook.com (10.173.161.209) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.693.6 via Frontend Transport; Wed, 2 Nov 2016 09:29:36 +0000 Received: from [127.0.0.1] ([10.214.249.5]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uA29TTND001949; Wed, 2 Nov 2016 02:29:33 -0700 To: Ben Walker References: <1477432240-20406-1-git-send-email-benjamin.walker@intel.com> From: Shreyansh Jain Message-ID: <07a79e86-fadc-a702-28be-883f0b736964@nxp.com> Date: Wed, 2 Nov 2016 14:59:27 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1477432240-20406-1-git-send-email-benjamin.walker@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131225525771250349; (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)(3190300001)(24454002)(377454003)(189002)(199003)(110136003)(19580405001)(4326007)(65956001)(65806001)(85426001)(64126003)(11100500001)(2906002)(97736004)(33646002)(8936002)(87936001)(77096005)(8676002)(120886001)(31696002)(81156014)(68736007)(19580395003)(81166006)(86362001)(104016004)(83506001)(230700001)(47776003)(50466002)(69596002)(92566002)(7126002)(5660300001)(105606002)(7246003)(65826007)(6666003)(5890100001)(586003)(626004)(54356999)(76176999)(356003)(6916009)(2950100002)(106466001)(4001350100001)(23746002)(36756003)(189998001)(50986999)(7846002)(31686004)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2379; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD047; 1:qclBU1115nrLHeu0lgYg4LFYfblkVuFlF+ZLOvsics/CKcwo8yTY+paZpFPeOLxtmvtIVQxj7WzvtyJqEiRjWr7YXlWdBBkmFB2Par2LLnSFNHdaDZCYPcs9bFbWK0SoCrFTvrtyyez6TU6vR7UmKpFX/JJ+CWCfunUQt1pS+c1CdFVuwyFUGIzYPxCcV10WS0uwgMsVACnz/qUCSL0Ov9+6nmML6ZwSQuQZmvwuqamUvYfwolRzTNBpKT4CAyO9mamF9PcmTV7WAk/cDNrYcDG83bW7OTfn6kz3rcfSlAz3RpF3f+sNSjgattb4z1LujBKRJQL5bkdJ8io3ADdrazgylRWn04LZ0qlpujtvUezBP5x5wywzDK/qOr5yhLB/VJ7VrcAc+FmEwC6X0cXeGZgjtTYTjaBLJpjzFtrlldUEGGEB3Wc3zxUOZC/LDPQl1FGmMWhuzSlFPGPanHa+USrIUgXgRlMwduCMgzMFMTAwMz9LD+tWtnyArCJBkCQeF61V/PuznGwFKZjiwBE5mwDlYgb4e+CKUFKLnK9yEaffxpj3PyJLto+pGDFnSrLzQzUSejDLLYM/PsqgxL5lLLlFOzTRRaEV7M56XVKZu6YLQqg58ooZIX9VLtaDc5c73f/kzzVRVUgRcPVF2pXQRe9Zv6W1XyLQoEty2UdKxGE= X-MS-Office365-Filtering-Correlation-Id: 56a7c52d-ee55-4a60-c94f-08d40302c383 X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2379; 2:YMMs24lmTIQY01sGAzOG9FzAI5HwIAXH+ywj3EOHcA4Nk3cHK9gOsX1iQxjkDLopXYlWGwE0zzI9q2yuwBbFKVo3rmR5CWM/UFPTmfs/lM7FMIxqTVezSMyHbapMgSaYMrHM3QzZVUZy8jQjgpevpi5j2fAVbkNO/axQlp8s7kzz8yp6AJeeAcdIKSv+a5K1T5D3TbGHxkWidW1cid9Dig==; 3:v2wlWCGC4XV4DP+DTcQVh3nkqMp8QG76R9h1M1cOcUFsUSh53DhZy+XViqI4bTj0BpFhY+oeALJjRYLlUIfY3BLjOVpILE3WSgs4IgrN1O/KUh4w3bcIfbbvvOkqAu4JrTzPAT0fS5+Xkm0h1xr8M3cs4RUgfj+H3X0cLCRNNlCG6WGyhjAG4qWwH4XDQ5Js4ZCz5LM/O1Qs0fMYzd5jKjdrFS4xbBfZ2C/UPV2j3p9QpBsrolrqyQdN62pUDhvF X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB2379; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2379; 25:aI4xupYR+vTcso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w/Hhlyvk0F5ByKrRA0fFZx/DYTlPHhWf15omO6K8X/10TgOlc/ocY+QVX8669AwdQ==; 4:xNv64DG4iIgkaNJTKU7uM01YGJBwhHcMO3EDcB72l2GyQZ8/eJfzVvyRp6I9dWxYXHB4H+K/LWP/lojm3PBhZSN5utnTdnGlYAGhMp0MvNHVZV7AqRLHk5nMkRRSplaCjAw5VRlMNhroR7whXj48cp7dsf9WAmvrJaDnE+gWW4y6bei7WPDdvi+veFwaENc4eMH3j2j4wHQMtxmb4jHpTO3fICggGIK2wGOXJM0Cd5hDT72Yrt/NugzgusiIzWRarRHTY1IjZygt8Aen1qUXXKEVSuzaabLmmTGlldTHw2gPNqUVkATeWVg0w9P2p9kW0lGmUIfVAJlMY6SJDJj15rmvUm2nwNSihPUNF6PHoCwzXPyVhC35zaSGUJiVJVKOU2PqOdQ7gzaAaUUmcLO6FJZiUcSrRmVCs6XNVaMdzr8mraqvV4RTXI4f6O172Ls415P0zDGyDARunegrsnhKCzIPR8grrrGfbfRGtCBy+TFc9Azw2VuSyf1kSEf2nissMMqBvtkTHILujFe0yAEUysm5rzEm1nmnye0PmBjAyT2QGJ5V7BvRRv3Kbwqq6ILI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(13024025)(13017025)(13018025)(8121501046)(13023025)(13015025)(10201501046)(3002001)(6055026); SRVR:CY1PR03MB2379; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR03MB2379; X-Forefront-PRVS: 0114FF88F6 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR03MB2379; 23:qTrPfSup3+bYVVslpatD8HSj5ij1tZY2jv5Vm?= =?Windows-1252?Q?DqDF9wxSDZq0qMB1sMjNsdQr0+ILYrpdKhNghAZMd+VmxjsvmtU69P1J?= =?Windows-1252?Q?oz1h/tvtBGvH3bdEPsovLKesmBMwgkqmgBuuxjORqMfH4T3H9LDYI1Tm?= =?Windows-1252?Q?EpTQhNNuefjhIz0UO+HaSRqQ1OtTUr7W4ziV9EMigT2WTxtiKHnFXNj5?= =?Windows-1252?Q?xHTdP7r83pXnVJdlBUwf7YW/S3AAVR3rQHx85Lu9u7Jnke5AQP+1Q2YA?= =?Windows-1252?Q?bV4yKfeIqAlCvB9vEult58SG47gNzrys3DD0NABHuSR90MNMhImsShQi?= =?Windows-1252?Q?+7qYiSjRmq/I2WMkLGu63ygaWZTNeeQLFchyNt5mIb1wzo8kqBHsqXGf?= =?Windows-1252?Q?uJAaKyqf8nFw3OIcXw2CnJWE8745oASgIa0vi7pC8UpgrrDykEoYcoBM?= =?Windows-1252?Q?n8CD1BKE9hkQC/8Ev/HKYnUfbUD9b2RUlLORFOPEYdeIxAr93dJITEhJ?= =?Windows-1252?Q?03K8kRSA41efLFlEwecwZYObswqXQphi513CNN8sYFJbQhp+GLLgbN9R?= =?Windows-1252?Q?FWuURASe2oCbxY/Ry5gm9CmoBlxLSvQxu4VoffdG0VOIPRx2fM1oELPs?= =?Windows-1252?Q?r5U/OdB9jHOgSXvxGkbzInMqpIFYTwMjEyIzU+VLBWNAdTFXzgdyXXmL?= =?Windows-1252?Q?B/4AOGkQtMa/jPgaueUG7tN2PTutj35sfuYRE6HnMHe/hXFl7R0SGc12?= =?Windows-1252?Q?V5opOCTt4f5sdUT55p9+sQm15563urmQrQDViqhA8dYMrajQfnT7dwoS?= =?Windows-1252?Q?6xRSte2F7XQ8aCnUYmgJFcp0DNPDFuTjGDEDe46szMlhjEN5DnQMPcbn?= =?Windows-1252?Q?5+sCsQdL87IGmNuOP7zcIBktIyC2CWtg7WVFO1ziu+Um43pkkb2pfDve?= =?Windows-1252?Q?3o+pdQ2JjZzm+3MDiRVes1/m1C3LyE4O/Bnbtt0rJT/T9j7BpzAW+OP4?= =?Windows-1252?Q?KgQtRxuHdnT3CxnKADripGpIaWKnoFNON+Mn4eIJNe/iF6HQDrxp9w4u?= =?Windows-1252?Q?sVoVoJAmPNcdyv0L7yGJtIkOuYm+pFhgdssxbA8nHiHKSo5qL3g9Nzfx?= =?Windows-1252?Q?aEwwOehgufm1S0n9nRJgR6uF2Ws3v5NRDEkUUpXsz16GeDVUottJygyF?= =?Windows-1252?Q?DV/eZ8Kwy3+3XME8cvNn63QSdw96Ub8JX2Feix6AMZ6MUSmCMAxYnK6R?= =?Windows-1252?Q?rOv0YktJf7y0FOhB0aQigl7Ah/L+l21a7gbHEy29ZanMK5xgeh68JXtn?= =?Windows-1252?Q?EEGq50PJNCGQEx260cXxnyclgjRxyUEnzx8b0krbyZ+dn+EJw/Z66BXA?= =?Windows-1252?Q?um8Ram0Yz3P0/nkm6qTheQzvyfhMGxQR9Dcbn7doYg3iSqwhV6zhyQcT?= =?Windows-1252?Q?UelqbGxPlTLgRgLSh9POXPpOmmPdehulf5ts65Ze4CGCuw+daywlc3Fc?= =?Windows-1252?Q?m2oBIuaIRYz5ICsmgrwcSg/W/XHKtcA+/fQqBoQT5X/m3BLTBrRnyOVr?= =?Windows-1252?Q?UKtPqGkRpYBvZ5NHaMe9Zp0ynBCnipFwT7kT09JoFN2XUo1t2X5f2B1y?= =?Windows-1252?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2379; 6:/NKAJ2nrtTcMAfvaav3rc82JXOuWi0gLUB2fmfdhvjXAyrOsMgz1jD5F68FwKigyZt+njWKCoomjQz5H/rR6QlMB+JoBjdSlVTlBNgrG3ps3+Qw2d77T+4eT+jusICv+vIL1SBz48olSuidZNL9MgKXu1lmbYlw0xbOfOy3nhBlLsrGM4EylHl6IB07ym+wLjToNlEApflf23OPlpW+/Eo6dvnlg53Di+qfCchpKmsCC7s6AAVPhpPQtVhkpS/ugF+fucsOvVZTxRBe3Ads6u5aGUFywpsmS5x+sEj0Sm4R2h4bh4co6Bl6Z7ffEq28H; 5:ZSpg7WnoL4F2L5LJm9/pHNK+nP8cmlUm/kEg+se1zgC/IIdZnSTSWbpEYgwv71YGoDnCV1UrSimv2YT2HC9td0rFXP+0+Keq17ksT5grjMB5JZ+gFeq+qF19oXatdUsBVNu6u4BNKVJoNm4jO62vLzGnEeK6g02eF9y8sulOG4trYLzabQgdGEAIvwAgdm/D; 24:KFYH7+gWEiYqUTJJspxsRWTM9yMOUKZaxPCBVJEBhbciGdq2AaQLaYrASQV4ZtMemidfL8/oyrQTNWeRZSc0NNxKGfmY/MUDA8Cz0Oi+RY8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2379; 7:hEvc4e3awJznKD3u6ZwoS0uaT3ifZGfrfpR/HHajA/SfKeT9fu8RpeDG+PmWQX3cnq7Ia+pucO+gbJo1SAT/TZF/JLrvs6kYNhVChIJzwAuvjQJkzbjCFi9Yg9BpmN//rxCE2kiVHUMgvcJsbqtDCbCQPOmsLHM3iF9yy9LkjSphVI7pqbllCU2i2iB6R0/1Esim5IUAAbDkb7iO3TDP3luwU70JGhlV05jwd9mJHFzn73DY2HLlAc7hW1QQlvCpuqfoJUhQ2UUPI1aLdCC1visPFOGr9uzoR/fjTdm6V1Ppz09x3R516+jj45M0K0PHJG0EToYa5XQWdFHkHJSU/WMCFnJAiwwj0pf43hJkBDM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2016 09:29:36.8910 (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: CY1PR03MB2379 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] pci: Don't call probe callback if driver already loaded. 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, 02 Nov 2016 09:29:41 -0000 On 10/26/2016 3:20 AM, Ben Walker wrote: > If the user asks to probe multiple times, the probe > callback should only be called on devices that don't have > a driver already loaded. > > This is useful if a driver is registered after the > execution of a program has started and the list of devices > needs to be re-scanned. > > Signed-off-by: Ben Walker > --- > lib/librte_eal/common/eal_common_pci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 638cd86..971ad20 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -289,6 +289,10 @@ pci_probe_all_drivers(struct rte_pci_device *dev) > if (dev == NULL) > return -1; > > + /* Check if a driver is already loaded */ > + if (dev->driver != NULL) > + return 0; > + In case if it is required to change the driver assigned to a device, would it mean application relies on detach(dev)->new-driver-plugged-in->attach(dev) sequence? To me, the above change sounds fine. Though, I am not aware if there is even a use case for changing driver assigned to a device. detach()->attach() should be able to work in those cases, I think. > TAILQ_FOREACH(dr, &pci_driver_list, next) { > rc = rte_eal_pci_probe_one_driver(dr, dev); > if (rc < 0) > - Shreyansh