On October 2, 2026 3:07:45 PM GMT+02:00, Petr Oros <[email protected]> wrote:
>ice_vsi_cfg_lan() adds the LAN (and XDP) Tx queues to the scheduler and
>enables them in hardware. If anything after it fails in ice_vsi_open(),
>for example requesting the MSI-X vectors, the error path only frees the
>ring memory and leaves the queues configured. Every following open then
>fails to add the same queues again and the netdev can not be brought up
>until the driver is reloaded:
>
>  ice 0000:04:00.2: Failed to set LAN Tx queue context, error: -5
>  ice 0000:04:00.2 enp4s0f2np2: Failed to open VSI 0x0010 on switch 0x0002
>
>Stop the Tx queues on the error paths that run after ice_vsi_cfg_lan().
>The ice_up_complete() failure path already does it through ice_down(),
>so let it skip the new step.
>
>There is no i40e counterpart of this fix, i40e does not add its Tx
>queues through the admin queue. It was found while verifying the
>previous patch. With the IRQ unwind fixed the warnings were gone, but
>the netdev still could not be opened again after the forced
>request_irq failure.
>
>Fixes: cdedef59deb0 ("ice: Configure VSIs for Tx/Rx")
>Assisted-by: LLM

Which one?

Otherwise...

Reviewed-by: Ivan Vecera <[email protected]>


>Signed-off-by: Petr Oros <[email protected]>
>---
> drivers/net/ethernet/intel/ice/ice_main.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/ethernet/intel/ice/ice_main.c 
>b/drivers/net/ethernet/intel/ice/ice_main.c
>index d246cde36ae726..e62a8f544345a3 100644
>--- a/drivers/net/ethernet/intel/ice/ice_main.c
>+++ b/drivers/net/ethernet/intel/ice/ice_main.c
>@@ -7561,13 +7561,13 @@ int ice_vsi_open(struct ice_vsi *vsi)
> 
>       err = ice_vsi_cfg_lan(vsi);
>       if (err)
>-              goto err_setup_rx;
>+              goto err_stop_tx;
> 
>       snprintf(int_name, sizeof(int_name) - 1, "%s-%s",
>                dev_driver_string(ice_pf_to_dev(pf)), vsi->netdev->name);
>       err = ice_vsi_req_irq_msix(vsi, int_name);
>       if (err)
>-              goto err_setup_rx;
>+              goto err_stop_tx;
> 
>       if (bitmap_empty(pf->txtime_txqs, pf->max_pf_txqs))
>               ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
>@@ -7593,8 +7593,14 @@ int ice_vsi_open(struct ice_vsi *vsi)
> 
> err_up_complete:
>       ice_down(vsi);
>+      ice_vsi_free_irq(vsi);
>+      goto err_setup_rx;
> err_set_qs:
>       ice_vsi_free_irq(vsi);
>+err_stop_tx:
>+      ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, 0);
>+      if (vsi->xdp_rings)
>+              ice_vsi_stop_xdp_tx_rings(vsi);
> err_setup_rx:
>       ice_vsi_free_rx_rings(vsi);
> err_setup_tx:

Reply via email to