face is down; the new value is picked up by the next init. Unlike e1000, igc has no ASSERT_CTX_LOCK_HELD and no acquire_swflag path, so the defect is silent here rather than an assertion failure. While here also remove unnecessary igc_if_init uses: iflib_if_init_locked() already runs after IFDI_RESUME and IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped IFDI_INIT that the following iflib_stop() undoes. Differential Revision: https://reviews.freebsd.org/D58629 (cherry picked from commit 30ccf2f48c11e54fc0540510dcec7cd006a2c366) --- sys/dev/igc/if_igc.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index fe278f2029f3..c49948f7c57e 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -807,8 +807,6 @@ igc_if_resume(if_ctx_t ctx) */ igc_disable_broken_l1_2(ctx); - igc_if_init(ctx); - return(0); } @@ -1288,8 +1286,6 @@ igc_if_media_change(if_ctx_t ctx) device_printf(sc->dev, "Unsupported media type\n"); } - igc_if_init(ctx); - return (0); } @@ -3224,6 +3220,16 @@ igc_set_flowcntl(SYSCTL_HANDLER_ARGS) return (error); } +static void +igc_sysctl_request_reinit(struct igc_softc *sc) +{ + if ((if_getflags(iflib_get_ifp(sc->ctx)) & IFF_UP) == 0) + return; + + iflib_request_reset(sc->ctx); + iflib_admin_intr_deferred(sc->ctx); +} + /* * Manage DMA Coalesce: * Control values: @@ -3269,7 +3275,7 @@ igc_sysctl_dmac(SYSCTL_HANDLER_ARGS) return (EINVAL); } /* Reinit the interface */ - igc_if_init(sc->ctx); + igc_sysctl_request_reinit(sc); return (error); } @@ -3290,7 +3296,7 @@ igc_sysctl_eee(SYSCTL_HANDLER_ARGS) return (error); sc->hw.dev_spec._i225.eee_disable = (value != 0); - igc_if_init(sc->ctx); + igc_sysctl_request_reinit(sc); return (0); }