From nobody Sat Aug 8 07:12:37 2026 X-Original-To: dev-commits-src-main@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 4hHBzn5LGHz6n9kP for ; Sat, 08 Aug 2026 07:12:37 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hHBzn2vJdz3nmL for ; Sat, 08 Aug 2026 07:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786173157; 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=cPV8Y0kctBwW19DLPjBV4a3Ck/wjauer/yruHXhOblE=; b=BK0MVI9jwz8RsOt3DZdrG4+p2DSuKKdFxKhaMTw1mc8blACAgXXeQgEf+WSmwu+34a7xtA NoS/nAM/bLgrT/HzaGjTGeRVLx2kktJ6rDY561oIVoOTxtGlqEPPfMwSBw1/8lIpEtMBeb WrgqDYMWSoWE9gFAwsmkgjjqVxqK0Wg+CJQivGxvnCosiHzbdkERGCyHh7yuAY3Nv3qacE 4TmI99zjgN+3/HiQ3Richh7NbtzQ8tOnpS5ZzuFNNgOvHR4wkFfLZEuiNaGg/b9F+jWmLv uGM2BPlXnni+QXEi9Dr2bXb6ZYVJUFMiYKowfjFgFsJoyVM62qrIJA3EFkKSmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786173157; a=rsa-sha256; cv=none; b=dQis9hgKYLjuWmzLnNzdFJYeoHJHD36NzUZGNlzZ6kHYxj5g0MIVlb2v6nqFnYpJOE+xbC fyW4Tn6g2E0bfjBijQnmhZusz8/p8MpXZI94xCmcbIxPDQKpgZCNDnxcqwOyHqPLAaKwxO X7ef0klx029WsucCnTHxYbBXrbuV7jqjIgAX1x39flDzYchaD0lLoMdrM8pLj1soxw912a lzK/oxw+4dUbJMwZeVTJfRY31sUKzTS1WcUjntU/m26oHcPeahAhGh/5TLU8zD4phwvOy4 dC2o1Cd7OpeitYM/88nRtpzD2gbsW9MWRr3rIxKdcr1vOXy2PxmbjesfpDmqkQ== 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=1786173157; 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=cPV8Y0kctBwW19DLPjBV4a3Ck/wjauer/yruHXhOblE=; b=WZq3qYmaQ+MZPIUXGMM9exgXuNwXOTsc/iZDTm6vo8Mn0clAKjg3YOdN2YEBm3cNh/y1dQ aaW0hr7y7p/JYISrlXxyMVUcl6UGvQAxOOzadOyIxyHWtQwYVpNoF8+OR2saSEQWGWvRKy orXKUwZOQquUgorqmGz74uH3m9JUPovMJapkRwzBC0D/l7MYiv3SrsDwq7ToNza2v8zKLP zYKwOyl0v7uv1D//XL3L+XIUW8QrVg3Ws3rdgx5at58BuxuM7hI6vxMSSktQTaMQfi4bvc D5uPPF1EBzU3iuBEpnYmObW4zT2VFIZYxoaxQHuRXQExuXnySc3aw/KkSp/ynw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHBzn1TDMzCYh for ; Sat, 08 Aug 2026 07:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4121a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 07:12:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5017a241b987 - main - ixgbe: Drain events for inactive VFs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5017a241b987d365beb2c35faf0017b6afef2b64 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 07:12:37 +0000 Message-Id: <6a76d6e5.4121a.37cf76db@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5017a241b987d365beb2c35faf0017b6afef2b64 commit 5017a241b987d365beb2c35faf0017b6afef2b64 Author: Kevin Bowling AuthorDate: 2026-08-06 06:42:55 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 07:11:57 +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. MFC after: 2 weeks --- 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);