From nobody Fri Jul 31 10:38:01 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 4hBMwZ6pXmz6n02W for ; Fri, 31 Jul 2026 10:38:06 +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 4hBMwZ6CXnz41gj for ; Fri, 31 Jul 2026 10:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785494286; 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=l+u8gMC6CfXKHos+BzKW0ooJiP1fjAEDXoc/JqkW4c0=; b=SWsP6T+r5V2ukyxrMXScoWMLLm+JZutAC3xQOG8Rk4DnXeQOlNnqXQGxZy3iJfvBCq1OhL xC0zqqZufRpzIsAOH0Nt+3HNiJRcz+g9LRSOT9qI16XrAthoBJpTWVMeu23/MFIBHu3sev LipLrzYHT3OND7mLkfUBF27e1DWeyfW0ypvPB7XpCG1hf6J3uzV8GErCNCntmHhjU7X4as IlIaQZjut5sw7Zyu3uVmqOMudoC/wKQlfBVWwRNC+0qkKcXnIOqyABA6OJfOzP1RArmJ9a wn+CnvpEm2A67Udyvss/GdGprjUoAw8Yq2k/QOpWLrdYsCSooZpF7CAVXCJ+Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785494286; a=rsa-sha256; cv=none; b=Fjy67OaCB4iZOPPJZuItASP7ecMBICf6OtZNAtgEgzgC7+bTppJdGBi9UA2yUMm/Xy9jeA 1yKP48wlCVtkTG64MjxqKamnV+V7QEbEojsbYkI2z1RlCspZxFbfK1/DyoBRWKJ1juLbu6 ZnU6nSTICYWK5fNLSGSH++k9DIAbx1Y1S6HYBwEATsF5sKs/tI8unyxNRGYLZ0Aks5GPJT pucK2mk5QDZNVThkE9CtMaCg98BlIDo/SdHQWjLaAGKUze2ghlOKjJ0KNPfRobVVVrTq9N dP26JvltdsX68QMi1YreqEOMzAt1vYlWSoS0qNrs4pSy9eU3KDpECl43iFPjAw== 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=1785494286; 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=l+u8gMC6CfXKHos+BzKW0ooJiP1fjAEDXoc/JqkW4c0=; b=MHKMpGQF/D2pi0vOBIag6LdzO7deasNn9cbOmvCyH+K8fxwW5X1SGeqEeGs2x6Fju8RRFC kDZcvd4EDys7BI0YNPXP+1DwK99tI5ZzE3M4SZRtu7c+nPSInwYcd/A65/YhnXqJvhi+4u ADVO4dMpUws3SE37ZmrKCkGjVjSFo+tF0CjFeHVmwwArI27nn5I5B16k/VKYv9kPQhnLQm RPZ2bh4lubDsLQqP6LKglidiCqQuwQqQhDagYq3UvwHlJ7hZYvFGpJ/7yvjxSxK1nYAE7k SKZq4hddhlwB4PXHdsebvkRCjpDptZAoKfpmqwggKqIWDgZ3EqLAU6sOJ5YV+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBMwZ52bQzwYn for ; Fri, 31 Jul 2026 10:38:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38e35 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 10:38:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 409601911b32 - main - ixgbe: respect peer mailbox ownership 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: 409601911b327426a34a6f28b31fdd5d95d1d275 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 10:38:01 +0000 Message-Id: <6a6c7b09.38e35.74d0c6e6@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=409601911b327426a34a6f28b31fdd5d95d1d275 commit 409601911b327426a34a6f28b31fdd5d95d1d275 Author: Kevin Bowling AuthorDate: 2026-07-28 09:27:24 +0000 Commit: Kevin Bowling CommitDate: 2026-07-31 10:25:36 +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 MFC after: 1 week --- 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;