From f82ed0d5e131a36c33e5f14a000b6ff651b572a5 Mon Sep 17 00:00:00 2001 From: Carsten Beckmann Date: Wed, 23 Sep 2026 15:45:23 +0200 Subject: [PATCH 7/8] iavf: rework admin queue interrupt Currently the admin queue interrupt detects VF resets by checking if the ICR register contains 0xdeadbeef. This works for NICs of the Intel 700 series, but for an Intel E810-C (and presumably all other NICs of the 800 series) this register always contains 0xdeadbeef even during normal operation, so it always triggers resets. Use one of the admin queue registers instead which should work for both the 700 and 800 series. This means we also can't check the bits of the ICR register, though this should not be a problem. Both iavf_atq_done and iavf_process_arq can just always be called. I am assuming the iavf_rxeof and iavf_txeof parts are a leftover from the driver being based on ixl. The Linux sources indicate that vector 0 can not be used for traffic, so we can just remove this part. --- sys/dev/pci/if_iavf.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/sys/dev/pci/if_iavf.c b/sys/dev/pci/if_iavf.c index c484cc68c61..4e1a1baef9e 100644 --- a/sys/dev/pci/if_iavf.c +++ b/sys/dev/pci/if_iavf.c @@ -2574,35 +2574,24 @@ static int iavf_intr(void *xsc) { struct iavf_softc *sc = xsc; - struct ifnet *ifp = &sc->sc_ac.ac_if; - uint32_t icr, ena; - int i, rv = 0; + uint32_t icr, ena, arq_len; ena = iavf_rd(sc, I40E_VFINT_ICR0_ENA1); iavf_intr_enable(sc); icr = iavf_rd(sc, I40E_VFINT_ICR01); + arq_len = iavf_rd(sc, sc->sc_aq_regs->arq_len); - if (icr == IAVF_REG_VFR) { + if (arq_len == IAVF_REG_VFR) { printf("%s: VF reset in progress\n", DEVNAME(sc)); sc->sc_resetting = 1; task_add(systq, &sc->sc_reset_task); return (1); } - if (ISSET(icr, I40E_VFINT_ICR01_ADMINQ_MASK)) { - iavf_atq_done(sc); - iavf_process_arq(sc); - rv = 1; - } + iavf_atq_done(sc); + iavf_process_arq(sc); - if (ISSET(icr, I40E_VFINT_ICR01_QUEUE_0_MASK)) { - for (i = 0; i < iavf_nqueues(sc); i++) { - rv |= iavf_rxeof(sc, ifp->if_iqs[i]); - rv |= iavf_txeof(sc, ifp->if_ifqs[i]); - } - } - - return (rv); + return (1); } static void -- 2.53.0