diff options
| author | Kevin Bowling <kbowling@FreeBSD.org> | 2026-09-07 11:50:58 +0000 |
|---|---|---|
| committer | Kevin Bowling <kbowling@FreeBSD.org> | 2026-09-25 05:12:32 +0000 |
| commit | 050683bb8e136981e4a1f66e845ab05c135630f4 (patch) | |
| tree | 38d26c19eedb72eaecc3556e2b6d0bacc8863d26 | |
| parent | 4993c1052f899b9a971815df5661ca241641ad8e (diff) | |
aq: Report partial initialization failures to iflib
Stop initialization when hardware setup, ring initialization/start, or
datapath start fails. Run the existing best-effort stop/cache/reset
cleanup and report the failure through iflib_init_failed(). Do not keep
configuring later rings or publish the interface as running.
Reviewed by: nprice
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59853
| -rw-r--r-- | sys/dev/aq/aq_main.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index 5aa162e096b0..c6396d6d9699 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -770,9 +770,7 @@ aq_if_init(if_ctx_t ctx) softc->scctx->isc_intr == IFLIB_INTR_MSIX); if (err != 0) { device_printf(softc->dev, "aq_hw_init: %d\n", err); - softc->init_failed = true; - AQ_DBG_EXIT(err); - return; + goto fail; } softc->init_failed = false; softc->init_retries = 0; @@ -787,11 +785,13 @@ aq_if_init(if_ctx_t ctx) if (err) { device_printf(softc->dev, "aq_ring_tx_init: %d\n", err); + goto fail; } err = aq_ring_tx_start(hw, ring); if (err != 0) { device_printf(softc->dev, "aq_ring_tx_start: %d\n", err); + goto fail; } } for (i = 0; i < softc->rx_rings_count; i++) { @@ -801,19 +801,23 @@ aq_if_init(if_ctx_t ctx) if (err) { device_printf(softc->dev, "aq_ring_rx_init: %d\n", err); + goto fail; } err = aq_ring_rx_start(hw, ring); if (err != 0) { device_printf(softc->dev, "aq_ring_rx_start: %d\n", err); + goto fail; } aq_if_rx_queue_intr_enable(ctx, i); } err = aq_hw_start(hw); - if (err != 0) + if (err != 0) { device_printf(softc->dev, "could not start the datapath: %d\n", err); + goto fail; + } aq_if_enable_intr(ctx); err = aq_hw_rss_hash_set(&softc->hw, softc->rss_key); if (err != 0) @@ -842,6 +846,13 @@ aq_if_init(if_ctx_t ctx) device_printf(softc->dev, "could not restore promiscuous mode\n"); AQ_DBG_EXIT(0); + return; + +fail: + aq_if_stop(ctx); + softc->init_failed = true; + iflib_init_failed(ctx); + AQ_DBG_EXIT(err); } |
