From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0096.outbound.protection.outlook.com [65.55.169.96]) by dpdk.org (Postfix) with ESMTP id 61D1CADF8 for ; Tue, 21 Jun 2016 10:56:01 +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=WfL1YdTbTmsZrxHfllZzvQIfrgw++f+p16LxIMfGW9U=; b=JbO6/YqU7sdyiLhRMayjU+53M4MLoAxl1N7YW2Yrzk4G+qd9LEBlLrIsF4KcObgdg0JsFaO5SDiEkAJAYvvy7+thE43dAsoRPsU0Lc10s/0gtv36eogsz09xl1q1w0n61DOVgQUR7ym9Ou5Ycr4THpkrEOYdRKr7W5uobVisrFM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (111.93.218.67) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (TLS) id 15.1.523.12; Tue, 21 Jun 2016 08:55:55 +0000 Date: Tue, 21 Jun 2016 14:25:32 +0530 From: Jerin Jacob To: "Lu, Wenzhuo" CC: Stephen Hemminger , "dev@dpdk.org" , "Ananyev, Konstantin" , "Richardson, Bruce" , "Chen, Jing D" , "Liang, Cunming" , "Wu, Jingjing" , "Zhang, Helin" , "thomas.monjalon@6wind.com" Message-ID: <20160621085531.GA31880@localhost.localdomain> References: <1465191653-28408-1-git-send-email-wenzhuo.lu@intel.com> <1466403870-6840-1-git-send-email-wenzhuo.lu@intel.com> <1466403870-6840-2-git-send-email-wenzhuo.lu@intel.com> <20160620091410.GA9323@localhost.localdomain> <20160620091714.276c186c@xeon-e3> <20160621035124.GC4903@localhost.localdomain> <6A0DE07E22DDAD4C9103DF62FEBC090903488DD1@shsmsx102.ccr.corp.intel.com> <20160621073710.GA30638@localhost.localdomain> <6A0DE07E22DDAD4C9103DF62FEBC090903488F5E@shsmsx102.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC090903488F5E@shsmsx102.ccr.corp.intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0028.INDPRD01.PROD.OUTLOOK.COM (10.164.117.35) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 080f8888-e67b-44b1-a459-08d399b1dd0c X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:CK5W9pEDLya2ZF8nOJYrYLGIhdc8JGrOF9SyfHTcLXMrpzzf4KSUsGUOmJFA4HS+6oiQsXl8i9DQ4U8fnQ7f3qGmRQQO3PQ2gJBoj7ltfT6IQVz4CN0e1l4g7dFXjVRg2V4BL+Vmn5XYL1CAnty0UiJwCWJqxaD5Ggg6+MrmjrPd7H5/ET/dP8fdOGTjoU+t; 3:wLVUm7aQBuR/6a5Dpgeikw1GRKv8aX6C3GDHaYNZNd5igmHjWDIn3WdDq1Pe73i1GGXADMZm9DZ5hNjgMoGbheQb063mpqxr4HrDIpLVjaW/me6oxWS/mlYzzG6YuLj3; 25:V/Hm2400xEYvtnjVfI9WHmBFSA89uagDFty1Peo1UPi+0q2vOTGQ5EW1AtZnRRSUUlVxyUDVUi+G6e2l53HS2rVq0d1BbcrBYST/2rKEYZCzv4tXPDDGU5KqPECMGjOk1NP3Z5a0JNrrUnspfm+s6Q6WPOwIXs7FCa/796WQru/TnY+ZZuPMbqmHaclwIxEA6lTCqhm074Tc+/+HLHwh7/cP3iLAD2u5n+D7MBE9gzsMYpowyixwN2XjVndVouwS3Ihb8iDt7vgPnEtDUUZbGd2XlVF8KCKFw/AkD3rPIKCpnm4z+9/MlrhnfN5L6Mi6mEJtf4o2JQyR3ECAdfPOHoqAbvCl9c1QtOQfOSRxdu+K9cO54Bf0PuOwI409FSsAG2Eon3bCfgvxYZtCrSRipPbwgQzsEpfmOPRQZn4KB+Y= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 20:OatI+6bMtyVqLebcIGaUx5fKnlSDjdk8GiUCaxvJ8qDtU5pOv0tjD42ui1fTMkip37rUGgATB58MblAVHfonlGOaNfmwOiDu3w+T4fVmI3vad/JbVSBc3FmU3gvQOmbZCn+1eoyD63KIIskLRClsSkLWIwsxzrpeobIaRjC499n7PJDwWRsUNmGo2mVOTxhDVKICsrTR6WlmaPHOQzM6Q8AnundwkgEgfdHmkOGR2XOf3qVg0RoVMi1InfEIr94Z8xecL69H5fIyU622jIYKI580cSYzgx+IpAOqLaZIoLu3UARAgQ02DJ8FAFYdL3hOMJ78Ql3LZYU4v70+ZHyjdwGtBVP+U2pkBYdk5l08xKiPyaAaA0G1qy/1Y2zW/yAG095nTPgvY9AmkcZeAYsxPJHB2s1kXAZLD3bPmMfFBBYRVTmjBLkMNb9d01dHRC0sk/4O6n9x7JH2ulMZ1hTsm/noN5jrp3wnESpxH6hH1URIjG7hWx5wIFLx5Rzi0mq6Bna7+XQ5P6xgX2Fe149GSRgV8iZ0mZ+nPW4x5RJzBWoU3edn3tlZz0SYIJ6BtxbVZh5BbP0N1cOfmEzZDTN7zH1k20v8bowtz6R9h5i6N3U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:n4qRpprBlSUobCRAhjDuFbtdkp1UNXrVlyPtuESjW6MMlyUE2UTKZ7kbiwKzkYsDd+8U8N2tmElw+8txZcrn5wgv2Js+++oAWEbMP7gKNRPOw72kKj3Op3bcffqAx4HaGj58NXQBwKNPIL5jorfyZBAs1jKAySLm9FKYBG9VXjlFu+3Nq+6lquYXnvUoKk00W+DPb91tVhSlciabhVaiMsJUVdEUH5Bqfqk3i7I45YqdX0Jl0Ph80avqFvkSQ2hyfzJ64Z7yDE/h9zeBjk5n2DECI9E3XzjcZq+wIOQ0Qg6zRg0++oL3eJe8SE3psBjdeRLYoBNSMqmbB0NaN6C4WlaurKIMRNYGVgOGB7xwBrpUnpNx4Eeu8wHPjzLpRI/B X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(24454002)(189002)(83506001)(42186005)(101416001)(7846002)(33656002)(97756001)(106356001)(61506002)(105586002)(586003)(9686002)(1076002)(110136002)(46406003)(2906002)(189998001)(66066001)(47776003)(23726003)(50466002)(81166006)(76176999)(81156014)(68736007)(97736004)(50986999)(3846002)(8676002)(4001350100001)(4326007)(5009440100003)(77096005)(93886004)(6116002)(54356999)(92566002)(7736002)(2950100001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1723; 23:HLlyXbjC2BVB2lgqqGGear/bNI/K1dozOUxpWQX?= =?us-ascii?Q?tbvSXSZijOzywGwVoSCkUMAuJNxnJNMBM9DIiN+DXVvsNg30FxxrMPmCx3ss?= =?us-ascii?Q?na0ULs20bdhrTUXmS0DbkEyRTDD3cb3xnMRQX/2vEgVDvAiFdrKvRZqom+73?= =?us-ascii?Q?4xYnAusKRKcnRFfxVTJegQjHRGjN+TiTiNP3shI/MoFv9tR+tN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zBZv2w7qwDWjq/MQPPk2cq9vPjHMUME0e6KJp?= =?us-ascii?Q?TGrSdjNKcA9CR6hLbU6E9OMzcOSyf4VUZ?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 6:ZZ0/+uC5M7poD4l6puPHRdPngvnlHt4n0CB/V0UqYzLXTMeAUNcrkwEStiqkYSCp6Zn85Ah+9ci20lzB145X7MHqIfPfFKTwqt71XxGpqc2dAI/10Sjt4Sw5nxs5Qzq5nqFhV8j58IlfiHv3KH8EHYpMpDl9vQNNJJ7uHDX0nI9UTc/TsPcXKTXrId0ymoIk9oww8lp0xHEuASJ4wX6qWNvMbZGzO7D1Ghajt2wTqmOdiwhXQHz91lARvrVUVWYfTtPuhDTMrXSQUjyPRRsk3f8V9H44p8V24wvwAbbLHr0=; 5:QlwZoPmyz2TRpJvr7V8Zs4Be8u2QxnCkqWHKxhgLYjhL8b2vyZ/EjrlPRiXF8cXjREyP2w+3CnPbRqcpOG6n+pmO1/+VojZLBubFZT1faUtOTUELyycjOQoid1XqPzxq9FNgRoKNQJK5XYMBdoTIVg==; 24:1pgSrq30iB6jDVZ3IkAoZqBzrx/V4Kz+3OIgy/ptarGXPkg8lT1x3XEuXp0IIYqYhBkUnHH4iZ4kyGkqKcOH+xj/nl0KxLiIP2dTv3l+WGk=; 7:frxr9+CmiFWHapQst1ReCNeYDgF4jtjgXN0jUozHgRvyVNj4Y4fnHYn6YSp12WRPZTjkxgZ3WznmhlnT6rCP10S8w/DoSs2AG6x7L3xZWSEuKIpyjxUJi9oyV8j+3wyrxeJByZv+m+v343UQo4c346RjxgBnCaK1jGdA0qJtygjyc9DX+4okp1RPKK0KaeROyXUqnauJxDf7ZJ9ZkOTIrY+jBqxqmbv+yYWAYB/WQTtzEbkxPHDpi6wyHKUHAipA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 08:55:55.9011 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib/librte_ether: support device reset 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: Tue, 21 Jun 2016 08:56:02 -0000 On Tue, Jun 21, 2016 at 08:24:36AM +0000, Lu, Wenzhuo wrote: > Hi Jerin, Hi Wenzhuo, > > > > > > On Mon, Jun 20, 2016 at 02:24:27PM +0800, Wenzhuo Lu wrote: > > > > > > > Add an API to reset the device. > > > > > > > It's for VF device in this scenario, kernel PF + DPDK VF. > > > > > > > When the PF port down->up, APP should call this API to reset > > > > > > > VF port. Most likely, APP should call it in its management > > > > > > > thread and guarantee the thread safe. It means APP should stop > > > > > > > the rx/tx and the device, then reset the device, then recover > > > > > > > the device and rx/tx. > > > > > > > > > > > > Following is _a_ use-case for Device reset. But may be not be > > > > > > _the_ use case. IMO, We need to first say expected behavior of > > > > > > this API and add a use-case later. > > > > > > > > > > > > Other use-case would be, PCIe VF with functional level reset for > > > > > > SRIOV migration. > > > > > > Are we on same page? > > > > > > > > > > > > > > > In my experience with Linux devices, this is normally handled by > > > > > the device driver in the start routine. Since any use case which > > > > > needs this is going to do a stop/reset/start sequence, why not > > > > > just have the VF device driver do this in the start routine?. > > > > > > > > > > Adding yet another API and state transistion if not necessary > > > > > increases the complexity and required test cases for all devices. > > > > > > > > I agree with Stephen here.I think if application needs to call start > > > > after the device reset then we could add this logic in start itself > > > > rather exposing a yet another API > > > Do you mean changing the device_start to include all these actions, stop > > device -> stop queue -> re-setup queue -> start queue -> start device ? > > > > What was the expected API call sequence when you were introduced this API? > > > > Point was to have implicit device reset in the API call sequence(Wherever make > > sense for specific PMD) > I think the API call sequence depends on the implementation of the APP. Let's say if there's not this reset API, APP can use this API call sequence to handle the PF link down/up event, rte_eth_dev_close -> rte_eth_rx_queue_setup -> rte_eth_tx_queue_setup -> rte_eth_dev_start. > Actually our purpose is to use this reset API instead of the API call sequence. You can see the reset API is not necessary. The benefit is to save the code for APP. Then I am bit confused with original commit log description. | |It means APP should stop the rx/tx and the device, then reset the |device, then recover the device and rx/tx. | I was under impression that it a low level reset API for this device? Is n't it? The other issue is generalized outlook of the API, Certain PMD will not have PF link down/up event? Link down/up and only connected to VF and PF only for configuration. How about fixing it more transparently in PMD driver itself as PMD driver knows the PF link up/down event, Is it possible to recover the VF on that event if its only matter of resetting it? Jerin