From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0058.outbound.protection.outlook.com [104.47.40.58]) by dpdk.org (Postfix) with ESMTP id E3C3FF72 for ; Fri, 25 Nov 2016 10:18:46 +0100 (CET) Received: from BN6PR03CA0051.namprd03.prod.outlook.com (10.173.137.13) by CY4PR03MB2472.namprd03.prod.outlook.com (10.168.165.8) 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 09:18:44 +0000 Received: from BN1AFFO11FD010.protection.gbl (2a01:111:f400:7c10::198) by BN6PR03CA0051.outlook.office365.com (2603:10b6:404:4c::13) 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 09:18:44 +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 BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) 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 09:18:44 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:879; 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 uAP9IfF5025811; Fri, 25 Nov 2016 02:18:42 -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> CC: From: Shreyansh Jain Message-ID: Date: Fri, 25 Nov 2016 14:51:35 +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-1-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: 131245391243636554; (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)(336004)(3190300001)(339900001)(24454002)(377454003)(199003)(189002)(76176999)(105606002)(54356999)(39400400001)(97736004)(50986999)(230700001)(83506001)(8936002)(8676002)(81166006)(47776003)(23746002)(81156014)(626004)(31686004)(189998001)(106466001)(64126003)(50466002)(68736007)(5660300001)(39380400001)(65806001)(33646002)(104016004)(39410400001)(65826007)(92566002)(85426001)(229853002)(2906002)(110136003)(36756003)(77096005)(305945005)(38730400001)(6916009)(4001350100001)(2950100002)(6666003)(86362001)(31696002)(65956001)(7846002)(356003)(4326007)(39450400002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2472; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010; 1:C+91VF2zPLOqkYnZChI1FeeLou1P8kYfS02xQhIkDkRAZU0qyASseGZ31GGh27fAzfMuRAmbNyXneQuYg54UBAiO/HY+wCsbPzxTA+dAWnc5juPrlCnq4ZWRTqjueXn5j9A8NwqNi9VC1relfLaORjDbivTqVetkfbDEV9L+xUB2WcTSGA6vWOzZsnJ44UGrUKTVF+SXKIRLMbQ9LvfKzBgOSnRoTNb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bdr9RCQU9ManaAuVn/feV0r3VaEOdte7np6sTyv5pqdAmqs1sopX9qHTD+Hl2QODxK3+Xdajl5oe4r5xuFwEwsOFSmH7w+aBXG8/yErKaoT/j9ViP3+MLmRboxfccVUIGfR0faohKIUwvZJDKERG4GSPNHJVeQCsV40nivYy45B1mYn5WBo4Od3lR9qNJD/r8TUEt2lRbEyaj+EPIcAWUIlDe5siLhUxFwKNFhf+1X6KyJB+PAGIJRGYGoHVMpXKi6z84k5cL/okYkKF/c0dRlUnQDxX+iir/hlDhHUx72p1cUZI404OxIZxnQvwZCWrdp1/y5i8VcWW5tF1ir2fH4qrszAkLn0PUrQ== X-MS-Office365-Filtering-Correlation-Id: f9aadbb0-76cf-4f7d-e442-08d415140ddf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 31:c3Zhu+KCzozc8cmi6YNslxaYGzkRIfZgRYT/HBU19C3Q6lsLK3zrrU1WMWvHkJqqQ4AbTW2Tbz+NS0foiZfmzYk4LWVAOyhF80anG2vQRPTPP2B6akONo+5j8DVduFR7zvyBg29zTdiSJKlW3YFeFS72bsu5RREabclw/0of7pFah/QLaHQJVqZHUHXw7UByGTa1m7e+w7wzbjXp6KHJpmmkQfdIspNRp9MZJluXrc0FgQemV6S5N3psvRVNA4w5fVWQb66B+c075a7PPIQV+A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13018025)(13024025)(13023025)(13015025)(5005006)(8121501046)(13017025)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123565025)(20161123559025)(20161123563025); SRVR:CY4PR03MB2472; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2472; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 4:cqEJmXR/fQ3OLkXFuzBoIbL1+3I4hPPAJ+OSWYZKijroUAPbxeC148y4noDgeJ6cd7lg9flxIumyuQvbJA50Spag3VxjRLF8cfPc6u1//X4FQov+/lz9GYADuc33tWtrPx/HfLXBVL5l2uhtTuCSZzz7b/zCA+wn4R7IrX4GuYg5qoQ8p7q8jqAm3Gd2EhPoPk1nZChFoEmEeSl9Ctu9Dsb+roHNVxsUx4MVy0lqGt7EYT5FuyrYSPgfsWopc+mdADRm7bJ6N1IVsZNkEVJqMXjjE5CppUgpEwhOzvLYeq8iHPftPHGfbcOIcuLLdz0mEf682qJpOJeXsl1IpVY+ZHqutwNgiHiB/nj9ivR2YePsjfxwVOqC0g2lD9Kk0aDvjBEc72aqCQP/yusH9Te3Tf2XiME3qxBaTWKKX0Sst01FnW5dJP9Zn/OwjUCsspB5HlCV4qezZUcFzfxY/u8KM3ecq9EuewMENgkL/e8CasoW4+qFVsEwOsIz2kGFg9udOCH1sR58EY0CjmUCtjfXw5PArvH86hlHJpbLNhh8gikJQ1Hb80X2UiBZJ32xSAzH4ixnSg8KRGcRJWiwh89B6jYmDL03C50kIbAbtjjv7qWHJWxLDrlydDg7wT60k2sNirIi12N/hLwF/EgytGVxjjxQSl74deWux97jfWXCCjDe/IHK/TbhWx4qX+KC3KZ08+04OA2/gmyY0GJxTTss7wrP0URs14aAPtwXqEIDdVEulUSnV+AYjjrjSt3BrDS+p99kTHO8oVyDid+mQhwEtg== X-Forefront-PRVS: 01371B902F X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB2472; 23:Yos5x2pC7qCV7FfCucvaha578B/2wwzS9+/UK?= =?Windows-1252?Q?gLDKJLJvym5s4nwLBVdnRul2UOp+nldAoPPniVCaPk0n5rb+pvkU85kt?= =?Windows-1252?Q?z4t0dq28+0uKhumiFsW8hJW+320G0FCHoXfHoPwE+h1wH46XBDKJzGvW?= =?Windows-1252?Q?Ue8z61uWr6odMB6Imr65qc6SMrMveJIqibKMOgPHVF7GwH0FacwdghMC?= =?Windows-1252?Q?iurdV0krpf9n+wK1MAMeo1VhbAasQYPToys230WqAwWbdQzLv0/E15qc?= =?Windows-1252?Q?HEknPXPMzfPn3mSye33U0330Y5cTbDbpL9ipUAtfLTZSTB8WWByde86e?= =?Windows-1252?Q?6WbvzITEw6CUAuV2D2JqnO/ekOrYMf6KSNjnpFHmk2ONuVJ3ItHxlPZx?= =?Windows-1252?Q?Z6B60+TODohB39ro9STZW35MA1PVkihMZk0SKVyUMNjdng7+hEIAEZEQ?= =?Windows-1252?Q?3jyzkJ3Q75uV/wMzohcFI1zodTNtL41mw7FiX221oP7XFUXRc+G8LS0+?= =?Windows-1252?Q?2SQM8aho5bhrHbJBZPrrWDWg6FN/zvmjvrZpq6/Jj9jBypnOJ/E5OOkF?= =?Windows-1252?Q?dxIawZd20YWwZ7u1RxDdx4VCdg3kWtRitTiAQkP/ougR0Mzn++UxczQF?= =?Windows-1252?Q?euQL/pFh5TYpZVJmrFEAVu+mM94SwG+eglV+ZQlZacVOA1zVt4qwzswe?= =?Windows-1252?Q?i1iJQOt85+SdLWlywhzd8FEq+/zdWIF/SGDj1Tk98oCCR5Vt/DGyva4y?= =?Windows-1252?Q?gebK2uHN7+jOJYGCuJpylRQmuMSlexjY9KDIiTYLzcXx6toiDoO+Fkll?= =?Windows-1252?Q?a12tG/RFVk5fSTGWVZxKF7ZTovUeHdIl+bpO+bRr9LKdlT7QyHkhGK9X?= =?Windows-1252?Q?MgM+63+owhX9TEGfuV+mwgEHi7W8R6Z8y2ISgTs3dM4u7irBDH+BdD1+?= =?Windows-1252?Q?bGElbH2RpllDGOcm2XpjGCrLWwuj5V2XOSmdwcIYmswOTDX1F9Heb4XI?= =?Windows-1252?Q?J8vYM9Pjuhi6sUkyLNqTMl4XVTKUTTfwik0uTEvMJxxUzJzgx3N/3WhX?= =?Windows-1252?Q?I44qjusn3rzza4Gv8K1gzwnLuJJfwNZUN1aMoKia/hxXSvnUYcKj/BOO?= =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46H36D42PrHiJ+BoUxv1o578yDJRH8fjpEcmU; 24:3u/LE0zTN0OwSFpZuOdg94IE6EBt+zjOeJcw7wHoMp+uWdD5WBqOuBGPmQyFohyaee2tr8bso/U2wCJIVqO9snb05BwBNgFkhxQs5swmfdo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2472; 7:tmGGMULZM2o7I+LGvdFwBlt8eoznRf2bqmaksfUa9XGInxs5dXssxt4ecFn2XViDi65GOQQS/jPa0O1O4mTr5/wKGjrDeiiXb50Eb1AwbMP/OYiqZgDV0Egi3lZgZsOss9dqcvfo8zjrSfj1wOK0EbM411XXH6fUclhRpfIFd0w/0csWeLc6SE2buJ9CwBJirynpdtC/yf6JOEUxeTQ1OrYE94t80En4kPeV00fiXZp+JrQk/RqNAL+aAvpZqWzXdOkTjelhoKj0qu/LknJamvLZXEqbLOrW56Vp43tUFANf6/QVDNqANJj+7Aox/Uc3Eu7ULvCQxlyFZAOSK5l9m6hsui15AONjfIcn8/aXhQA= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2016 09:18:44.0672 (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: CY4PR03MB2472 Subject: Re: [dpdk-dev] [PATCH v2 1/7] pci: If a driver's probe function fails, unmap resources. 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 09:18:48 -0000 On Thursday 24 November 2016 01:37 AM, Ben Walker wrote: > If resources were mapped prior to probe, unmap them > if probe fails. > > This does not handle the case where the kernel driver was > forcibly unbound prior to probe. > > Signed-off-by: Ben Walker > --- > lib/librte_eal/common/eal_common_pci.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 6bff675..4f8c3a0 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -215,8 +215,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d > > /* call the driver probe() function */ > ret = dr->probe(dr, dev); > - if (ret) > + if (ret) { > dev->driver = NULL; > + if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) > + rte_eal_pci_unmap_device(dev); > + } > > return ret; > } > Acked-by: Shreyansh Jain