From nobody Fri Jul 31 09:49:03 2026 X-Original-To: dev-commits-src-all@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 4hBLr51Qbqz6mtgF for ; Fri, 31 Jul 2026 09:49:09 +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 4hBLr45wLbz3wDm for ; Fri, 31 Jul 2026 09:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785491348; 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=tCYTqs9GP1CqptN0QLEMRWj5jcAmzAnrqLi+/kJ1KPqrAjK88aFBNxIWRkwIt+w4EI/yeB av2/R0ShzYnsjGhmVM7EzKDHc/PLBzHfeYPs/cxkiT9bm4lBFyWSuFD1fmo45xKVoc86ME kh/JEHRWUdVlbrmnBLKlQk2bcqzvu9WFS5rOUup/BqkrZoE8IZSRyCUPtTg1VdzKqw8IH7 Hk+XAcXoq/AKBoH+1AH/kvyKNoV4yK0PZZLTrmktElKkkA/72fmkF89K8WN7LhWC4kcAVt s2DzZWXsMqcdDpQVZTmkP/a36uWPkRyEYMsxwdhtGQvIUNsngzNH686Yg6Ucsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785491348; a=rsa-sha256; cv=none; b=F8jjJlWTEKGTMD8kREbbpS1eFLLZkam84JkBq/zLVQvGiBgH7I2ilAgP+0w5wYRLVCd6E1 IsJ7NiaXebid2KUGZFEpkq14rvGPqbYMueV/1G75rXN9IKpKwTqs15Aa6sVUoKcq/rZ5c7 ithce6Z5KrVjyyqYOyY0fq2D+5PzDgtZxERfUNRCWTV7GVjcw3zHUBCPaNIMZLChD5jLen R7QG5X6nV29RzuvJAVl6szYrRCbFG309PT5FLy5n0GpOcn1zqdOMn3TqbiGzti6FZSkvxh dVnZwWnn7jybi/EqPw1hpX6t7i30wtNPg+TYmXtnrUvthL22tBq7jc/Fekr2HQ== 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=1785491348; 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=WPzpxQGm7RIz+45qstiMLph44MQWscTVeboUs+GTl4WcYy8YEv6FiWBjRLpum5ol5/hoCq VaxMWQuu4unnVmVRL8T71ucLaEFellyZDbn+j8lYwOaedPFGH2nupVgLc5yNjw9khUNQPB +tjSM+qeTFqT/fo4izSfhFFvj6bV2QFrQoGnxpaRvW1L+cbSHC3qAwsS0zDe1s3+EfO7Wo FE1PARuMYKhcwb7nu+oTJxZTmJ/qGvS3tWncckya8+ZFteWlk8fX5EpPcmfDnZjGhKhYPp KlsdqQOrusREU87pQcZ98malgYW3xDAeh62ex5CILFmJ48O6/EqdP/gT0zR5Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBLr43lhwztrk for ; Fri, 31 Jul 2026 09:49:08 +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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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);