From nobody Fri Jul 31 10:51:09 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 4hBNCf0kZSz6n0jw for ; Fri, 31 Jul 2026 10:51:10 +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 4hBNCd2cqmz43G7 for ; Fri, 31 Jul 2026 10:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785495069; 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=3yxB4Bx2KwAs95I8SlMFfHAU64GLSznuYaHtO7srcEk=; b=qBnwiuOMNmhrZILCg9seTKWK4ofRQEdEmrMGYAO1Q5QkV9b9xMBDRWWdZXpMcf61V8Jgel JJ3n97SXOWDdTgcvo/5gkYZOBbwBhag28o3XYyNuotkKvpfUksf2A9jNAYJWp92MXvYfKO 3Wqare6mcnbrkNeSln6XXKnwQKFoaBySttfRpdmVsjWiIGuO22YCkbXKFQmx9sotnO58Jx dGMYBr010/78ImMRP8GcKeZqqtEjsmsJ+iwOOiu+9tvcWR+yBYpu2IrGWQpqEAvk/BSpBZ IeWhG9eekBQEQIcoDv3wwlMTIYuiG0Ue6n1BSEPtFZdMfv35voCpirn09jSKyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785495069; a=rsa-sha256; cv=none; b=g3yaxJ8ljzviu/WF/wl8YWGwu4WYEltirPWrnwGeKX6M/xilGv+zFc80aipN8CQF+SZVdi exnOG7pn+XrwPzeilLQ5up1PA6gvKn8CdOq2s0Pb0rLDTo8rYgYKeOAPn9pr95c4avitV9 s0PNqEyCC5WUIRzFNGG6klzKXjx3Wu0CeV3/rCy+DRGmgGHCFEVz2lI0ArB7z9A3PEBnDP ddndDOw26oFwlqn0xlceg/qG4AMSKDQPpZL/K3F0AuwoCNUbEwr77CChUGhepVfiR9R2vs X2beIKUIfBxP+AXGBGc+h0JKdTtxS4ebhAgWiy3jNBO7rBBebCKp89xyxCotqw== 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=1785495069; 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=3yxB4Bx2KwAs95I8SlMFfHAU64GLSznuYaHtO7srcEk=; b=d2wsGVhbQKG2K+WZ4utGu8+bL+BQwlxLZNnf1vBFLPSglFcXPeSEydqrCSu6Dim1c9SULA SItkGM++1Xh0PzNi99NWdF0tDZkq4aW+Askgfpl5zW1KtweRXeJwFoxy9OnEvG4oAhZcTK /w3x9RyQgyg/pDzlC3z00AN93iDZv2TCk2KrpgP+A+bjRSy1s7KQJr5GPxV9Ygu309Kj+Y Ylbpt5htDNv6DemV2j53MMDXx/DA89w9Ln1K6ZtKPARhDKnwGHqyNJ21wVO1U/BqAsYY/C 8ouu2yGbm8vihpgw69N6vVd+dREAh6asGLmFIFQjPDiHF5+z4Fk7HMWYfhTXsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBNCd0v7szwL2 for ; Fri, 31 Jul 2026 10:51:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39b3c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 10:51:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 2a678cfeb583 - main - ixgbe: fail fast on VF-held PF mailboxes 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: 2a678cfeb5838978ef3a1907c686142d03237e15 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 10:51:09 +0000 Message-Id: <6a6c7e1d.39b3c.32940bf1@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=2a678cfeb5838978ef3a1907c686142d03237e15 commit 2a678cfeb5838978ef3a1907c686142d03237e15 Author: Kevin Bowling AuthorDate: 2026-07-31 10:41:02 +0000 Commit: Kevin Bowling CommitDate: 2026-07-31 10:50:30 +0000 ixgbe: fail fast on VF-held PF mailboxes The active PF mailbox operations use the legacy helpers. The mailbox API import changed check_for_msg into a read-only probe and added up to 2,000 500-microsecond lock retries. If a VF leaves VFU set, the PF cannot acquire the lock, busy-waits for up to one second, and leaves VFREQ pending so the delay can repeat. Give the legacy checker its old consume-on-check behavior so a failed read does not leave VFREQ asserted. If VFU is already set, fail immediately instead of retrying, while preserving retries for PF-side contention. Do not force RVFU, which would discard peer transaction state. MFC after: 1 week --- sys/dev/ixgbe/ixgbe_mbx.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index eef30733b7b2..810b282bbd0e 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -789,6 +789,22 @@ static s32 ixgbe_check_for_msg_pf(struct ixgbe_hw *hw, u16 vf_id) return IXGBE_ERR_MBX; } +/* + * Legacy callers expect checking for a message to consume its interrupt + * cause before attempting to read the mailbox. This keeps a failed read + * from leaving VFREQ pending indefinitely. + */ +static s32 ixgbe_check_for_msg_pf_legacy(struct ixgbe_hw *hw, u16 vf_id) +{ + s32 ret_val; + + ret_val = ixgbe_check_for_msg_pf(hw, vf_id); + if (ret_val == IXGBE_SUCCESS) + ixgbe_clear_msg_pf(hw, vf_id); + + return ret_val; +} + /** * ixgbe_check_for_ack_pf - checks to see if the VF has ACKed * @hw: pointer to the HW structure @@ -876,8 +892,12 @@ 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 the mailbox is already owned by the PF or VF */ - if (pf_mailbox & (IXGBE_PFMAILBOX_PFU | IXGBE_PFMAILBOX_VFU)) + /* A peer-held mailbox cannot be recovered by retrying here. */ + if (pf_mailbox & IXGBE_PFMAILBOX_VFU) + return IXGBE_ERR_MBX; + + /* Retry transient contention with another PF-side caller. */ + if (pf_mailbox & IXGBE_PFMAILBOX_PFU) goto retry; pf_mailbox |= IXGBE_PFMAILBOX_PFU; @@ -1127,7 +1147,7 @@ void ixgbe_init_mbx_params_pf_id(struct ixgbe_hw *hw, u16 vf_id) mbx->ops[vf_id].release = ixgbe_release_mbx_lock_dummy; mbx->ops[vf_id].read = ixgbe_read_mbx_pf_legacy; mbx->ops[vf_id].write = ixgbe_write_mbx_pf_legacy; - mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf; + mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf_legacy; mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf; mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf; mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf;