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

Thomas Monjalon thomas.monjalon at 6wind.com
Thu Mar 30 21:55:19 CEST 2017


Hi,

Please help reviewers, use --in-reply-to to keep patches threaded.

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?

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

> + * 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?


More information about the dev mailing list