From nobody Sat Aug 8 00:38:14 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 4hH2Dl45d9z6mYfL for ; Sat, 08 Aug 2026 00:38:15 +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 4hH2Dl1mryz3mNZ for ; Sat, 08 Aug 2026 00:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786149495; 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=+61DoDbfy2kdZNT0YZtBkJ5z2PI/eswHrSVFRmkzWyg=; b=GSp8XpXr+79tZJkWTvKZqyOkXtL4EUrkliEK4WLbkvdjobY6DIjkjKeACKO/NYzseI8NPP vE2psw/l8MxhXmzjR+7wmkbAwOeFPFMToTPrBWOVTaHffFUFUQRlna5Xc+omR5fwyU4NVZ oXEkdMJeMoikrX8+I/kIBHhvdqwBBbdkh5e5+IgnPjsJlgPpIDdlNcMdUFuCCr8XWnTNUr lRC4/1zZzEm6bCD30iKcwhSJl4wHLIAORXiq9SaVawpZSkubJuHwWd62hnHUk3ivV3BcUH A+OqutdXq9YPNbkNsO2N/ZhR/J1yJsyZindvV8l46fGHlIBDl7NBEyiioRA2Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786149495; a=rsa-sha256; cv=none; b=P19wxYpUJETV/xqEwGw36DaaI5J/QgEb1W5YBNqYvGTVqT19gIy7VqqURJjD+qKaWE4cgN zqB0HPZa0ig7EsIqxj8T5xOm/XTgGHMijcTrYDY5IPFeycd9Z7/TVcsIycybxC2aBCyfuj TaN3tACK2WE/VeFOmitf0lxVlreq/UxtoFHIyJewLArmx8UUS+olNFeUL6fwy7UEooH2g8 b8PKzwKTdUJelyZzSAESfHQfyc1HfdygdYprlmpHQhxyZZQf75d3G6aftp21BQ0458ZHE+ aF/G9bKH1SYtVaWlaEs5I65bVLpnXY92WkZZ6B5XgwBAiw84X0pSHDJGzhgqtw== 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=1786149495; 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=+61DoDbfy2kdZNT0YZtBkJ5z2PI/eswHrSVFRmkzWyg=; b=hzLXpr+pk4bpabpr5R0Sr9C0yk7Hvj8UUC+qkiWgx3bYDGlc0edCmLjZ9/AROdtZtq5rWP 4YzQg3dj2FjjZx/JBSypXS0+Ge2oMd8haIG0b0eBiJoRFwh+D2Bo0vI0wUSn6346ivnk0T SP03rnAQNlnZtJ5Tb5b8ySwSu9hee9F9hj+c70zImL2NXM2UTR5akKPEwNtnOCZNz0v/Ii V4vCKax7IkxazxIdxcf7BIaciEfgNhL+ur13cdwi4oyQGUR+vN2lQivJ9gZg2ARpoZSsiY NcWqkAgR//hJkWFbszRydqSqOzmaLn6rOtDDS1qz8hNXd/rQwH8F4bMns9rNrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hH2Dk6w4WzS1 for ; Sat, 08 Aug 2026 00:38:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3eacd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 00:38:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 15253bd66b15 - stable/15 - 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 15253bd66b15f35afd7515a0dee62d4d6682dab4 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 00:38:14 +0000 Message-Id: <6a767a76.3eacd.65e06a0a@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=15253bd66b15f35afd7515a0dee62d4d6682dab4 commit 15253bd66b15f35afd7515a0dee62d4d6682dab4 Author: Kevin Bowling AuthorDate: 2026-07-28 09:27:24 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 00:34:00 +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;