From nobody Sat Aug 8 00:44:00 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 4hH2MN5xmkz6mZJR for ; Sat, 08 Aug 2026 00:44:00 +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 4hH2MN2c4gz3wLf for ; Sat, 08 Aug 2026 00:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786149840; 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=Ihj0dKSArWiei93zA84M0wDff6gBojivk2lWYsAhF2I=; b=B2BYcVGbI09mwnGhpSq/F6RTHKbOFURi9TiFVOzHPu5zbbsYwrgSrA4/Zf/4H7FVtbNTfO DgoTKktTZIOvx/iH8rzpNIFxMCawz5aSUoTVQAFoviLhDFMug8NKbms8bqSgukXSdnwgU8 vdNZfpv44Hor5rjjR9+4oIiYU2vTtMIocsoO8ay95mzuGcSePU5+Uuw4DFMdPoDz9r+zUV q9P7w7NwWl4mDz4YwEgTBKMpJHvSicp81J6YnZrlSmckW8M+j/88gF185pbydwKoYQRnXO hQGMjl0UWST+NTvBD4tLrlppBe/ODhOHwKebmqW1LsIXTWpiTUjgKfHFB2mlKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786149840; a=rsa-sha256; cv=none; b=QqEerx65UkU9h6PtbV1Xoi0gZ0LVXpt5mia2DFtYlH+amCotH4HcMFuHQeP3kjCvwNRaKJ l68JJwkfXGsN3cEVSUCcbpMW/5pB2KKjeUEmiBTLKau0/Po2W7NKui7mbAEDN9a8KrydAz IvYJW7FQIa6LVkncgmDzgalZLHGPfLDySw0P2YT9eU6PmVWpXF6bEV36OylwTSckjoMBvB X2l4Da5yfDn79qaC+s4UsggEwo0e4FeX0MTjeX61y3Y0OEMwpTYpgVIjKAcYE6TP/jFVhX BBKvcFLgI2iLqUZkF0hDr5Q6tHQQiQZrJKRX5b3tKvxspDHbBf3i7iK+DrllmQ== 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=1786149840; 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=Ihj0dKSArWiei93zA84M0wDff6gBojivk2lWYsAhF2I=; b=N8nrqACrN/UzT8y5HPWwnkVcdmQSDA6DKOyxUDg4xi2na23xHLGfDeVsnn8NXtHlu7d8Nv Dd/7pkXLl0SUC18JFqn2sR5//8CPU/iYU2F0zwFr5LVXIltnpR79S1nIbja1ys4qx+4mRa 2i0KoksvV6UOxiHmHCTBqSDZkv8BfYd4NV5YTXklYyGJK+Aq0TqBGyohzQsv4EpojAZKVi vlp0OCYl3wMcNKRTYVfbO54JITiJZCnFfLj6fCT5s+rwV4PenSXFXwJYUBX/uS1kH35Mz+ E5DtgkU6azrnJOU1ZrmGlKovYrDXQB2FJ8FNIuJ9l5DWKQJq2N9qDV3gcFp8xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hH2MN0rwRzwK for ; Sat, 08 Aug 2026 00:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fce2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 00:44:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f8eea82a0b97 - stable/14 - ixgbe: isolate VF reset state 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: f8eea82a0b97aec6c6d3b603772f9cc6b3e69abc Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 00:44:00 +0000 Message-Id: <6a767bd0.3fce2.3649fde0@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f8eea82a0b97aec6c6d3b603772f9cc6b3e69abc commit f8eea82a0b97aec6c6d3b603772f9cc6b3e69abc Author: Kevin Bowling AuthorDate: 2026-07-28 09:21:47 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 00:40:19 +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. (cherry picked from commit 4b67335676b09249c8ef5ea5508655c0b5733618) --- 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 bff022585a03..c836ccebff0c 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);