git: b5f07a56dbbd - stable/15 - enic: Report device enable failures to iflib
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 06:36:50 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=b5f07a56dbbd3aa9fd022ec77c9511b50ba2ef90
commit b5f07a56dbbd3aa9fd022ec77c9511b50ba2ef90
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-07 11:13:26 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 06:36:41 +0000
enic: Report device enable failures to iflib
Do not publish a running interface after vnic_dev_enable_wait() fails.
Run the existing stop cleanup for the queues configured before the enable
request, then report initialization failure to iflib.
Mark those queues as needing cleanup before submitting the enable request
so the stopped-state shortcut cannot skip the unwind.
Sponsored by: BBOX.io
(cherry picked from commit 24f8c4e852d69189a1de1ff51c351ae8ee603dfa)
---
sys/dev/enic/if_enic.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c
index aa80ee6bafde..afdc39685aee 100644
--- a/sys/dev/enic/if_enic.c
+++ b/sys/dev/enic/if_enic.c
@@ -984,6 +984,7 @@ enic_init(if_ctx_t ctx)
struct enic *enic;
if_softc_ctx_t scctx;
unsigned int index;
+ int error;
softc = iflib_get_softc(ctx);
scctx = softc->scctx;
@@ -1005,11 +1006,17 @@ enic_init(if_ctx_t ctx)
bcopy(if_getlladdr(softc->ifp), softc->lladdr, ETHER_ADDR_LEN);
enic_set_lladdr(softc);
+ /* Queue setup above needs normal stop cleanup even if enable fails. */
+ softc->stopped = 0;
ENIC_LOCK(softc);
- vnic_dev_enable_wait(enic->vdev);
+ error = vnic_dev_enable_wait(enic->vdev);
ENIC_UNLOCK(softc);
-
- softc->stopped = 0;
+ if (error != 0) {
+ device_printf(softc->dev, "Device enable failed: %d\n", error);
+ enic_stop(ctx);
+ iflib_init_failed(ctx);
+ return;
+ }
enic_link_status(softc);
}