From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 77678DE0 for ; Thu, 20 Apr 2017 11:19:27 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 02:19:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,225,1488873600"; d="scan'208";a="79130564" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga004.jf.intel.com with ESMTP; 20 Apr 2017 02:19:25 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.175]) by KMSMSX151.gar.corp.intel.com ([169.254.10.62]) with mapi id 14.03.0319.002; Thu, 20 Apr 2017 17:17:25 +0800 From: "Zhao1, Wei" To: Yuanhan Liu CC: "Ananyev, Konstantin" , "Mcnamara, John" , "dev@dpdk.org" , "Lu, Wenzhuo" , Thomas Monjalon , "Liu, Yu Y" Thread-Topic: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for port reset Thread-Index: AQHSqTm8K6Xc/Z+bh0WPnxNjoB7PqKGtRo6AgAplLjCAFbSeAIAAugdg Date: Thu, 20 Apr 2017 09:17:24 +0000 Message-ID: References: <1490866456-52241-1-git-send-email-wei.zhao1@intel.com> <1490866456-52241-2-git-send-email-wei.zhao1@intel.com> <2969664.trJitADFWx@xps13> <20170420060758.GA12462@yliu-dev.sh.intel.com> In-Reply-To: <20170420060758.GA12462@yliu-dev.sh.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for port reset 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: Thu, 20 Apr 2017 09:19:28 -0000 Hi, Yuanhan > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Thursday, April 20, 2017 2:08 PM > To: Zhao1, Wei > Cc: Ananyev, Konstantin ; Mcnamara, John > ; dev@dpdk.org; Lu, Wenzhuo > ; Thomas Monjalon ; Liu, > Yu Y > Subject: Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for = port > reset >=20 > On Thu, Apr 06, 2017 at 02:57:29AM +0000, Zhao1, Wei wrote: > > > > + * Reset an ethernet device when it's not working. One scenario > > > > + is, after PF > > > > + * port is down and up, the related VF port should be reset. > > > > + * The API will stop the port, clear the rx/tx queues, re-setup > > > > + the rx/tx > > > > + * queues, restart the port. > > > > > > s/The API/This function/ > > > > > > Please explain exactly the responsibility of this function, and how > > > it is different from calling stop/configure/start. > > > > In this reset feature, reset function can do the calling > > stop/configure/start process, but also It can also do some restore > > work for the port, for example, it can restore the added parameters of > vlan, mac_addrs, promisc_unicast_enabled falg and > promisc_multicast_enabled flag. > > Maybe , I should add this explanation in the patch comments or function > comments? >=20 > I'm curious why we have to do save & restore for a reset operation. > Why some configures have to be saved and restored? Doesn't "reset" > literally means reset everything? >=20 Users maybe do not want to do a second configuration operation to waste tim= e after reset which lost all previous configuration. But he still want these configuration valid after reset. So, save & restore can help them to save this process time and effort. > Even though, how do you tell what kind of configures need be restored and > what should not? Again, even though, will all PMDs supports restoring the > same set of configurations? >=20 Yes, this is hard to say what may be need and what may be not for user. Now, the kinds of supported is list in patch set comment. And only i40e NIC= support this feature. > While looking at your reset implementation for i40e, it looks more comple= x > than necessary: just thinking we have to call "xxx_queue_setup" > for all PMDs. >=20 > I'm thinking a simple hardware reset might be enough? >=20 > /* literally reset the hardware: reset everything */ > rte_eth_reset(port) > { > eth_dev->ops->reset(); > } >=20 You mean just do a reset and do not restore any configuration? That may not meet the need for this feature from customer? > Assume the application already has a function (say, port_init()) to initi= ate a > specific port, it then just needs do something like following to handle t= he > case you described in the commit log: >=20 > rte_eth_reset(port); > port_init(port); >=20 You mean "rte_eth_reset" is the function of "rte_eth_dev_reset"? I do not find any function named rte_eth_reset. > Makes sense? Sorry it's completely wrong; I've limited knowledge on NIC > pmd drivers after all :/ >=20 > --yliu