From nobody Sat Aug 22 00:47:06 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 4hRdmW61Pqz6prP0 for ; Sat, 22 Aug 2026 00:47:07 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hRdmV3YSBz3LW0 for ; Sat, 22 Aug 2026 00:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787359627; 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=K9xigkBSZvCPMNhI96mdL0JcuDqcZsph2qGEyqD2ZEg=; b=Dx2OakhVUzgJtvuYlkfoup0tiGs/uH/livkYc6v1UoKHUxJZD3lx2uT1CQJgOWAYx8T8Wt bpOsShtpX18tIj0KV8fIgafDdsukVduKC4Y/cDKpLwl5CbQ5M0Ea4MsyiYktB7Hzl46R4L kYtFka26uDJZoDIFAjltF5bg7PSDmi1qwntdtBJtLWTITEsDzLpc/mq+e9zznbvJgRZoAe C+HUQpUJG3gxcQmwOu5XEWYUvXxh2nJ1u0l3CW4C9cjnt6P/uqUjFIm3sy3fPezYq5vmr9 ttW4J98jxre0np8HwBFi0VGOmkMUwlESlIEKgSdxij+4wGoWiDrpHFpwXN3MxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787359626; a=rsa-sha256; cv=none; b=qQLxIsDU5y3Fr2Vm/PAKHKREtgVNmafyh/Dr6UQtBaJvEjhLeh+W9BJTR+yRViGmHCDQiT yOWXiHytPsPI1zesnhwenRIXl7X50jOXnqkgq3+p/Ayd25UJBKD0RT5jfGFL4H+qfxBDbc pB0vdZ10Nf3CiPT108cq3ieL0vKsgEZ7yAfL03UMWuxPFUPbiRX7VvHG6o2x8qpHn3HDo5 VpioW5XqTbV4Mfk+MNMerfCnkJhzP5yy7/ndvNxjWZYZQg3UXYb+9/8NzxE5vhIuWuZGpj /Hzy1pwToRJ/BH54mU8VYgQYRVps8w5MvnVb4sMwqkInA3BLra+ENEz6qk40vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787359626; 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=K9xigkBSZvCPMNhI96mdL0JcuDqcZsph2qGEyqD2ZEg=; b=B+2e5I0PCaVFfcofLjtaHoypTjtuNI6nV4ZJpxAGa6JMv2Mt3fsQ6LtiiEWVkRKLucSVM8 KgZMHk/ZeObUuh1o+l1lkzE6lzaHinpP/7ed9CP7ExkPB4b/M6okffY/x8fj9fU0ewSb4D iZVyF3IDLAACv8owefwXnmY3fkPpQlATLgdYNZsPCCBTGtuKvuT0k2wOwaV5nd2FM7ojco OiAQwuElz5n5TvntB5cPxugyEJrnC74q0CzdWaZUBFJYV8yfRTVO1i9qLkOMvzzeY+JSwD Gof83BhQ1Lnd2uKW6FNBlvwRgpNyt2RkVDBt/O/WvH+PvQYCXP5ZYNVGYQ7j7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRdmV1lH8z9y7 for ; Sat, 22 Aug 2026 00:47:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 240ec by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:47:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f74b20db1354 - stable/14 - ixgbe: Drain events for inactive VFs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: 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/14 X-Git-Reftype: branch X-Git-Commit: f74b20db135499e1e419274cb0af155df5c075b3 Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:47:06 +0000 Message-Id: <6a88f18a.240ec.1664c967@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f74b20db135499e1e419274cb0af155df5c075b3 commit f74b20db135499e1e419274cb0af155df5c075b3 Author: Kevin Bowling AuthorDate: 2026-08-06 06:42:55 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:43:20 +0000 ixgbe: Drain events for inactive VFs The aggregate VF mailbox poll includes only VFs whose driver configuration completed. A configured VF slot whose vf_add callback failed can nevertheless report reset, request, or acknowledgement events. Because the mailbox handler skips inactive entries, such an event remains latched and can retrigger administrative work indefinitely. Build the poll masks from every configured VF index and consume reset, message, and acknowledgement events for inactive entries without treating them as usable VFs. Use the index rather than the pool because early vf_add errors precede pool initialization. Also include E610 PFVFLREC in aggregate reset sampling. (cherry picked from commit 5017a241b987d365beb2c35faf0017b6afef2b64) --- sys/dev/ixgbe/if_sriov.c | 119 ++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 8611f2685611..ff873d4652f8 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -1560,51 +1560,54 @@ ixgbe_handle_mbx(void *context) for (i = 0; i < sc->num_vfs; i++) { vf = &sc->vfs[i]; mbx_activity = false; + reset_seen = hw->mbx.ops[i].check_for_rst(hw, i) == 0; - if (vf->flags & IXGBE_VF_ACTIVE) { - reset_seen = hw->mbx.ops[vf->pool].check_for_rst(hw, - vf->pool) == 0; - if (reset_seen) { - /* A reset does not prove recovery succeeded. */ - recovering = (vf->flags & - IXGBE_VF_DMA_ABORT_PENDING) != 0; - vf->flags |= IXGBE_VF_MBX_CLEANUP; - vf->mbx_cleanup_deadline = getsbinuptime() + - IXGBE_VF_MBX_CLEANUP_GRACE; - ixgbe_process_vf_reset(sc, vf); - if (!recovering) { - vf->flags &= ~(IXGBE_VF_DMA_ABORT_PENDING | - IXGBE_VF_PCI_STATE_SAVED); - vf->pci_saved_command = 0; - } - } - reset_pending = - (vf->flags & IXGBE_VF_MBX_CLEANUP) != 0; - - if (hw->mbx.ops[vf->pool].check_for_msg(hw, - vf->pool) == 0) { - mbx_activity = true; - if (ixgbe_process_vf_msg(ctx, vf, reset_pending)) - vf->flags &= ~IXGBE_VF_MBX_CLEANUP; - } - if (reset_pending && - (vf->flags & IXGBE_VF_MBX_CLEANUP) != 0) - ixgbe_cleanup_vf_mbx(sc, vf); - - if (hw->mbx.ops[vf->pool].check_for_ack(hw, - vf->pool) == 0) { - mbx_activity = true; - ixgbe_process_vf_ack(sc, vf); + if (!(vf->flags & IXGBE_VF_ACTIVE)) { + if (hw->mbx.ops[i].check_for_msg(hw, i) == 0 || + reset_seen) + ixgbe_clear_mbx(hw, i); + (void)hw->mbx.ops[i].check_for_ack(hw, i); + continue; + } + + if (reset_seen) { + /* A reset does not prove recovery succeeded. */ + recovering = (vf->flags & + IXGBE_VF_DMA_ABORT_PENDING) != 0; + vf->flags |= IXGBE_VF_MBX_CLEANUP; + vf->mbx_cleanup_deadline = getsbinuptime() + + IXGBE_VF_MBX_CLEANUP_GRACE; + ixgbe_process_vf_reset(sc, vf); + if (!recovering) { + vf->flags &= ~(IXGBE_VF_DMA_ABORT_PENDING | + IXGBE_VF_PCI_STATE_SAVED); + vf->pci_saved_command = 0; } + } + reset_pending = (vf->flags & IXGBE_VF_MBX_CLEANUP) != 0; - /* Do not overwrite a response from this mailbox pass. */ - if (!mbx_activity && - (vf->flags & IXGBE_VF_MDD_NOTIFY_PENDING) != 0) - ixgbe_notify_vf_mdd_reset(sc, vf); + if (hw->mbx.ops[vf->pool].check_for_msg(hw, + vf->pool) == 0) { + mbx_activity = true; + if (ixgbe_process_vf_msg(ctx, vf, reset_pending)) + vf->flags &= ~IXGBE_VF_MBX_CLEANUP; + } + if (reset_pending && + (vf->flags & IXGBE_VF_MBX_CLEANUP) != 0) + ixgbe_cleanup_vf_mbx(sc, vf); - if (vf->flags & IXGBE_VF_MBX_CLEANUP) - cleanup_pending = true; + if (hw->mbx.ops[vf->pool].check_for_ack(hw, vf->pool) == 0) { + mbx_activity = true; + ixgbe_process_vf_ack(sc, vf); } + + /* Do not overwrite a response produced by this mailbox pass. */ + if (!mbx_activity && + (vf->flags & IXGBE_VF_MDD_NOTIFY_PENDING) != 0) + ixgbe_notify_vf_mdd_reset(sc, vf); + + if (vf->flags & IXGBE_VF_MBX_CLEANUP) + cleanup_pending = true; } sc->iov_mbx_cleanup_pending = cleanup_pending; } /* ixgbe_handle_mbx */ @@ -1620,41 +1623,38 @@ bool ixgbe_mbx_pending(struct ixgbe_softc *sc) { struct ixgbe_hw *hw; - uint32_t active_mbx[4], active_rst[2], events, vf_mdd[2]; + uint32_t events, vf_mbx[4], vf_mdd[2], vf_rst[2]; int i, index; if (sc->num_vfs == 0) return (false); - bzero(active_mbx, sizeof(active_mbx)); - bzero(active_rst, sizeof(active_rst)); + bzero(vf_mbx, sizeof(vf_mbx)); bzero(vf_mdd, sizeof(vf_mdd)); + bzero(vf_rst, sizeof(vf_rst)); for (i = 0; i < sc->num_vfs; i++) { - if ((sc->vfs[i].flags & IXGBE_VF_ACTIVE) == 0) - continue; if ((sc->vfs[i].flags & IXGBE_VF_MDD_NOTIFY_PENDING) != 0) return (true); - index = IXGBE_PFMBICR_INDEX(sc->vfs[i].pool); - active_mbx[index] |= + index = IXGBE_PFMBICR_INDEX(i); + vf_mbx[index] |= IXGBE_PFMBICR_VFREQ_VF1 << - IXGBE_PFMBICR_SHIFT(sc->vfs[i].pool); - active_mbx[index] |= + IXGBE_PFMBICR_SHIFT(i); + vf_mbx[index] |= IXGBE_PFMBICR_VFACK_VF1 << - IXGBE_PFMBICR_SHIFT(sc->vfs[i].pool); - index = IXGBE_PFVFLRE_INDEX(sc->vfs[i].pool); - active_rst[index] |= - 1U << IXGBE_PFVFLRE_SHIFT(sc->vfs[i].pool); + IXGBE_PFMBICR_SHIFT(i); + index = IXGBE_PFVFLRE_INDEX(i); + vf_rst[index] |= 1U << IXGBE_PFVFLRE_SHIFT(i); } hw = &sc->hw; - for (index = 0; index < nitems(active_mbx); index++) { - if (active_mbx[index] != 0 && + for (index = 0; index < nitems(vf_mbx); index++) { + if (vf_mbx[index] != 0 && (IXGBE_READ_REG(hw, IXGBE_PFMBICR(index)) & - active_mbx[index]) != 0) + vf_mbx[index]) != 0) return (true); } - for (index = 0; index < nitems(active_rst); index++) { - if (active_rst[index] == 0) + for (index = 0; index < nitems(vf_rst); index++) { + if (vf_rst[index] == 0) continue; switch (hw->mac.type) { case ixgbe_mac_82599EB: @@ -1664,12 +1664,13 @@ ixgbe_mbx_pending(struct ixgbe_softc *sc) case ixgbe_mac_X550: case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: + case ixgbe_mac_E610: events = IXGBE_READ_REG(hw, IXGBE_PFVFLREC(index)); break; default: return (false); } - if ((events & active_rst[index]) != 0) + if ((events & vf_rst[index]) != 0) return (true); } ixgbe_mdd_event(hw, vf_mdd);