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

Zhao1, Wei wei.zhao1 at intel.com
Thu Apr 6 04:57:29 CEST 2017


Hi, Thomas

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Friday, March 31, 2017 3:55 AM
> To: Zhao1, Wei <wei.zhao1 at intel.com>; Mcnamara, John
> <john.mcnamara at intel.com>
> Cc: dev at dpdk.org; Lu, Wenzhuo <wenzhuo.lu at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for port
> reset
> 
> Hi,
> 
> Please help reviewers, use --in-reply-to to keep patches threaded.
> 

Ok, I will use that use --in-reply-to in later when commit patch.

> 2017-03-30 17:34, Wei Zhao:
> > Add support for port reset in rte layer.This reset feature can not
> > only used in vf port reset in later code develop, but alsopf port.But
> > in this patch set, we only limit the discussion scope to vf reset.
> > This patch Add an API to restart 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 restart 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 restart the device, then recover the device and rx/tx.
> > Also, it's APP's responsibilty to release the occupied memory.
> 
> Which memory should be released?

That is a redundancy now, because the older version need to allocation some memory for this feature, 
But it do not need now. So I will delete it in next version. 

> 
> [...]
>   /**
> > + * 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?


> 
> > + * Before calling this API, APP should stop the rx/tx. When tx is
> > +being stopped,
> > + * APP can drop the packets and release the buffer instead of sending
> them.
> > + *
> > + * @param port_id
> > + *   The port identifier of the Ethernet device.
> > + *
> > + * @return
> > + *   - (0) if successful.
> > + *   - (-ENODEV) if port identifier is invalid.
> > + *   - (-ENOTSUP) if hardware doesn't support this function.
> > + */
> > +int
> > +rte_eth_dev_reset(uint8_t port_id);
> 
> Please John, could you help with the API documentation here?

Thank you for John, please contact me if any  puzzle.


More information about the dev mailing list