From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0059.outbound.protection.outlook.com [104.47.41.59]) by dpdk.org (Postfix) with ESMTP id 333FE5599 for ; Tue, 6 Jun 2017 16:05:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AMJN+pKUKy6Sjb8yTMfxPRigW7yX5teI2GxmtqjVMx0=; b=b+1Z11ZOXjdmoJMB8PmEp4H2C+LELBmBTAgK6uUv6FhuGeFJeXiZYd3TldribC/xQcXNEF0Or8uakmWyoCC+9Bv4UjtBR9n9S2VE+KXZUBkvyhWHkr/gg3rLiOBoUYpkdC5qFrTodsYiUPriJORZdtQylFf6A/ltnKs3AZwMIx8= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin (122.167.102.185) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 6 Jun 2017 14:05:24 +0000 Date: Tue, 6 Jun 2017 19:35:07 +0530 From: Jerin Jacob To: Ferruh Yigit Cc: dev@dpdk.org, Angela Czubak , Thomas Monjalon Message-ID: <20170606140506.GA31583@jerin> References: <20170601130530.11443-1-jerin.jacob@caviumnetworks.com> <130021ab-eac2-88ae-4b32-0ffe88f0bb55@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <130021ab-eac2-88ae-4b32-0ffe88f0bb55@intel.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Originating-IP: [122.167.102.185] X-ClientProxiedBy: BM1PR01CA0094.INDPRD01.PROD.OUTLOOK.COM (10.174.208.162) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PR0701MB1724: X-MS-Office365-Filtering-Correlation-Id: 2488ff8e-8997-4757-83ed-08d4ace514cd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:Smy5PnUI8tR0mxPVbTjR7RSx4njNRmvIOuIDFsAR7vA1Blqxv1I9MNK/Nd2CJgmfFalOIQEKAfyS/5xwPjyjU+ne2v2x4N8laOkDBcnPy2sXsRiw3/01hPap6RX+KLsT5w5i2GBPQLGtBlaG9p0tRxxX7Tjqk4kvCvemcSJ0bEkWHvB9hRUIpYDHgTutN0+TrOCUW+avVtEuREalTh+Y0meI8AS0K5cCEL+CA6HHFcRoJg9MzAHPGeo0S7gxR0bTF7f+6XB8ERtJ2CXCHpBQgzS5MZDvNHU/1QRsOC1pXo8GJgHY+Lm2to8+QWpDTCjb6HvxvkH8MEzohGAzHRszuA==; 25:1/IPw0uPqF1+pQ28f4iR3zPVbrXD44+6alAIjIXTaRumt5vaP2WjWnEHbMwuzU6JVyeyw3x4psZm1DiKIvi7Y9aQkg8E8YADgpy3KfoLBGZYN9rVBX5a5EBHFcRhVKJOLoXY4BCwEaDIGI0irBiXPzkpLMBgAUxVKK9OtSjkdqN818xMHbHHiIHQp2+FAYbGT1WwVME2YGtNsEqUEq6gbuiylVJCU2zXaZKfLvLcR6AkC+lzv9lco01hnuIp8BgfkLp7WoNtzg5faesamBfVy51zkMC6cFYfIhPnkpcAHej93Kp6gMHFO6tzQ9mOpU1ZTWB8187m38+uLc8MSrV8CdDbPa9eCAFYOJ4tcT6yqsdeIEJta/n++dWWEhyFUBeockHL9RGC5ldXIJEqEI6lgEQfAGTehvf5XKHCVpncKn9t9rA8nKzutx48CmtRtb9obpKitAeBBsaW+tmFAJlkGGieHbpybD+RINGt68tNans= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:YxwuR/IkXIPqbalpDdwWDQX3AF3/4oG6Hlgo1rPvTR7R58ABJq8YqFNSwkAfWHc4ltRi6BIdnUshbJXgUBaOEnzqhzWe9ufyTUzADChaMKzveT8J0INSh1xF9f7Bm7vo+qafojnaLjnlRrtr+Pr0KJxL6NHUpjsOJ4Aa8V2l98DmpJVgjiqdaC4MzIVztrLs4rHhM5q9oziBelWFeiHztCrgITNFZ7ckBYYyQle9YTU=; 20:koItrSd/xH60yPzWxz/x93aBvRtXKDUzbhzZoeDjN9OhWyAPT6Bp/OSOZkchgBicD+GK8BfuVUJ4BHDkbf97ZSvZ+kJRgJK3GeRdGaaMjGm6U1a0ok5YzjRB0aNCfA3kkdxp9v8XD7ZiIa9IZUV6z0iM4ozxiRB/ElVPaKU8d36O6kSfIgQONMdj1JpPELBqR7Vsg/BmJeYRVEtm7UtgdDZdr3wKo9O8R6uNFlfmAPfKmqnErfYD2TtqAlHxJDBOxKEU0VXrKU0ih2M08HkDMl1YCxxmcNE+VsScDFbYpz5cM1D3lHjXHsZAz9Q0Cmfjtg1+TD+IXo3vFSTsjPS09cNB801PCclBouyuz5HLvdc5JIKyLu2E81I5NEsMviq5VHPqN6exQY8yYbNgL7COIH0CYhsvie2PXxtESLNXeuqBdTClzFlxTrlHKPZIyw6rAzt1nPSuX/IM2cuvHH3O+W2JQWNduTdR/iQ6GmiH35wHU8hBEaCTMkLfUpydLlMAeXxNKKN0pDG3arcGkFer1clKFFwjykpELFjcg26GAb2aCTXCq96X94tcJcDYU1RXDOUxRw3IhD7UsLyNpcxUNO/mMaR1aYJkGgM1XmnE7Bw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1724; 4:jMzNrcmV8koA2WHQwo6+itnOtHpwMEqeoDqWKg6z?= =?us-ascii?Q?L5aTEhN9qiaYbTReMerKzrzXgYB2yJth5WDIJUN9+cjwQgRZKXaXT9c89zTb?= =?us-ascii?Q?qV1uVyTMLfwYka0RdUWC7dKJ/4saOHYPQPDMf/sovlpny0BXx1W3Mnrdn1Db?= =?us-ascii?Q?8ePF1D+k6M7Mn6mN11wZUAzf4KMbgaWVZHGrwSvShoECW1nxj8wQCSRxVTTz?= =?us-ascii?Q?Y3IfKsF354j89XvSTRN9+mR3Ybhlz6yOlANoL65RUg6C8WEsWk3OzHrMZIlN?= =?us-ascii?Q?hbMtbaSoVC6oY+xRO8tVPSV3ZEur5BjbMmXVCIamuNCXIVFcY167Z7Vl2fd/?= =?us-ascii?Q?MglJeU94UlEK/0SkhKoWHt1toJd3KLKqY5u3+BFN3nDqfq0ylc4AhP3mCcPD?= =?us-ascii?Q?Fa6u3CMStjlRGdm1L5dKgd5ff1rNoN7xGUBAkD3pPuSk9jDRx7/b2E9DfmP+?= =?us-ascii?Q?H0XIazkfR2lD0TiFgIDs/ts1hIG9/qbdVa5HO7jPzsvYa+MQuiHSLKd2DuJK?= =?us-ascii?Q?9UTQtm82ftcCl5Gp8wGPUT652QFClrGVVAheD0snfWJTb8/GrDWfPj/iZXBm?= =?us-ascii?Q?cdJNP7fmptRmy8gx/iO9sW8ZZcDJ/FtFOYFlSf2Xcwi4SPmaxG551G+GEgi7?= =?us-ascii?Q?zoP4ZnnDLuwQYyvHzDLFQp6JuWTp3wef4bxAvuScc6/KwjlktpXRnLDpiynW?= =?us-ascii?Q?A4n031eTuxfLPQ4BZMDG6DCLEVp4o280hAZYnKhrbydBLIU+TpNcyytGra7R?= =?us-ascii?Q?dY2wWyH/GYoT36UD657NjKazMP7wWTRerAXvaPg6lhMScUW+mYMAJwdJuURz?= =?us-ascii?Q?TBS75Mx4Th1OlupVaHs1WxKNFbJOlUUceX0YZNLPcV+IIINUvBpVqAMVboQu?= =?us-ascii?Q?2yjLCmk9oMbm0I0mAvAddzz0oO+ICfU8N0OluhHxRBrzhWnxob47WLweX+U5?= =?us-ascii?Q?EZszFyqwZ/Z3h0bPIaFox/iA++AyiGX7zNlcmKa4R9xGUyCzzhz0ZRZ/Xcee?= =?us-ascii?Q?r+8fxsape1Zd9FTLaK9bwKUXb7ie2oY0J9dGgqbw3V4s+zJPnEodsefYwrSf?= =?us-ascii?Q?iKDg59NuLDh6bne/BsazEn5wMeYTPantKY66dm5iwVZRGypiN5relwsPQajI?= =?us-ascii?Q?1N6usaWoRDMBr8ZIo5B4qB3nu8PsIZ3+JKfWa0Zt+RM9dA2u5wFQhZ28evI9?= =?us-ascii?Q?c6FbNAcGtY4UWDFNjYYxYYUeYn+Aj07o+7eo?= X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(24454002)(377454003)(13464003)(76104003)(189998001)(5660300001)(33716001)(6496005)(33656002)(42186005)(1076002)(83506001)(7736002)(2906002)(478600001)(23726003)(575784001)(3846002)(6116002)(72206003)(76176999)(4001350100001)(305945005)(110136004)(6666003)(54906002)(6916009)(38730400002)(47776003)(66066001)(6246003)(229853002)(50986999)(54356999)(81166006)(42882006)(8676002)(4326008)(2950100002)(25786009)(53546009)(50466002)(9686003)(53936002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:jerin; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1724; 23:0mNmXPMUBD684p59EkOWYERMSPZFz4+dp+O3g4I?= =?us-ascii?Q?5jezldYC1G5tDGayvyi96mJQAn5UxbqRi/k99KuHn4YfBX+M+r0QLOneaSYP?= =?us-ascii?Q?PWhHUKPK25WKlVj3n5Gj6gs+nniVLIm6mkwBi71g9T7y8d4feplI3Gz8ttVm?= =?us-ascii?Q?YkpvqhbaaBuF9BQ3Z3aRChf0vhBd30ckKQHjFPGxYRVR5tQgCsXgkZN18aMW?= =?us-ascii?Q?7+le+tDxlfz3QPHJDbaHlEsWa4xJtyDEIo1OWek1sRRxkcoKHHcjqFlXnnIQ?= =?us-ascii?Q?XoWzzI4OzAYj0080uV6DCoxnj3rRC8n2m7iuWhUcSWimzRuMgSoX9dx2d/cs?= =?us-ascii?Q?WXyEdlS7tVesX+6QiXWyl8YM4N6eREjyWXmf8jJmMnTNrOfJh7hawZFxPAVj?= =?us-ascii?Q?Pd5J+P9py3c5a5nJ9GuB/ExKK7L766AEDbq4kN62S/JMNIRIc+nrOa9SSZlL?= =?us-ascii?Q?6FAl1XkiureXM1++AvIiq3QGzO3qAw9sy3TDCyVpNKQfYe3i2Z5qc4hQ8aNP?= =?us-ascii?Q?U2x+fLoES3ei+Uiy73nHod5LzW8Dab/WzQXsnEfoISjmXScDzLj5yvfE1mVK?= =?us-ascii?Q?JFh/OgH3Jn85Rd/dY2MMuWhu7/SIshmHb6ziGzvVMrnqUNvGg7bQB6S8ZxLa?= =?us-ascii?Q?rkzWcvNZBfBQGIgCALK8WHs0BeuEEGnS/0glyAirh564HYhlfGyAj/vJgGNB?= =?us-ascii?Q?4PKdORn7ecLCuM1exkQaGQkvHIAjVhohRc0eF4cWUSY3lb5tdEYt4yasHOI3?= =?us-ascii?Q?rGtfqM4lxDSMeL02WzUy22khwu8R10URBOs8zE9wKIMOkmsnkun23/WinhbW?= =?us-ascii?Q?1iprZATD3fkimVK786M2/o8njgxDnT0CAmxiu3OUnvxxs3bgmXMoxyoHQ5W6?= =?us-ascii?Q?UwAzNZ09zbUc7DuCaCYG+mrxN99rRKEI5xu/ljv3dJdPWyhbd1VjcBg6oTxR?= =?us-ascii?Q?42Z2Wsf361gBtiYahsH7Y9Tyd/tStlfilW6Hw+A9R2X3Pmbpka+yqTMm2ANT?= =?us-ascii?Q?S+2f/x6HXW726Q1Grmd45KkEKeM54UE2rwVoTnQzppHb7/zE63GR+G0MCtqq?= =?us-ascii?Q?fpvl3Ov6dXpRmV0tkwKH0EQdeFbQvSE09G0vzxj2Zjn2FPSa71MyuF30XI/U?= =?us-ascii?Q?9uwI52azxKwxpYbdJ2qC08lkmc84feuJ2BJz17PQOvxzos78VeKMj0HdUF1P?= =?us-ascii?Q?KGv8SOkvcrXfCZEzhlPFRmHsEkKq/PXa+K3eE6Yel8FYOzRm6Nfm0iibKsU+?= =?us-ascii?Q?v5wZRF/qFgX+NllUPaynx08ElBGXE1Ycwffd2yTD64rGYi13SDRkdfs+Ovi8?= =?us-ascii?Q?tFA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 6:Qs8Cp3FQnVt1XIaruIwU3bECUV8mBAo3ulBbKnli5p04qaK9XxG2yNwf3DufDkLCpdsv++B1MAA0+zHph4PIC2g3/iA7050Ukw3yDemc3TkD00fJVB6GWyiUxAgeR9ut+Lwe3Ox3pP4ppVYIGJsEHYb4q2yENDkFsUYX0P89fll97wt7eZD+87Kka5130I0ATZ3J89RiiFMDOjTqiq3JFYury+O2roVtBvRziOgC13okPRXSuEmiPQEO+mTyK/N7nsIrPk660NJ6JwSnleOHYb9yG5h6aHtF/N6480j2roz8Pj11r7k0LT9OCv1J9YjrYXvDsj0DP25hrXFinH2de6Xl8kt1MaeHhbSClkB5rCzSjxD8ed3QXSu7lwvHhIuZsLo02aIuji9o4W831T0fSOZaGe+MooPESdjD/C+d3XU/dY+Z1mWyqt14QOyEUsVsZnX8ptlFOdj6cGGHwQRHUxTxSTmU4IylNwIE+vTn0ziDgag7MoMO5IQtaJ9dN5ZhT3E0pPVQyVdnId0vZcSgKA== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 5:J9y0g7ji92WEXJdOzOuvnpoQJyU3tcGLfmOBWW1hl0jPctup5eGGyIMbXoE1neuwGQfFslsbHgsjO2AgZwmL90P2cKTfcvihSh+T7JyRSbl2a1IfikmT7Wf7FcnO57t0rKtFojFkmenrNrxUFDb/LWN6S40NyKSP7WNSQ7disxkgXzzbewfvCzURDQLfMp+TjGqVxEhqMIdbL8+GVCcQ87tZoIudiATYOWg6V9EyfL4IUa6xvultXwP0BDcwLqXEEjp17zbBpTEkmK1I4cNv2jhprsbaIrM370mL6y0veTye9qOuLJ8MLinTGVVAkSmV3/HtNNlYGYO7tvAQN8n+QqluvWRK1roInqi3vcDMHwq4zdMKSMunGmFIE+RBrl5bo2wP9PQ7jEu/bN/atTZ/E3C5siQo/l+Ub0UGq5zi8SBPCpCp8Vrjadc8oELfaog9mmMyv38kM9Tgz4Q0BT407n0QLV3077OztsmD9PcUGetG4DAHZXS8y2sqWoZoirQz; 24:APf7BwfahEqABgxlUjybWDznCEb/QyaK6Qpnx2zuz3XJGoGC94p7HTENqUtPII0oMNQBic/8Se9Mx8Q1hqmPf650rneovmMBpWLbF/qmqHo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:gUXx7w3QVHqRPF/cb7NbOlNw0Pn5SVIl9/KvRQajQum3D8tvD4eREYscNyvE9U7COxLB7V6LqqAltIRPN+2+gVHcWP689xAKW9pmgOuzRIwjVtUq7/URb9q3UArxSZkqVERgUR/SRiSwU2bXw3j+LmkiXZaOs2RDOEcv86+s/nczGexU/F9ZsOMFZMiQ0HQQF3DXkJcSUzzNc33p7rwEh3AMBf5oOGFNWTQKuP81ssCU5udIynPAvDlsrn8EussFTDxYbtnWe412Q7EPaBHVx8CMQPlTN+WL9NyK6I9e9LwHnLSruFvjqyRedyzJFD2OIC4L4gAbF0ZRArQIQiFfyw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 14:05:24.3990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: Re: [dpdk-dev] [PATCH] net/thunderx: manage PCI device mapping for SQS VFs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 14:05:28 -0000 -----Original Message----- > Date: Tue, 6 Jun 2017 14:36:09 +0100 > From: Ferruh Yigit > To: Jerin Jacob , dev@dpdk.org > CC: Angela Czubak , Thomas Monjalon > > Subject: Re: [dpdk-dev] [PATCH] net/thunderx: manage PCI device mapping for > SQS VFs > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.1.1 > > On 6/1/2017 2:05 PM, Jerin Jacob wrote: > > Since the commit e84ad157b7bc ("pci: unmap resources if probe fails"), > > EAL unmaps the PCI device if ethdev probe returns positive or > > negative value. > > > > nicvf thunderx PMD needs special treatment for Secondary queue set(SQS) > > PCIe VF devices, where, it expects to not unmap or free the memory > > without registering the ethdev subsystem. > > > > To keep the same behavior, moved the PCI map function inside > > the driver without using the EAL services. > > What do you think adding a flag something like > RTE_PCI_DRV_FIXED_MAPPING? Does mapping but not unmap on error. > This would be more generic solution. > > I am concerned about calling eal level API from PMD. Understood. Another option is to unmap only on ERROR(ie, when probe return <0 value) ret = dr->probe(dr, dev); if (ret) { // change to if (ret < 0) dev->driver = NULL; if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) rte_pci_unmap_device(dev); } I am fine with either way. Let me know, what you prefer. I will change accordingly. > > > > > Signed-off-by: Jerin Jacob > > Signed-off-by: Angela Czubak > > --- > > drivers/net/thunderx/nicvf_ethdev.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c > > index 796701b0f..6ec2f9266 100644 > > --- a/drivers/net/thunderx/nicvf_ethdev.c > > +++ b/drivers/net/thunderx/nicvf_ethdev.c > > @@ -2025,6 +2025,13 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) > > } > > > > pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); > > + > > + ret = rte_pci_map_device(pci_dev); > > + if (ret) { > > + PMD_INIT_LOG(ERR, "Failed to map pci device"); > > + goto fail; > > + } > > + > > rte_eth_copy_pci_info(eth_dev, pci_dev); > > > > nic->device_id = pci_dev->id.device_id; > > @@ -2171,7 +2178,7 @@ static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev) > > > > static struct rte_pci_driver rte_nicvf_pmd = { > > .id_table = pci_id_nicvf_map, > > - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, > > + .drv_flags = RTE_PCI_DRV_INTR_LSC, > > .probe = nicvf_eth_pci_probe, > > .remove = nicvf_eth_pci_remove, > > }; > > >