git: 671ae2d2ed68 - stable/15 - enic: Route resets through iflib lifecycle

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 18 Sep 2026 00:09:49 UTC
The branch stable/15 has been updated by kbowling:

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

commit 671ae2d2ed680166ddb09df5e82d2cd23fffb076
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-26 09:21:55 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-09-18 00:09:34 +0000

    enic: Route resets through iflib lifecycle
    
    Mark the driver stopped after attach so its first IFDI_STOP() call
    does not repeat hardware shutdown.
    
    Defer error interrupt recovery through iflib instead of calling
    driver stop and init methods from interrupt context.  Let iflib own
    the stop and restart around MTU changes as well, avoiding duplicate
    lifecycle operations.
    
    Sponsored by:   BBOX.io
    
    (cherry picked from commit 58f985559ee689e50233b9113df4f37375b48c2d)
---
 sys/dev/enic/if_enic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c
index 74e3ff6f8721..8d8f75d4611d 100644
--- a/sys/dev/enic/if_enic.c
+++ b/sys/dev/enic/if_enic.c
@@ -449,6 +449,8 @@ enic_attach_pre(if_ctx_t ctx)
 		dev_err(enic, "Device initialization failed, aborting\n");
 		goto err_out_dev_close;
 	}
+	/* Queue DMA has not been enabled; the first iflib stop may be skipped. */
+	softc->stopped = 1;
 	ENIC_UNLOCK(softc);
 
 	enic->port_mtu = vnic_dev_mtu(enic->vdev);
@@ -912,8 +914,8 @@ enic_err_intr(void *vsc)
 
 	softc = vsc;
 
-	enic_stop(softc->ctx);
-	enic_init(softc->ctx);
+	iflib_request_reset_if_up(softc->ctx);
+	iflib_admin_intr_deferred(softc->ctx);
 
 	return (FILTER_HANDLED);
 }
@@ -1091,14 +1093,12 @@ enic_mtu_set(if_ctx_t ctx, uint32_t mtu)
 	softc = iflib_get_softc(ctx);
 	enic = &softc->enic;
 
-	enic_stop(softc->ctx);
 	if (mtu > enic->port_mtu){
 		return (EINVAL);
 	}
 
 	enic->config.mtu = mtu;
 	scctx->isc_max_frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-	enic_init(softc->ctx);
 
 	return (0);
 }