From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0084.outbound.protection.outlook.com [157.56.111.84]) by dpdk.org (Postfix) with ESMTP id 9D5D095EC for ; Tue, 21 Jun 2016 16:29:46 +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=D8AjMf+HDKR/0amsaNVdREPoHV8jZjCknjL59MMY9Ds=; b=VwrjX116njqBc865I667nQ7EKEvvn63eeTBC//IX/n2jigUjBomFHB9HDSFDUvMuMZSkOSBh/JiRzbn1rXOBZQomyn/2miq3NZcatuW64GXtGU8LZRzynzSYtKE40uXlXyRdlQPXudImwfHBHWlppGmaJLFZauHs69Kdg3czfts= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (111.93.218.67) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) with Microsoft SMTP Server (TLS) id 15.1.523.12; Tue, 21 Jun 2016 14:29:41 +0000 Date: Tue, 21 Jun 2016 19:59:25 +0530 From: Jerin Jacob To: "Ananyev, Konstantin" CC: "Lu, Wenzhuo" , Stephen Hemminger , "dev@dpdk.org" , "Richardson, Bruce" , "Chen, Jing D" , "Liang, Cunming" , "Wu, Jingjing" , "Zhang, Helin" , "thomas.monjalon@6wind.com" Message-ID: <20160621142924.GA8670@localhost.localdomain> References: <20160621035124.GC4903@localhost.localdomain> <6A0DE07E22DDAD4C9103DF62FEBC090903488DD1@shsmsx102.ccr.corp.intel.com> <20160621073710.GA30638@localhost.localdomain> <6A0DE07E22DDAD4C9103DF62FEBC090903488F5E@shsmsx102.ccr.corp.intel.com> <20160621085531.GA31880@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836B73FD0@irsmsx105.ger.corp.intel.com> <20160621105751.GA737@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836B74226@irsmsx105.ger.corp.intel.com> <20160621133041.GA7509@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836B7433B@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB97725836B7433B@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0063.INDPRD01.PROD.OUTLOOK.COM (10.163.199.35) To BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) X-MS-Office365-Filtering-Correlation-Id: 3dd64b2b-a748-4692-f38a-08d399e07d6b X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 2:ywZDgwIuWCuQ9jmI/OOFSR0EW0sZBfRj1IIAu1QQJLgW3XbEjjMIRyafRom1JZj5xbySl+P3znaqeW5RIF8/PAEDIu6krLP07Z8/bNRnH401CJya01xhSxPb1W8bz1GgyPIX5Nk5fa3P85CK8z0sHhaLGdCBZ/CkxUY81ZlSTWrvK0XLU+IATQDubJ/PEilQ; 3:IjUcu0LZE8sVhPeXc/NaRaTC3TKn14JqQ9gCR6ZWDfzXtoH0qtZ4R343quZyXYdSs4Nm4/qs7lUh8vgJtmqEiZGhHDeCZyU96eHuVa6ybt9Ueux2whW6QW4uL58RBEuB; 25:EaK5CHso3xAvc1EeiZAhtnQVVHKmkdng29iLHeAMwAGPAxdToyMuZuUfT8PDIdgb4HqtBePJl4F2T58bYuSHaaPfIOq8gjxsHzxtHmZaoibARlE0d8Wd6OQJWYif0U5u5jeqeP/9cCBRUt+5D6Pww97k1qdaKJlG6M1EYvZgrn+s//gyqdzlp1ql0kd57DuAFRoSggSlB2tVKrbtmik+BiXi1HYMHYhQg/P6iEWptXOqv9iKCN+y7lew2K1k/58eb0xFMaSGOVTnXoYLEWvvhogalYzMMaKd9bJjFkbrwBRKbarIyjTvMFOaqlfL9bnepg5XfqFjVhp9hci2JPB3KgDMQK+uF8JACn0zhnmUIVv6SFcmfoKeM3mzNJVYYe+PBIwCVQRw336kFfe55t/366c0Row35v/ipYPhjMMm638= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 20:JK8v1VcoKY5RmgKcISHvQ296QYnEpGkUMVkm8gFZybC4VTkaVLXTRY0Gn1XQCC2/AUSfekkqgfUOZs1r1fjArHogM8FwtBnQFTr87F8bAZH2x0ZvRjFZgSu4EKRXB+xetC3M/a6IARbpRrtMgKmBMnaK2n9IAG5h4sAUP4sMquwiMWYEdt/BVpZVDceoXAqm0BeqzTASsaEGC72HqB+mWF7NN2yVlrD54rYXsepHd4TeWfjXsigYRzaBRXb5+eWcphbCtbCYubFkzzLU4o8xDCN7bXVQlRxxpO3zPquqKFi0TfShrZmb0IWYt8CbWtsteTyJeC00qSuk8jGlpgsqoSrHUHO+VZ+YeM58BpPISYnzw+MG29KxyuNl86Bcx+jKSyYzw/tSJiOTIveyONSsGIvs/5KARwatkA3VEMAO+0RfFUnkHWrA1HDCxfYTYQ8t6SgKFAIGFID5niQiRNZYt5cIckLH+Te8amcA5uiYumkMqamXi1HtgOgwH7GKpcyLpnMubRMmui1fKEPMN4PwcavQ5hadEv5WwbdS+4nFdjACRPaL2PmO8rXaJDzHEZfXuXsu1VNfSqhputHbiLwW7xD8VkKzJRWc+LrvIi+ZRl4= 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)(10201501046)(3002001); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:Wcb6k+ugqwp2GL+jIQmUW4I0c09PwRqNaRjlDhmipy64E0fZTe9PBZSOjW+wpyqPsZiPXcP7Z87xyG1thce7QbmgZPrUez+u8sAJ/hVFSejWTgspZ/v9ityQGMxjhlgBWHahk2GZY0Ieq6PiCqDZru3rAOMEBJfP3Scm2AO7Gu2hn58+G0jMVkDFnC8+pLkEUpbJKb+mOIHJuBi57pCwVEnwTARLXIWhVhlbHSL1RKOO5y/ME3VwZlKT3X40ihGgMgRPCDkppg9VHidCB/JAzoJU6vdgq2S/gzYa9U+SeT6hRS91vAfEfrBeMk1AgegoBTw2MXlnOJpcwehB2AIUoEspw0V5gUMckw5A9GvHfvTB0+sOsf3Wl2qNYmMpoQOX X-Forefront-PRVS: 098076C36C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(43544003)(189002)(24454002)(66066001)(68736007)(50986999)(97756001)(33656002)(46406003)(47776003)(76176999)(54356999)(93886004)(77096005)(2950100001)(9686002)(189998001)(110136002)(83506001)(1076002)(105586002)(7846002)(50466002)(106356001)(61506002)(81166006)(81156014)(3846002)(92566002)(23726003)(4326007)(42186005)(97736004)(101416001)(586003)(6116002)(5009440100003)(8676002)(2906002)(7736002)(4001350100001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; 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; BY1PR0701MB1722; 23:1d/5Kbo0qWnR/AxW8Y5V6q7plJweSH7UeqJR7KH?= =?us-ascii?Q?UUxmB3dndrg2Jji5JmGqqQ2M+sjgoj3Yc1Z64g9HDwBiapB0qNVijv2zCJfB?= =?us-ascii?Q?ish+pXy2SeCBxDFOhaN/V1u8R6y4PqHbZ6Jmb5hw9H8/C+bRcw1+4wXhzgFP?= =?us-ascii?Q?TE03azYN9uq5F/cta7HXza8B8PDhto9ibcx2Jba9q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OK0m5CsuG6LP0sGwfSmLxPThg6aFh2BcZWSyPTZWNR?= =?us-ascii?Q?JsDLMNCZWqPV6N0t3Wi2zVaCiyQUzG8U1aIatqChfOU4vkVV8V9568Q=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 6:0s7iwU3bZvkWd/HQcOWzjecigWRIXD7TWkXVf8HFlxItQB+CU93IlWrghp3wTYh2SG1QOoAHTHjZVhTL/rB27tMBsvXnflImoVkzWp9Fd5UsjhJpLZcL9vEgixzasibAeRBfEL4mly3h53U6w1YdkieaAqjJKgKtAG650vlF0N58pfOXuqvUDKUH7QVETXy+V8jlkY6LxsFtcO/Pq+LzlVZd10NCI6sf18BH+orI+XkN3uN6U2L7QT18TY7jQyO39cKga1/laOdbslasg14CcQkKTMkpbjXYMw/UHdnD1es=; 5:T1obzn5btBrBFSLEXipnmC2lVoo9l0upPPFiHyHZs2zp/zLycfmMAX5MmG34ESUZdupOyzx9FSeuAvp1m1CvJEoSdABzXi7SoP6WvLSlF38o8eRuqblZ+2w7FLwIyNSWd2paJRS15yN+lm0Yn+g0aA==; 24:nDFOBxryDZ40p2wL75AY3zh3Lmh6EK6vhIRRizdekervQRZxa/AcsrmsBNET34OCeW0TNh89Yu57KNuXC11/Qqn3MuGaozFDfvZrBpDYdCc=; 7:fWJpVF8xEFte3zHSVnAYIRkGvcA0AmlgkNyE0LkP6/uKOdU9TtZfi8IFpBHdJwmd2YK/KwlJBUk59XJq1mVtu2i/VHoOcppFpGi4d0yC1mq7OIQ/5/bxMR4ewMpFi3rsZ1AS1aeleMvuu9uN6XMpYo1KXO4D5gnFi6xN8bZ0fHRTYrycIyfaz551sEcjSpVAAKRfl1a/JTsn310Vvnz6lUp6xU+/5nD34NY1+ly/E6o0RilkHBD5xxr57WAT+mhh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2016 14:29:41.4127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 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 14:29:47 -0000 On Tue, Jun 21, 2016 at 02:03:15PM +0000, Ananyev, Konstantin wrote: > > > > > > > > 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? > > > > > > > > > > I think we already went through that discussion on the list. > > > > > Unfortunately with current dpdk design it is hardly possible. > > > > > To achieve that we need to introduce some sort of synchronisation > > > > > between IO and control APIs (locking or so). > > > > > Actually I am not sure why having a special reset function will be a problem. > > > > > > > > | > > > > |It means APP should stop the rx/tx and the device, then reset the > > > > |device, then recover the device and rx/tx. > > > > | > > > > Just to understand, If application still need to do the stop then what > > > > value addtion reset API brings on the table? > > > > > > If application calls dev_reset() it doesn't need to call dev_stop() before it. > > > dev_reset() will take care of it. > > > But it needs to make sure that no other thread will try to modify that device state > > > (either dev_stop/start, or eth_rx_busrst/eth_tx_burst) while the reset op is in place. > > > > OK. This description looks different than commit log and API doxygen comment. Please fix it. > > How about a different name for this API. Device reset is too generic? > > > > > > > > > > > > > > > > > > Yes, it would exist only for VFs, for PF it could be left unimplemented. > > > > > Though it definitely seems more convenient from user point of view, > > > > > they would know: to handle VF reset event, they just need to call that > > > > > particular function, not to re-implement their own. > > > > What if driver returns "not implemented" then application will have do > > > > generic rte_eth_dev_stop/rte_eth_dev_start. > > > >That way in application perspective we are NOT solving any problem. > > > > > > True, but as I said for PF application would just never receive such event. > > What is this event ? Is it VF Link up/down event? > > > > No I was referring to VF itself, Other VF PMD drivers in drivers/net > > where this callback is not implemented. > > Hmm, the only suggestion I have here - > Maintainers/developers of non-Intel PMD will implement it for their VFs? That's fine. But, We have to know what to implement here in PMD perspective? That's reason being asking about the API expectation and application usage :-) > In case of course they do need to handle similar event. Which is this event and How application get notify it. > if not I suppose there is no harm to left it unimplemented. OK. If it is for VF/PF link down-up event then I will make it as 'nop'. Jerin > Konstantin >