[PATCH] net/ice: make link state configurable on device stop

Bruce Richardson bruce.richardson at intel.com
Thu Aug 28 12:35:24 CEST 2025


On Thu, Aug 28, 2025 at 10:23:05AM +0000, Ciara Loftus wrote:
> Introduce the boolean restore_link_state devarg for the ice driver. When
> set, when the ice port is stopped, the physical link will be restored to
> the state it was in when the device was started.
> 
> Prior to this patch the default behaviour was to always restore the link
> to its original state. The new default behaiour is to always bring the
> link down, which is in keeping with most other drivers.
> 
> Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
> ---
>  doc/guides/nics/ice.rst            | 12 ++++++++++++
>  drivers/net/intel/ice/ice_ethdev.c | 10 ++++++++--
>  drivers/net/intel/ice/ice_ethdev.h |  1 +
>  3 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst
> index 2c0f41c56c..9007b79471 100644
> --- a/doc/guides/nics/ice.rst
> +++ b/doc/guides/nics/ice.rst
> @@ -322,6 +322,18 @@ Runtime Configuration
>  
>      -a af:00.0,pps_out='[pin:0]'
>  
> +- ``Restore initial link state`` (default ``0``)
> +
> +  The user can request that the link be restored to its original state when
> +  the device is stopped.
> +
> +    -a af:00.0,restore_link_state=1
> +
> +  The default behaviour is to bring the link down when the device is stopped,
> +  however if restore_link_state is set and if the link state was up when the
> +  device was started, then it will be restored to the up state when the
> +  device is stopped.
> +
>  - ``Low Rx latency`` (default ``0``)
>  
I think that control over this is a good thing to have. However, I'm also
wondering if we also need a way to force the link to always be up on close,
therefore requiring a tri-state option, rather than just two as here
(previous or down). How about renaming the option to maybe:
"link_state_on_close" with 3 options of "up", "down", "initial"?

/Bruce


More information about the dev mailing list