aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-10 04:00:46 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-10 10:22:31 +0000
commit46241b7d6647dfc2fc557c02804d20b9f05af5c4 (patch)
tree73b96832da3ddf2c5d46bb843576231de98e90da
parent93f1065920d806400ace6b60b025faf91926bdaa (diff)
iavf: Do not publish link-up while stopped
A PF link event remains cached while a VF is administratively down. Media status queries called iavf_update_link_status() and published that cached state as link-up, while the stopped admin path immediately published link-down. Consumers reacting to link events could turn this into an unbounded notification loop and prevent interface detach from draining its link-state task. Keep the cached PF state, but only publish link-up after iflib has marked the VF running. A subsequent admin pass publishes the cached state after a successful initialization. MFC after: 2 weeks
-rw-r--r--sys/dev/iavf/if_iavf_iflib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c
index 77c85f4212af..82ba7a92b008 100644
--- a/sys/dev/iavf/if_iavf_iflib.c
+++ b/sys/dev/iavf/if_iavf_iflib.c
@@ -2065,8 +2065,18 @@ void
iavf_update_link_status(struct iavf_sc *sc)
{
struct iavf_vsi *vsi = &sc->vsi;
+ if_t ifp;
u64 baudrate;
+ ifp = iflib_get_ifp(vsi->ctx);
+ if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) {
+ if (vsi->link_active) {
+ vsi->link_active = false;
+ iflib_link_state_change(vsi->ctx, LINK_STATE_DOWN, 0);
+ }
+ return;
+ }
+
if (sc->link_up){
if (vsi->link_active == FALSE) {
vsi->link_active = TRUE;