From nobody Fri Jul 31 09:49:03 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 4hBLqz4Ks6z6mtYC for ; Fri, 31 Jul 2026 09:49:03 +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 4hBLqz3fJSz3w7h for ; Fri, 31 Jul 2026 09:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785491343; 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=3bnM2wisYJqAsjunaUhV+7Bh6Ea5PR69t2sgZyDRHvs=; b=dREHeM1aM4UwcAK6acSKCMFwDAQadctbCxmb7/vtArgRQQMkAw/z92SGXr7oiGkCWMacaM l5PQCll2rlg3T45Z6J1ZZn2fT/7IOnPl5p7YkRwpPsQsKr+i+jyTg4P/OBG/HWfag4R5Ar aSPII0TKTnEd4FlfdUTR8TcBU33fFK0b80umyrMLNcZkavxKgsm+A9+MVhyvxYhlMj+nFS 2v2Z0SUOGPEwJ3MBSfU9XWzzg4+BhM3alR3ig8vstjy1JuGCvp8niEE/yCPJ+OfcZvB8Jt DCDCTx0GQalEig1nFBvk9WGoAJTbPT66JqNgysZi4I3KOK8DR0P3j0buM7N7cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785491343; a=rsa-sha256; cv=none; b=sZCKrfZMEMpPEi620gBRx6FTIhICjen9gAzJmxVQh9OWosKkBi0YfwMrTSWc3xN4hyWlv5 Qe/NG2V9i5U6Pj+fBzvvzgtnW+xNE6PPbP90YyNjESeJY5tr54jZ0gXd5cfiC/Y2axu+x3 JQvDm7gMD46ToUHBZOy+DSkuBE9BHeipPdbONyKAr4bl93+ws+fncpXWCyitTFrinwM9Ps fMdOtmcrAme+nSoM7K/YHr+o1PbzaID+KFKqgfVBW2HaoRiM5yYfyUp7DCjg4gvgIfN6OZ 47EYAepJfXxoGakxp8VqJq2WBbMNfvJsepFIpkOKW4a3VCVyJKQA6lQng2RDIA== 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=1785491343; 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=3bnM2wisYJqAsjunaUhV+7Bh6Ea5PR69t2sgZyDRHvs=; b=t5CQGP3VqtuzT3AjUZtM/Ex4xmYj2mRjiP6kOQ6TOfq0p0V0zD5DjD3J5fZzcLQIrqsMfv hL2N4ffpjDtdr4YwviRmydCSikrGrZDb5ce4RQoJNao3Pfby8l/DcHTwM95jsIPiAxzVwo 7UQOaAQ5zUbLKs3tBIELOZvx+lXQtibsasEhHt9fo4qgO9yYDNijPyKmkrnmxsKxa/ue+f cZvNvVPh+nj+qTNmwA7WUrvl1U+7A/JO+Ed1bz11pixsDj7/WI+3O3UMA8qOG8DFGK0Alx 9p0370gkpf+qSKKkw0toenFimhsAN+tKHzGUzunA+SZ/kDJa1z9ZtwSPBlW0dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBLqz2Ly1zv8Y for ; Fri, 31 Jul 2026 09:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33004 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 09:49:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 4b67335676b0 - main - ixgbe: isolate VF reset state 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: 4b67335676b09249c8ef5ea5508655c0b5733618 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 09:49:03 +0000 Message-Id: <6a6c6f8f.33004.1ff74b17@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=4b67335676b09249c8ef5ea5508655c0b5733618 commit 4b67335676b09249c8ef5ea5508655c0b5733618 Author: Kevin Bowling AuthorDate: 2026-07-28 09:21:47 +0000 Commit: Kevin Bowling CommitDate: 2026-07-31 09:48:46 +0000 ixgbe: isolate VF reset state IXGBE_VF_INDEX() selects a 32-VF register bank. PFMBMEM() selects one mailbox per VF, while ixgbe_toggle_txdctl() calculates queue offsets from a VF number. Passing the bank index aliases VF1-31 to VF0 and VF32-63 to VF1. Resetting one VF can therefore clear the peer mailbox and leave its transmit queues disabled. The VF raises its reset event before posting its mailbox request. The PF checks reset events before mailbox messages. If both are pending, clearing PFMBMEM during generic reset handling can erase the request before ixgbe_read_mbx() consumes it. Clear the mailbox only from the reset-message handler after the request has been read. Use the VF number for queue toggling and document that API contract. MFC after: 1 week --- sys/dev/ixgbe/if_sriov.c | 20 ++++++-------------- sys/dev/ixgbe/ixgbe_api.c | 6 +++--- sys/dev/ixgbe/ixgbe_api.h | 2 +- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_type.h | 2 +- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 47f1a1279e2f..bd27796ebcf3 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -254,18 +254,6 @@ ixgbe_vf_set_default_vlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf->pool), vmvir); } /* ixgbe_vf_set_default_vlan */ -static void -ixgbe_clear_vfmbmem(struct ixgbe_softc *sc, struct ixgbe_vf *vf) -{ - struct ixgbe_hw *hw = &sc->hw; - uint32_t vf_index = IXGBE_VF_INDEX(vf->pool); - uint16_t mbx_size = hw->mbx.size; - uint16_t i; - - for (i = 0; i < mbx_size; ++i) - IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_index), i, 0x0); -} /* ixgbe_clear_vfmbmem */ - static boolean_t ixgbe_vf_frame_size_compatible(struct ixgbe_softc *sc, struct ixgbe_vf *vf) { @@ -320,8 +308,7 @@ ixgbe_process_vf_reset(struct ixgbe_softc *sc, struct ixgbe_vf *vf) // XXX clear multicast addresses ixgbe_clear_rar(&sc->hw, vf->rar_index); - ixgbe_clear_vfmbmem(sc, vf); - ixgbe_toggle_txdctl(&sc->hw, IXGBE_VF_INDEX(vf->pool)); + ixgbe_toggle_txdctl(&sc->hw, vf->pool); vf->api_ver = IXGBE_API_VER_UNKNOWN; } /* ixgbe_process_vf_reset */ @@ -370,6 +357,11 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) hw = &sc->hw; ixgbe_process_vf_reset(sc, vf); + /* + * The reset request was consumed by ixgbe_process_vf_msg(), so it is + * now safe to clear this VF's mailbox. + */ + ixgbe_clear_mbx(hw, vf->pool); if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&sc->hw, vf->rar_index, vf->ether_addr, diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index f11f52a646e4..3794bb2676f6 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1152,14 +1152,14 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, /** * ixgbe_toggle_txdctl - Toggle VF's queues * @hw: pointer to hardware structure - * @vind: VMDq pool index + * @vf_number: VF number * * Enable and disable each queue in VF. */ -s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind) +s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vf_number) { return ixgbe_call_func(hw, hw->mac.ops.toggle_txdctl, (hw, - vind), IXGBE_NOT_IMPLEMENTED); + vf_number), IXGBE_NOT_IMPLEMENTED); } /** diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index 2b4cec8d110e..4a9d89255257 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -132,7 +132,7 @@ s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, u32 *vfta_delta, u32 vfta, bool vlvf_bypass); -s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vind); +s32 ixgbe_toggle_txdctl(struct ixgbe_hw *hw, u32 vf_number); s32 ixgbe_fc_enable(struct ixgbe_hw *hw); s32 ixgbe_setup_fc(struct ixgbe_hw *hw); s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build, diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 9e827d2e5473..a8676c731711 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4153,7 +4153,7 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw) /** * ixgbe_toggle_txdctl_generic - Toggle VF's queues * @hw: pointer to hardware structure - * @vf_number: VF index + * @vf_number: VF number * * Enable and disable each queue in VF. */ diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 0bbe7806d41d..4e242b7189cb 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -4105,7 +4105,7 @@ struct ixgbe_mac_operations { s32 (*init_uta_tables)(struct ixgbe_hw *); void (*set_mac_anti_spoofing)(struct ixgbe_hw *, bool, int); void (*set_vlan_anti_spoofing)(struct ixgbe_hw *, bool, int); - s32 (*toggle_txdctl)(struct ixgbe_hw *hw, u32 vf_index); + s32 (*toggle_txdctl)(struct ixgbe_hw *hw, u32 vf_number); s32 (*update_xcast_mode)(struct ixgbe_hw *, int); s32 (*set_rlpml)(struct ixgbe_hw *, u16);