From nobody Sat Aug 8 00:44:01 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 4hH2MP6Kxtz6mZM6 for ; Sat, 08 Aug 2026 00:44:01 +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 4hH2MP2SzDz3whl for ; Sat, 08 Aug 2026 00:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786149841; 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=rcZudvLX6Jyk/7D2yc+IHDcBPv9j16jDjzZ3QubHDXM=; b=MVkIflRXGl2/bDV1pKq+5rhWfPCQ+36N+lBZFMqmVobbyLPKCf2wlqwZWQBv/M2077lMmf 0NvjIUYzDj4JFdSmtzMWUL1fNcGG6rFsXNT2PwupXQPCR411bGDY4og+5thJTYckfz3Wwb tBqjrUYTjwPVD+4UQbJLYqfwwrD63ftVVLDuzQzDmPSsFL2GxnzsI2gOJGF3dQ8POhLHg7 SUdIk6haSZVqlSc+eZcZN3kJQlaG+YjQqviq778+xFMq9L8/sJtjMdrJW413tcFGSgFhvI rMy7TBfkAK1vhSVmahXJCEsNPNU0cy8cu3XdiUBVroAYUnOy4HNwIdpQykX2pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786149841; a=rsa-sha256; cv=none; b=K/8yKgxogsxYq7JMvy9EZ+rYWL0JVR9gWgtnoQuvpcGqoh0wbDCV7iPAm7xRVpQWzO1eg6 9ZPzfMFggbJMdU5PYzOvPhSopKQiL9Ir3MsEVk3TkISV+/LnXY6xsVxc0lbpBeqoeMuCPP 7l28a35Nz6WLSlq8OSlPsKyVMLUqmW6kV3UXLjIA+CS/kSzxpGXrhDHhoYx/gti0k2j+Rf +C3bjK2tsBE4PopIl8hOXasMR/FFXuFKXPCyLVCTSZMR6yFo5CRx9uSswtNU9Ymq8uelAM xixnGTR8G9QiGj9OTF7CJ1LROD34F5fpAlpioFp93tVE2revq0E6nl9N2+UP9Q== 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=1786149841; 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=rcZudvLX6Jyk/7D2yc+IHDcBPv9j16jDjzZ3QubHDXM=; b=qAYTbvTa4dVJcju+eFWJal+xSeFqr+xqTqCqskpZIqbPMPV2hec/5kRurQWbMn8O7Cof5F WIl8ZehyApeY/hGTmhfREgmOwINq7kNZGPp+HjgWU8GJjK0Zpol8yekKP9L7TOO+spab5r uQS7B/FUG1RHrNhsJis4dpm8rx7/opr7izhN4VyX4piX84U8GtXhiU+wqnnglFJ/hz9P/q ByiiK6+54vygDgwcxQ7ijK9FbYxZeFcch8cBlu3ZwK/DO6Q/Gppr2hUdxCkxJR+UuszdFh KVweRnsA2EeK4/QHaC3A0rGQB+qM4Gf5er74LtqxiK+zceKTDmGuZl9cKNJKRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hH2MP1VM8z187 for ; Sat, 08 Aug 2026 00:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 402fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 00:44:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5b61d1c82f38 - stable/14 - ixgbe: respect peer mailbox ownership 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: 5b61d1c82f38ff31b2940f54f6b0ee946b125302 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 00:44:01 +0000 Message-Id: <6a767bd1.402fc.432fd8d3@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5b61d1c82f38ff31b2940f54f6b0ee946b125302 commit 5b61d1c82f38ff31b2940f54f6b0ee946b125302 Author: Kevin Bowling AuthorDate: 2026-07-28 09:27:24 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 00:40:31 +0000 ixgbe: respect peer mailbox ownership A VF currently treats an existing VFU bit as a successful acquisition, while the PF checks its own PFU bit before claiming the mailbox. Check both the local and peer ownership bits before setting local ownership. This prevents same-side callers from sharing the mailbox and avoids an acquisition attempt while the peer owns it. VFLR does not clear VFMAILBOX.VFU. Clear stale VF ownership and cached mailbox status after the reset indication settles and before sending the reset request, so the ownership check cannot strand a reinitialized VF. Adapt only the live ownership checks from Intel ix 3.4.39. Do not import its upgraded-mailbox changes, which are not active in FreeBSD. Obtained from: Intel ix 3.4.39 (cherry picked from commit 409601911b327426a34a6f28b31fdd5d95d1d275) --- sys/dev/ixgbe/ixgbe_mbx.c | 10 ++++++++-- sys/dev/ixgbe/ixgbe_vf.c | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 7f58a9202c9e..eef30733b7b2 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -436,6 +436,11 @@ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) while (countdown--) { /* Reserve mailbox for VF use */ vf_mailbox = ixgbe_read_mailbox_vf(hw); + + /* Check if the mailbox is already owned by the VF or PF */ + if (vf_mailbox & (IXGBE_VFMAILBOX_VFU | IXGBE_VFMAILBOX_PFU)) + goto retry; + vf_mailbox |= IXGBE_VFMAILBOX_VFU; IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, vf_mailbox); @@ -445,6 +450,7 @@ static s32 ixgbe_obtain_mbx_lock_vf(struct ixgbe_hw *hw) break; } + retry: /* Wait a bit before trying again */ usec_delay(mbx->usec_delay); } @@ -870,8 +876,8 @@ static s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id) /* Reserve mailbox for PF use */ pf_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_id)); - /* Check if other thread holds the PF lock already */ - if (pf_mailbox & IXGBE_PFMAILBOX_PFU) + /* Check if the mailbox is already owned by the PF or VF */ + if (pf_mailbox & (IXGBE_PFMAILBOX_PFU | IXGBE_PFMAILBOX_VFU)) goto retry; pf_mailbox |= IXGBE_PFMAILBOX_PFU; diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 4e48f7f33c9d..89bf5929260d 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -209,6 +209,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) /* Reset VF registers to initial values */ ixgbe_virt_clr_reg(hw); + /* + * VFLR does not clear VFMAILBOX.VFU. Drop stale ownership and + * cached read-to-clear status. + */ + IXGBE_WRITE_REG(hw, IXGBE_VFMAILBOX, 0); + hw->mbx.vf_mailbox = 0; + /* mailbox timeout can now become active */ mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT;