[dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for port reset

Zhao1, Wei wei.zhao1 at intel.com
Thu Apr 20 11:17:24 CEST 2017


Hi, Yuanhan

> -----Original Message-----
> From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> Sent: Thursday, April 20, 2017 2:08 PM
> To: Zhao1, Wei <wei.zhao1 at intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev at intel.com>; Mcnamara, John
> <john.mcnamara at intel.com>; dev at dpdk.org; Lu, Wenzhuo
> <wenzhuo.lu at intel.com>; Thomas Monjalon <thomas at monjalon.net>; Liu,
> Yu Y <yu.y.liu at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for port
> reset
> 
> 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?
> 
> 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?
> 

Users maybe do not want to do a second configuration operation to waste time 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?
> 

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 complex
> than necessary: just thinking we have to call "xxx_queue_setup"
> for all PMDs.
> 
> I'm thinking a simple hardware reset might be enough?
> 
>     /* literally reset the hardware: reset everything */
>     rte_eth_reset(port)
>     {
>     	eth_dev->ops->reset();
>     }
> 

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 initiate a
> specific port, it then just needs do something like following to handle the
> case you described in the commit log:
> 
>     rte_eth_reset(port);
>     port_init(port);
> 

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 :/
> 
> 	--yliu


More information about the dev mailing list