git: d34d7110f715 - stable/15 - ixgbe: Report hardware initialization failures to iflib

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 06:37:48 UTC
The branch stable/15 has been updated by kbowling:

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

commit d34d7110f7158c564085db64e9de0b22deeb40b1
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-07 11:30:52 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 06:37:41 +0000

    ixgbe: Report hardware initialization failures to iflib
    
    Check the result of ixgbe_init_hw() before configuring queues. Report
    failure through iflib_init_failed() instead of publishing a working
    datapath after shared-code initialization failed.
    
    Sponsored by:   BBOX.io
    
    (cherry picked from commit 6a903d9837645a9dbf990b699f50c67ad984c043)
---
 sys/dev/ixgbe/if_ix.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 57c9a3e35300..984248ee4241 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -4240,6 +4240,7 @@ ixgbe_if_init(if_ctx_t ctx)
 	u32 ctrl_ext;
 
 	int i, j, err;
+	s32 status;
 
 	INIT_DEBUGOUT("ixgbe_if_init: begin");
 	if (atomic_load_acq_int(&sc->recovery_mode)) {
@@ -4268,7 +4269,13 @@ ixgbe_if_init(if_ctx_t ctx)
 	ixgbe_set_rar(hw, 0, hw->mac.addr, sc->pool, 1);
 	hw->addr_ctrl.rar_used_count = 1;
 
-	ixgbe_init_hw(hw);
+	status = ixgbe_init_hw(hw);
+	if (status != IXGBE_SUCCESS) {
+		device_printf(dev, "Hardware initialization failed: %d\n",
+		    status);
+		iflib_init_failed(ctx);
+		return;
+	}
 	sc->iov_mta_valid = false;
 	sc->iov_vfta_valid = false;