From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5C2BFC39E for ; Tue, 21 Jun 2016 16:03:27 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 21 Jun 2016 07:03:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,504,1459839600"; d="scan'208";a="980408836" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga001.jf.intel.com with ESMTP; 21 Jun 2016 07:03:16 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by IRSMSX154.ger.corp.intel.com ([169.254.12.28]) with mapi id 14.03.0248.002; Tue, 21 Jun 2016 15:03:15 +0100 From: "Ananyev, Konstantin" To: Jerin Jacob CC: "Lu, Wenzhuo" , Stephen Hemminger , "dev@dpdk.org" , "Richardson, Bruce" , "Chen, Jing D" , "Liang, Cunming" , "Wu, Jingjing" , "Zhang, Helin" , "thomas.monjalon@6wind.com" Thread-Topic: [dpdk-dev] [PATCH v6 1/4] lib/librte_ether: support device reset Thread-Index: AQHRyrx6upx+ZylbjUKBoLEe8UVg7p/yAfqAgAB2MgCAAMH0gIAAJ/mAgAAXG4CAAA1AAIAACKQAgAAXzkCAAApgAIAAMyMA///3kQCAABjIQA== Date: Tue, 21 Jun 2016 14:03:15 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B7433B@irsmsx105.ger.corp.intel.com> References: <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> <20160621085531.GA31880@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836B73FD0@irsmsx105.ger.corp.intel.com> <20160621105751.GA737@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836B74226@irsmsx105.ger.corp.intel.com> <20160621133041.GA7509@localhost.localdomain> In-Reply-To: <20160621133041.GA7509@localhost.localdomain> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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:03:28 -0000 > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Tuesday, June 21, 2016 2:31 PM > 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 > Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib/librte_ether: support device r= eset >=20 > On Tue, Jun 21, 2016 at 01:10:40PM +0000, Ananyev, Konstantin wrote: > > > > > > > > > > Hi Konstantin, > > > > > > > Hi Jerin, > > > > > > > > > -----Original Message----- > > > > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > > > > Sent: Tuesday, June 21, 2016 9:56 AM > > > > > To: Lu, Wenzhuo > > > > > Cc: Stephen Hemminger; dev@dpdk.org; Ananyev, Konstantin; Richard= son, Bruce; Chen, Jing D; Liang, Cunming; Wu, Jingjing; > > > Zhang, > > > > > Helin; thomas.monjalon@6wind.com > > > > > Subject: Re: [dpdk-dev] [PATCH v6 1/4] lib/librte_ether: support = device reset > > > > > > > > > > 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 + DP= DK VF. > > > > > > > > > > > > When the PF port down->up, APP should call this API= to reset > > > > > > > > > > > > VF port. Most likely, APP should call it in its man= agement > > > > > > > > > > > > thread and guarantee the thread safe. It means APP = should stop > > > > > > > > > > > > the rx/tx and the device, then reset the device, th= en recover > > > > > > > > > > > > the device and rx/tx. > > > > > > > > > > > > > > > > > > > > > > Following is _a_ use-case for Device reset. But may b= e not be > > > > > > > > > > > _the_ use case. IMO, We need to first say expected be= havior of > > > > > > > > > > > this API and add a use-case later. > > > > > > > > > > > > > > > > > > > > > > Other use-case would be, PCIe VF with functional leve= l reset for > > > > > > > > > > > SRIOV migration. > > > > > > > > > > > Are we on same page? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > In my experience with Linux devices, this is normally h= andled 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 rou= tine?. > > > > > > > > > > > > > > > > > > > > Adding yet another API and state transistion if not nec= essary > > > > > > > > > > increases the complexity and required test cases for al= l 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 st= art 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 -> star= t device ? > > > > > > > > > > > > > > What was the expected API call sequence when you were introdu= ced this API? > > > > > > > > > > > > > > Point was to have implicit device reset in the API call seque= nce(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_cl= ose -> 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 AP= I 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 th= e > > > > > |device, then recover the device and rx/tx. > > > > > | > > > > > I was under impression that it a low level reset API for this dev= ice? Is > > > > > n't it? > > > > > > > > > > The other issue is generalized outlook of the API, Certain PMD wi= ll 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 wh= at > > > value addtion reset API brings on the table? > > > > If application calls dev_reset() it doesn't need to call dev_stop() bef= ore 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. >=20 > OK. This description looks different than commit log and API doxygen comm= ent. Please fix it. > How about a different name for this API. Device reset is too generic? >=20 > > > > > > > > > > > > Yes, it would exist only for VFs, for PF it could be left unimpleme= nted. > > > > Though it definitely seems more convenient from user point of view, > > > > they would know: to handle VF reset event, they just need to call t= hat > > > > particular function, not to re-implement their own. > > > What if driver returns "not implemented" then application will have d= o > > > 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 ev= ent. > What is this event ? Is it VF Link up/down event? >=20 > 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? In case of course they do need to handle similar event. if not I suppose there is no harm to left it unimplemented. Konstantin