From nobody Fri Jul 31 10:38:01 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 4hBMwV3wR9z6myqv for ; Fri, 31 Jul 2026 10:38:02 +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 4hBMwV1HMqz41jd for ; Fri, 31 Jul 2026 10:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785494282; 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=ZxxLR4ONv3BzfHuaBYNMP+hBY/FlHIBMIKE9aowJmA7HdpWgb6g662blFKQlda/ToHDESw U0chtd36AXayrobkAci8Hn0MWgOBsYE6Q6/yTL5O2XboJXC8hTOCfi8AwdfWV8u1OLoqYd TGVjJtIL0bCFnJidJcKYGK1RxTV0fL4+51Vsur+brGFi5E7omc8DOMlFKKxxZIhmVSxNcM +5s9v0z7R+M2DWwUa+71A5QIe5dN5JedEBAnXHynyJ1o9Q8ea+NjdM0nVLBnkwMePDSMbl mB+vFqJgMRL8Ym4mMse3XdvGjScnQA/Pih7Tp6kJ3v7mXEm5MDfAHcNPMReXHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785494282; a=rsa-sha256; cv=none; b=ovivGbPcwjRK4UQ2qmMhDpJ39raM+BBWguAfclaroEbDOdlt25qI2pvmN89E84ytf4nAhP 3ekLep0647cc4wKH52iSTem3P6cxglowHWHrGMumVNXMEOErV0CuC6GFNpqxCwSFto0z9I gKUv634CenS/norkBlsRbibRcaYRp3ATPrLEgvCiUAzBh4uFMvAKomC7xqj+XpUgUxnT6e /dz0tGHEDOuhDYLEGoolpfl5dwR2w4zIHLL8Ot8E6CYLZSzE50TjilrIDXnan5OzkTv0t0 sUMNxBUX2rKByiUaCOO9VkQ09TKzwb8f3GOe8ASRgJ/N6B5NyFT5EVS0VDU56g== 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=1785494282; 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=AI4h8G5AZs28eW9iUi8pxFkguAZL7a+TKhTho4XcKaAEHLBxJA/Cw8c+2TucgGfvzRTgUr MjqlES4Rfhb1OJKnNeUGw3WjOo8RDlWQ+oAxdgt/HqaT+ci2uCqDmapzO6UiH2lrB/3DLJ fncK9job3QZniJHeS4uvf/RXCnrLGCq9D+k1/+KOYa54gmVp1L465f0iMnlNtnYAVwtgCG Uc+CL7wMMCqlf6kcCt6xFQ83t0Yw3aFEqQbg1DLHCF/xrctCJ63xGIfIM4jNYyyZ7p9DG+ 3Zgo7vQ+BLsFs4RqclEvV9K4RcARjhcCX/1zcsTiu3+TTwoOY5q0Si7W7mALaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBMwT6vLWzwBm for ; Fri, 31 Jul 2026 10:38:01 +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 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: 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;