<div dir="auto">Like the idea of a flag argument to reset function.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Sep 30, 2025, 02:07 Bruce Richardson <<a href="mailto:bruce.richardson@intel.com">bruce.richardson@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Sep 29, 2025 at 02:30:38PM +0000, Ciara Loftus wrote:<br>
> Introduce a function that allows a VF to request the PF to reset itself.<br>
> This is useful for example when the application detects that one of the<br>
> queues have hung or any event where a reset is required and the PF is<br>
> unlikely to trigger it.<br>
> <br>
> Signed-off-by: Ciara Loftus <<a href="mailto:ciara.loftus@intel.com" target="_blank" rel="noreferrer">ciara.loftus@intel.com</a>><br>
> Signed-off-by: Timothy Miskell <<a href="mailto:timothy.miskell@intel.com" target="_blank" rel="noreferrer">timothy.miskell@intel.com</a>><br>
> ---<br>
>  drivers/net/intel/iavf/iavf.h         |  2 ++<br>
>  drivers/net/intel/iavf/iavf_ethdev.c  |  5 ++++<br>
>  drivers/net/intel/iavf/iavf_vchnl.c   | 29 +++++++++++++++++++++++<br>
>  drivers/net/intel/iavf/meson.build    |  1 +<br>
>  drivers/net/intel/iavf/rte_pmd_iavf.c | 33 +++++++++++++++++++++++++++<br>
>  drivers/net/intel/iavf/rte_pmd_iavf.h | 11 +++++++++<br>
>  6 files changed, 81 insertions(+)<br>
>  create mode 100644 drivers/net/intel/iavf/rte_pmd_iavf.c<br>
> <br>
> diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h<br>
> index 435902fbc2..6e7aec1bb1 100644<br>
> --- a/drivers/net/intel/iavf/iavf.h<br>
> +++ b/drivers/net/intel/iavf/iavf.h<br>
> @@ -565,4 +565,6 @@ void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);<br>
>  void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);<br>
>  void iavf_handle_hw_reset(struct rte_eth_dev *dev);<br>
>  void iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change);<br>
> +bool is_iavf_supported(struct rte_eth_dev *dev);<br>
> +int iavf_request_reset(struct rte_eth_dev *dev);<br>
>  #endif /* _IAVF_ETHDEV_H_ */<br>
<br>
In general, I'm not a huge fan of adding driver-specific functions and I<br>
feel like this should fit under the existing reset APIs in some way. That<br>
should avoid the need to update (or such a big update) to testpmd, for example.<br>
Some thoughts here:<br>
<br>
1. we could add a devarg to the driver to adjust whether reset does a<br>
   "softer" reset of the VF just resetting itself, or a "hard" reset where the<br>
   PF does a fuller reset of the VF.<br>
2. rather than a devarg, would do use a driver-specific function to adjust<br>
   this behaviour. The difference here would be that the driver-specific<br>
   function would be an init-time one rather than runtime, so the runtime of<br>
   the app, like testpmd, would be generic.<br>
3. the most generic solution would be to add an additional parameter to the<br>
   reset() function itself to specify a hard or soft reset. This would mean<br>
   updating all drivers to handle the new parameter (shouldn't be hard, since<br>
   it would be __rte_unused in all cases by default). This also opens up<br>
   the possibility of other drivers - especially VFs - using it in the same<br>
   way. We could actually document that the "hard" option "may be used by VF<br>
   drivers to request a full reset of the VF by the PF".<br>
<br>
CC'ing techboard to get some wider opinions here, especially thoughts on<br>
option #3.<br>
<br>
/Bruce<br>
</blockquote></div>