git: d1e26c2153c9 - stable/14 - ice: Report initialization failures to iflib

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Mon, 24 Aug 2026 00:58:37 UTC
The branch stable/14 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=d1e26c2153c9c149c4e8124558110b1fd0a0664d

commit d1e26c2153c9c149c4e8124558110b1fd0a0664d
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-09 09:38:21 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-24 00:55:53 +0000

    ice: Report initialization failures to iflib
    
    The primary and mirror-VSI ifdi_init callbacks can return early when
    reset state or hardware queue and filter setup prevents initialization.
    Iflib then marks the interface running and enables interrupts although
    the driver did not finish bringing it up.
    
    Report each non-detach failure through iflib_init_failed().  Keep the
    existing ice reset and subinterface-reinitialization machinery
    responsible for scheduling recovery.
    
    (cherry picked from commit dcdc00a41d3e4be0e75eb625cd3a23d5a927ed15)
---
 sys/dev/ice/if_ice_iflib.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c
index a844df9d5a4a..2c06aa1020e5 100644
--- a/sys/dev/ice/if_ice_iflib.c
+++ b/sys/dev/ice/if_ice_iflib.c
@@ -2043,16 +2043,16 @@ ice_if_init(if_ctx_t ctx)
 		return;
 
 	if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE))
-		return;
+		goto err_init_failed;
 
 	if (ice_test_state(&sc->state, ICE_STATE_RESET_FAILED)) {
 		device_printf(sc->dev, "request to start interface cannot be completed as the device failed to reset\n");
-		return;
+		goto err_init_failed;
 	}
 
 	if (ice_test_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET)) {
 		device_printf(sc->dev, "request to start interface while device is prepared for impending reset\n");
-		return;
+		goto err_init_failed;
 	}
 
 	ice_update_rx_mbuf_sz(sc);
@@ -2063,7 +2063,7 @@ ice_if_init(if_ctx_t ctx)
 		device_printf(dev,
 			      "LAA address change failed, err %s\n",
 			      ice_err_str(err));
-		return;
+		goto err_init_failed;
 	}
 
 	/* Initialize software Tx tracking values */
@@ -2074,7 +2074,7 @@ ice_if_init(if_ctx_t ctx)
 		device_printf(dev,
 			      "Unable to configure the main VSI for Tx: %s\n",
 			      ice_err_str(err));
-		return;
+		goto err_init_failed;
 	}
 
 	err = ice_cfg_vsi_for_rx(&sc->pf_vsi);
@@ -2131,6 +2131,8 @@ err_stop_rx:
 	ice_control_all_rx_queues(&sc->pf_vsi, false);
 err_cleanup_tx:
 	ice_vsi_disable_tx(&sc->pf_vsi);
+err_init_failed:
+	iflib_init_failed(ctx);
 }
 
 /**
@@ -4274,20 +4276,20 @@ ice_subif_if_init(if_ctx_t ctx)
 		return;
 
 	if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE))
-		return;
+		goto err_init_failed;
 
 	if (ice_test_state(&sc->state, ICE_STATE_RESET_FAILED)) {
 		device_printf(dev,
 		    "request to start interface cannot be completed as the parent device %s failed to reset\n",
 		    device_get_nameunit(sc->dev));
-		return;
+		goto err_init_failed;
 	}
 
 	if (ice_test_state(&sc->state, ICE_STATE_PREPARED_FOR_RESET)) {
 		device_printf(dev,
 		    "request to start interface cannot be completed while parent device %s is prepared for impending reset\n",
 		    device_get_nameunit(sc->dev));
-		return;
+		goto err_init_failed;
 	}
 
 	/* XXX: Equiv to ice_update_rx_mbuf_sz */
@@ -4301,7 +4303,7 @@ ice_subif_if_init(if_ctx_t ctx)
 		device_printf(dev,
 			      "Unable to configure subif VSI for Tx: %s\n",
 			      ice_err_str(err));
-		return;
+		goto err_init_failed;
 	}
 
 	err = ice_cfg_vsi_for_rx(vsi);
@@ -4328,6 +4330,8 @@ ice_subif_if_init(if_ctx_t ctx)
 
 err_cleanup_tx:
 	ice_vsi_disable_tx(vsi);
+err_init_failed:
+	iflib_init_failed(ctx);
 }
 
 /**