From nobody Thu Oct 29 06:08:43 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jFYhD22Spz6xs12 for ; Thu, 29 Oct 2026 06:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFYhD0Mvzz5379 for ; Thu, 29 Oct 2026 06:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793254124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n1UER0qExd1ag3tFBrAtmrgxX3o39/FYA5zor59q4Q=; b=a2GCCu7rkeoHEnWnweo1rBGjuEcqheB4FRBCOCiVPv74fi+vH4XjmN+NX7O7Oojey816qf oTVo8OsoPVEZQLtL8UwfFgmrrJTvfi0s2bIqf7z5416GKEcUM3ZjidnKJPg2NKpNSIOoIU TFE0zAogzRgRflWKXDGfzX1We9Z/+fG8TVDwsYYAIin703NWD3ueQaK6E8P8Zo23TE29BE 0D8nSvmxsA7pREt1dxgsb+hW5oEVHSxnZHfm9KZpQ5CQIzFrtGL0EUPz8/AH/Db8RvzRo9 ira1L3ahACoKh7wE0taVxmkdLEi2FcS7DOqHuAgfubQk1oWughn04NRL20qzmw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793254124; b=rYbPJb0e6uBgrMXpobJT4AKfeuc3XuE6KIRHNpeb8oHyW+9lQYzlZ1gin1jiFBsBQf1H6U S5mEd6Xr7jnE/gvaE0ofN9Pn2G1Ye2dZxPfFgcyFoaUHonAzkf19sGyEHSJGQgh56w8Htx VW7PkGN6skzAjn7187jHYE3BRN0TzKPrvVZ0NSU8PGcwqy4iwqCcuj7E3XAE0nln4EDLnt E5+VB7xgxmZ34Kb6nzzSK8uFRv0G+EeBFarVPGgE0hqataKI0ie8xj/R1djofwa63NupKf Jb0U8Q53gowRpXwyAWcGehB0JMKHBNsV5ca9z9GM65vao+WuCC8/p/fdW9NpiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793254124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9n1UER0qExd1ag3tFBrAtmrgxX3o39/FYA5zor59q4Q=; b=yKMGt0bUp5DQmjAmEYt9SqtMC+C/6BKuvEg9t4ZByPw9ciCAVlXVxsAfSEk8G775/e8+M/ 9pMOwIEdL+E7CnwyN+QgT1dlCj9TWBYQTsrt4vjtd5V166GVay9gkwmQjBJnWkQUy+lsIA AyPdztQ6xYB2dC6pc/e8uL7kESrv1LmUSi+VVGcHWTRtegxCGJrQHazxXKUAbtkibp2otx y+vbyhGfU5yPAxHTiRIBYIQscsZNfQSG8fYxyNc6/ARH6ypthmjCbfirFBAmW7Z9ucm6mA A9r9OqYcjcMSYVKC20DyGZOMdc9FCh40Z8duzH40X6JHbmt2gtaFsxmxq8msiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFYhC6lxgzQqR for ; Thu, 29 Oct 2026 06:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a513 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:08:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 858d03d6db4a - stable/15 - iflib: Use the framework run-state accessor in drivers List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 858d03d6db4aff4193aff2aec8d3030e394746a2 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:08:43 +0000 Message-Id: <6ae2e2eb.3a513.2e71770c@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=858d03d6db4aff4193aff2aec8d3030e394746a2 commit 858d03d6db4aff4193aff2aec8d3030e394746a2 Author: Kevin Bowling AuthorDate: 2026-09-11 19:04:15 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 06:07:54 +0000 iflib: Use the framework run-state accessor in drivers Replace direct IFF_DRV_RUNNING reads in ixgbe, ixv, iavf, ixl, ice, bnxt Ethernet, aq, enic and the axgbe PCI frontend with iflib_is_running(). Keep each existing mailbox-ready, fault-state, link-state and administrative-up condition: framework admission is not a substitute for device specific readiness. This covers interrupt admission, operational link publication, VF mailbox and VLAN replay, and live-configuration decisions. Remove ifnet temporaries used only to read the driver flags. Replace the em and igc debug dumps' RUNNING/OACTIVE text with one framework admission snapshot. OACTIVE does not mean that the interface or hardware is inactive. Label the result as software admission rather than link state or proof that DMA has stopped, and retain the queue head/tail dumps and separate RS diagnostics. Keep the filter register and requested interface flags in the axgbe PCI promiscuous-mode trace, but remove its unrelated legacy driver flags. Use the parent Ethernet PF context for the bnxt RDMA running check, retaining the link-state check and the existing IB_PORT_ACTIVE policy. Both current RDMA construction paths use the PF netdev, and Ethernet detach synchronously removes the RDMA auxiliary child before iflib frees that context. Declare the direct iflib module dependency. This does not transfer ownership of RDMA queues to iflib. Leave the independent, non-iflib axgbe ARM frontend unchanged. The separate igbv driver is not present on stable/15, so omit the if_igbv.c changes. Reviewed by: iflib (gallatin) Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59601 (cherry picked from commit d5ae08ff06240ca889010be9799e158efaa06322) --- sys/dev/aq/aq_irq.c | 2 +- sys/dev/axgbe/if_axgbe_pci.c | 8 +++----- sys/dev/bnxt/bnxt_en/bnxt_sriov.c | 2 +- sys/dev/bnxt/bnxt_en/bnxt_sysctl.c | 10 +++++----- sys/dev/bnxt/bnxt_re/bnxt_re.h | 2 +- sys/dev/bnxt/bnxt_re/main.c | 1 + sys/dev/e1000/if_em.c | 12 ++---------- sys/dev/enic/if_enic.c | 4 +--- sys/dev/iavf/if_iavf_iflib.c | 9 +++------ sys/dev/ice/if_ice_iflib.c | 2 +- sys/dev/igc/if_igc.c | 12 ++---------- sys/dev/ixgbe/if_ix.c | 11 +++++------ sys/dev/ixgbe/if_ixv.c | 11 ++++------- sys/dev/ixl/ixl_pf_main.c | 2 +- 14 files changed, 31 insertions(+), 57 deletions(-) diff --git a/sys/dev/aq/aq_irq.c b/sys/dev/aq/aq_irq.c index e52820ad77dc..cba5a2c56131 100644 --- a/sys/dev/aq/aq_irq.c +++ b/sys/dev/aq/aq_irq.c @@ -330,7 +330,7 @@ aq_if_update_admin_status(if_ctx_t ctx) } /* A stopped or half-initialized interface has no link. */ - running = (if_getdrvflags(iflib_get_ifp(ctx)) & IFF_DRV_RUNNING) != 0; + running = iflib_is_running(ctx); if (!running || aq_dev->init_failed) link_speed = 0; diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 00b4c6c1d451..0153247495e3 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -357,7 +357,7 @@ axgbe_miibus_statchg(device_t dev) pdata->phy_link); if (mii == NULL || ifp == NULL || - (if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + !iflib_is_running(sc->ctx)) return; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == @@ -2357,11 +2357,9 @@ axgbe_if_promisc_set(if_ctx_t ctx, int flags) { struct axgbe_if_softc *sc = iflib_get_softc(ctx); struct xgbe_prv_data *pdata = &sc->pdata; - if_t ifp = pdata->netdev; - axgbe_printf(1, "%s: MAC_PFR 0x%x drv_flags 0x%x if_flags 0x%x\n", - __func__, XGMAC_IOREAD(pdata, MAC_PFR), if_getdrvflags(ifp), - flags); + axgbe_printf(1, "%s: MAC_PFR 0x%x if_flags 0x%x\n", + __func__, XGMAC_IOREAD(pdata, MAC_PFR), flags); if (flags & IFF_PROMISC) { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sriov.c b/sys/dev/bnxt/bnxt_en/bnxt_sriov.c index 071feffbadfd..378cb2c77dfa 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_sriov.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_sriov.c @@ -899,7 +899,7 @@ bnxt_iov_init(if_ctx_t ctx, uint16_t num_vfs, const nvlist_t *params) if_t ifp = iflib_get_ifp(ctx); struct bnxt_softc *softc = iflib_get_softc(ctx); bool admin_up = !!(if_getflags(ifp) & IFF_UP); - bool running = !!(if_getdrvflags(ifp) & IFF_DRV_RUNNING); + bool running = iflib_is_running(ctx); if (!admin_up || !running) { device_printf(softc->dev, "PF is down, rejecting VF creation\n"); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c index 351d8aa87d85..3cf8a5d7dcda 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_sysctl.c @@ -1377,7 +1377,7 @@ bnxt_rss_key_sysctl(SYSCTL_HANDLER_ARGS) p += 2; } - if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) + if (iflib_is_running(softc->ctx)) bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, softc->vnic_info.rss_hash_type); @@ -1432,7 +1432,7 @@ bnxt_rss_type_sysctl(SYSCTL_HANDLER_ARGS) } if (type != softc->vnic_info.rss_hash_type) { softc->vnic_info.rss_hash_type = type; - if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) + if (iflib_is_running(softc->ctx)) bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, softc->vnic_info.rss_hash_type); } @@ -1459,7 +1459,7 @@ bnxt_rx_stall_sysctl(SYSCTL_HANDLER_ARGS) { else softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_BD_STALL; - if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) + if (iflib_is_running(softc->ctx)) rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); return rc; @@ -1484,7 +1484,7 @@ bnxt_vlan_strip_sysctl(SYSCTL_HANDLER_ARGS) { else softc->vnic_info.flags &= ~BNXT_VNIC_FLAG_VLAN_STRIP; - if (if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING) + if (iflib_is_running(softc->ctx)) rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); return rc; @@ -1769,7 +1769,7 @@ fn_name(SYSCTL_HANDLER_ARGS) { \ if (rc || !req->newptr) \ return rc; \ \ - if ((if_getdrvflags(iflib_get_ifp(softc->ctx)) & IFF_DRV_RUNNING)) \ + if (iflib_is_running(softc->ctx)) \ return EBUSY; \ \ if (!(softc->flags & BNXT_FLAG_TPA)) \ diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re.h b/sys/dev/bnxt/bnxt_re/bnxt_re.h index 0afc8566c020..4a605a06ddbf 100644 --- a/sys/dev/bnxt/bnxt_re/bnxt_re.h +++ b/sys/dev/bnxt/bnxt_re/bnxt_re.h @@ -947,7 +947,7 @@ int bnxt_re_setup_cnp_cos(struct bnxt_re_dev *rdev, bool reset); static inline enum ib_port_state bnxt_re_get_link_state(struct bnxt_re_dev *rdev) { - if (if_getdrvflags(rdev->netdev) & IFF_DRV_RUNNING && + if (iflib_is_running(rdev->en_dev->softc->ctx) && if_getlinkstate(rdev->netdev) == LINK_STATE_UP) return IB_PORT_ACTIVE; return IB_PORT_DOWN; diff --git a/sys/dev/bnxt/bnxt_re/main.c b/sys/dev/bnxt/bnxt_re/main.c index 5b1fe2ae0faa..90ddaba1ec63 100644 --- a/sys/dev/bnxt/bnxt_re/main.c +++ b/sys/dev/bnxt/bnxt_re/main.c @@ -66,6 +66,7 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_DEPEND(bnxt_re, linuxkpi, 1, 1, 1); MODULE_DEPEND(bnxt_re, ibcore, 1, 1, 1); MODULE_DEPEND(bnxt_re, if_bnxt, 1, 1, 1); +MODULE_DEPEND(bnxt_re, iflib, 1, 1, 1); MODULE_VERSION(bnxt_re, 1); diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 858cb6a176fd..41198ff826e5 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -7876,21 +7876,13 @@ static void em_print_debug_info(struct e1000_softc *sc) { device_t dev = iflib_get_dev(sc->ctx); - if_t ifp = iflib_get_ifp(sc->ctx); if (sc->tx_queues == NULL || sc->rx_queues == NULL) { device_printf(dev, "queue state is unavailable\n"); return; } - if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) - printf("Interface is RUNNING "); - else - printf("Interface is NOT RUNNING\n"); - - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) - printf("and INACTIVE\n"); - else - printf("and ACTIVE\n"); + device_printf(dev, "iflib software admission: %s\n", + iflib_is_running(sc->ctx) ? "open" : "closed"); for (int i = 0; i < sc->tx_num_queues; i++) { device_printf(dev, "TX Queue %d ------\n", i); diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index 8d8f75d4611d..82bed15e3f67 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -877,11 +877,9 @@ static int enic_rxq_intr(void *rxq) { struct vnic_rq *rq; - if_t ifp; rq = (struct vnic_rq *)rxq; - ifp = iflib_get_ifp(rq->vdev->softc->ctx); - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (!iflib_is_running(rq->vdev->softc->ctx)) return (FILTER_HANDLED); return (FILTER_SCHEDULE_THREAD); diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index aba31d05ee1d..25aee839648a 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -1558,10 +1558,9 @@ iavf_if_update_admin_status(if_ctx_t ctx) struct iavf_sc *sc = iavf_sc_from_ctx(ctx); struct iavf_hw *hw = &sc->hw; struct iavf_vsi *vsi = &sc->vsi; - if_t ifp = iflib_get_ifp(ctx); u16 pending = 0; - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || + if (!iflib_is_running(ctx) || atomic_load_acq_32(&sc->mbx_ready) == 0) { if (vsi->link_active) { vsi->link_active = false; @@ -2075,11 +2074,9 @@ 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 (!iflib_is_running(vsi->ctx)) { if (vsi->link_active) { vsi->link_active = false; iflib_link_state_change(vsi->ctx, LINK_STATE_DOWN, 0); @@ -2419,7 +2416,7 @@ iavf_sysctl_queue_interrupt_table(SYSCTL_HANDLER_ARGS) } #ifdef IAVF_DEBUG -#define CTX_ACTIVE(ctx) ((if_getdrvflags(iflib_get_ifp(ctx)) & IFF_DRV_RUNNING)) +#define CTX_ACTIVE(ctx) iflib_is_running(ctx) /** * iavf_sysctl_vf_reset - Request a VF reset diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index be4e45370f4b..492c2a232f17 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -2610,7 +2610,7 @@ err_release_tx_queues: } /* determine if the iflib context is active */ -#define CTX_ACTIVE(ctx) ((if_getdrvflags(iflib_get_ifp(ctx)) & IFF_DRV_RUNNING)) +#define CTX_ACTIVE(ctx) iflib_is_running(ctx) /** * ice_rebuild_recovery_mode - Rebuild driver state while in recovery mode diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 7aa8a1df9203..37eef6e84d63 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -3892,17 +3892,9 @@ static void igc_print_debug_info(struct igc_softc *sc) { device_t dev = iflib_get_dev(sc->ctx); - if_t ifp = iflib_get_ifp(sc->ctx); - if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) - printf("Interface is RUNNING "); - else - printf("Interface is NOT RUNNING\n"); - - if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) - printf("and INACTIVE\n"); - else - printf("and ACTIVE\n"); + device_printf(dev, "iflib software admission: %s\n", + iflib_is_running(sc->ctx) ? "open" : "closed"); for (int i = 0; i < sc->tx_num_queues; i++) { device_printf(dev, "TX Queue %d ------\n", i); diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 42054fc498ae..60f8145932a8 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -2959,10 +2959,9 @@ ixgbe_msix_que(void *arg) { struct ix_rx_queue *que = arg; struct ixgbe_softc *sc = que->sc; - if_t ifp = iflib_get_ifp(que->sc->ctx); /* Protect against spurious interrupts */ - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (!iflib_is_running(sc->ctx)) return (FILTER_HANDLED); ixgbe_disable_queue(sc, que->msix); @@ -5212,7 +5211,7 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) * MOD and firmware events can produce dependent requests. Fold those * into the claimed batch so link state is sampled after any link setup. */ - if ((if_getdrvflags(iflib_get_ifp(ctx)) & IFF_DRV_RUNNING) != 0 && + if (iflib_is_running(ctx) && (sc->iov_mbx_cleanup_pending || ixgbe_mbx_pending(sc))) atomic_set_32(&sc->task_requests, IXGBE_REQUEST_TASK_MBX); for (pass = 0; pass < IXGBE_ADMIN_TASK_BUDGET; pass++) { @@ -5231,7 +5230,7 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) ixgbe_handle_msf(ctx); /* A reset request can re-enable VF traffic; skip it while stopped. */ if ((requests & IXGBE_REQUEST_TASK_MBX) != 0 && - (if_getdrvflags(iflib_get_ifp(ctx)) & IFF_DRV_RUNNING) != 0) + iflib_is_running(ctx)) ixgbe_handle_mbx(ctx); if (requests & IXGBE_REQUEST_TASK_FDIR) ixgbe_reinit_fdir(ctx); @@ -5669,7 +5668,7 @@ ixgbe_set_flowcntl(struct ixgbe_softc *sc, int fc) /* Updating SRRCTL on a live queue is itself an MDD violation. */ mdd_active = sc->num_rx_queues > 1 && (sc->feat_en & IXGBE_FEATURE_SRIOV) != 0 && - (if_getdrvflags(iflib_get_ifp(sc->ctx)) & IFF_DRV_RUNNING) != 0; + iflib_is_running(sc->ctx); if (mdd_active) ixgbe_disable_mdd(&sc->hw); if (sc->num_rx_queues > 1) { @@ -5990,7 +5989,7 @@ ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS) } /* Re-initialize hardware if it's already running */ - if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) + if (iflib_is_running(sc->ctx)) if_init(ifp, ifp); return (0); diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 62e92be75197..b2c192caaae1 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1187,11 +1187,9 @@ static int ixv_if_promisc_set(if_ctx_t ctx, int flags) { struct ixgbe_softc *sc; - if_t ifp; sc = iflib_get_softc(ctx); - ifp = iflib_get_ifp(ctx); - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (!iflib_is_running(ctx)) return (0); if (ixv_update_xcast_mode(sc, flags) != IXGBE_SUCCESS) return (EOPNOTSUPP); @@ -1306,12 +1304,11 @@ ixv_if_update_admin_status(if_ctx_t ctx) { struct ixgbe_softc *sc = iflib_get_softc(ctx); device_t dev = iflib_get_dev(ctx); - if_t ifp = iflib_get_ifp(ctx); bool check_link, reset_seen; s32 status; uint64_t baudrate; - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || + if (!iflib_is_running(ctx) || atomic_load_acq_32(&sc->vf_mbx_ready) == 0) { if (sc->link_active) { sc->link_active = false; @@ -1391,8 +1388,8 @@ ixv_if_update_admin_status(if_ctx_t ctx) } } - /* iflib clears RUNNING before stop; do not replay after VF reset. */ - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0 && + /* iflib closes admission before stop; do not replay after VF reset. */ + if (iflib_is_running(ctx) && atomic_readandclear_32(&sc->vf_vlan_retry_tick) != 0) ixv_vlan_retry_tick(sc); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 3be4c24421f0..df3bb989b6a0 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -2066,7 +2066,7 @@ void ixl_handle_empr_reset(struct ixl_pf *pf) { struct ixl_vsi *vsi = &pf->vsi; - bool is_up = !!(if_getdrvflags(vsi->ifp) & IFF_DRV_RUNNING); + bool is_up = iflib_is_running(vsi->ctx); ixl_prepare_for_reset(pf, is_up); /*