From nobody Sat Aug 8 07:12:34 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 4hHBzs3PQwz6n9pd for ; Sat, 08 Aug 2026 07:12:41 +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 4hHBzr4qZLz3nsj for ; Sat, 08 Aug 2026 07:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786173160; 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=9KlW74ksBsZobFy76et1qWbmL0Lp7zhrvi+5/H6SGLY=; b=AOdWgWIhXm86/+TRmFdo98F03/hTdRq1Z4FkBnBiFJe7db5KKo7xIgOMIGfSsSp48xxT7Z fkKQ4bD4xcGNCB9Tng6XIXk4MtJh+97xEf2Vy2MJ4GTJUeZUq8RKFIIrxvwTWw3kHwUqXY rN7/Bi2OijYWIen2UnzAdHoAV8tb1G67Qe3skuTQgMBnoTyTQd9/rJkBKzYT4jiV91P+/Y yel78A6gnU5rnIALiIX/qoM60YJVXtVBSsYNvIBph+LHvpVUhY0zdIX2yXokiVQi18Gh5G iJtMhIEqpa9kGU0sC+2KNmIvqh6GVO+ZhUeVRRjkLnbXfH3R4J6/EHJUTe3LEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786173160; a=rsa-sha256; cv=none; b=tlUOCXnbiIGjaceW4vsoO4jODlCiIAo47sHq3n2vXy73WT9O6hVZsEvciQUUWOAwuWvqdb vTPVLFqvDDpTqGjNyaG2hIFCA3ez0aURx9NlEKGrJctYOxKJr7/ic8thTMdZnFHojIPOdr pZ4xJkHK5G0niZqo7LE8K2MjGGU282RrJkE8c19Fe8yMwx81LR5t71E5j3za8/rdks47DX 4BpB5q9orZFLAzR+MhcDteksnA2PUQh0gZUonq7PHW1n8xM1Z09aphhHVOjpceGVWbfL6I YCjFNqkI0b1+WaZrpylQtTYk5ETI/OF8vssAEbT+QJbaN5q3iHBGkyvMY0cdKg== 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=1786173160; 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=9KlW74ksBsZobFy76et1qWbmL0Lp7zhrvi+5/H6SGLY=; b=TALSPBiXj84UbIqki9xEpu3CyTl1zm9Ia31ZMu7sF4xXE0MePhbsZkFelbcD7h8up6U5qm ZUsrPMaKDFM8rl7C91ffWeExU0lkprELYGVzVnHl4C1RXfTJ53+wsE3Hvm2kSnlbkzbINv lOaCkUhWsTV/om7C5QpxV5vnuTCv9dMxbnC3vAsbwq01QgbOFxys5cEp/EDTYM8vHPfCV8 cTf3I/euFlzvv8c9+et0sT0jWkDPx3rLuYdy8Hxf74/PFwAX+OPso27AoyXSlXnbJQ3HHX j16/YY2bzeEu9j3Bx4mK3MOIeCPa4U4OEdpNcej7ksmJP7gL+wUce0S502fozA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHBzr1hdDzCdK for ; Sat, 08 Aug 2026 07:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40b4b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 08 Aug 2026 07:12:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 26e3a8045ec7 - main - ixv: Tolerate temporary PF mailbox unavailability 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: 26e3a8045ec7e2abfea9e2e49577c5e2c4226df1 Auto-Submitted: auto-generated Date: Sat, 08 Aug 2026 07:12:34 +0000 Message-Id: <6a76d6e2.40b4b.6229f492@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=26e3a8045ec7e2abfea9e2e49577c5e2c4226df1 commit 26e3a8045ec7e2abfea9e2e49577c5e2c4226df1 Author: Kevin Bowling AuthorDate: 2026-08-06 08:22:11 +0000 Commit: Kevin Bowling CommitDate: 2026-08-08 06:59:02 +0000 ixv: Tolerate temporary PF mailbox unavailability A PF can be resetting, handling a slow link event, or deliberately withholding mailbox CTS while its VFs enumerate. Keep the VF attached when the reset handshake is temporarily unavailable so a later if_init can retry. Never leave VF hardware running without a negotiated mailbox API: start hardware only after reset succeeds, stop it when negotiation fails in attach or init, and defer later recovery through iflib. This prevents a tight reset loop while preserving recovery when the PF returns. MFC after: 2 weeks --- sys/dev/ixgbe/if_ixv.c | 77 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index b954e092c04c..7fffc5ec00bb 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -406,6 +406,7 @@ ixv_if_attach_pre(if_ctx_t ctx) device_t dev; if_softc_ctx_t scctx; struct ixgbe_hw *hw; + bool mailbox_ready; int error = 0; INIT_DEBUGOUT("ixv_attach: begin"); @@ -448,36 +449,40 @@ ixv_if_attach_pre(if_ctx_t ctx) /* Setup the mailbox */ ixgbe_init_mbx_params_vf(hw); + mailbox_ready = false; error = hw->mac.ops.reset_hw(hw); - if (error == IXGBE_ERR_RESET_FAILED) - device_printf(dev, "...reset_hw() failure: Reset Failed!\n"); - else if (error) - device_printf(dev, "...reset_hw() failed with error %d\n", - error); - if (error) { - error = EIO; - goto err_out; - } - - error = hw->mac.ops.init_hw(hw); - if (error) { - device_printf(dev, "...init_hw() failed with error %d\n", - error); - error = EIO; - goto err_out; - } - - /* Negotiate mailbox API version */ - error = ixv_negotiate_api(sc); - if (error) { + if (error != IXGBE_SUCCESS) { + /* + * A PF may be resetting or servicing a slow link event while its + * VFs are enumerated. Keep the VF attached so a later if_init can + * retry the mailbox handshake. + */ device_printf(dev, - "Mailbox API negotiation failed during attach!\n"); - goto err_out; + "PF did not respond to the reset handshake: %d; " + "continuing attach\n", error); + } else { + error = hw->mac.ops.init_hw(hw); + if (error != IXGBE_SUCCESS) { + device_printf(dev, "...init_hw() failed with error %d\n", + error); + error = EIO; + goto err_out; + } + + /* Negotiate mailbox API version. */ + error = ixv_negotiate_api(sc); + if (error != 0) { + device_printf(dev, + "Mailbox API negotiation failed during attach; " + "continuing attach\n"); + hw->mac.ops.stop_adapter(hw); + } else + mailbox_ready = true; } - /* Check if VF was disabled by PF */ - error = hw->mac.ops.get_link_state(hw, &sc->link_enabled); - if (error) { + /* Check if VF was disabled by PF. */ + if (!mailbox_ready || + hw->mac.ops.get_link_state(hw, &sc->link_enabled) != 0) { /* PF is not capable of controlling VF state. Enable link. */ sc->link_enabled = true; } @@ -654,8 +659,13 @@ ixv_if_init(if_ctx_t ctx) bcopy(if_getlladdr(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, 1); - /* Reset VF and renegotiate mailbox API version */ - hw->mac.ops.reset_hw(hw); + /* Reset VF and renegotiate mailbox API version. */ + error = hw->mac.ops.reset_hw(hw); + if (error != IXGBE_SUCCESS) { + device_printf(dev, + "PF did not respond to the reset handshake: %d\n", error); + return; + } hw->mac.ops.start_hw(hw); hw->mac.ops.get_mac_addr(hw, hw->mac.addr); ixv_reconcile_mac(sc, ifp); @@ -663,6 +673,14 @@ ixv_if_init(if_ctx_t ctx) if (error) { device_printf(dev, "Mailbox API negotiation failed in if_init!\n"); + /* + * Leave the adapter stopped until an explicit or deferred retry. + * Otherwise the admin-status callback immediately requests another + * reset and can keep its taskqueue in a tight loop while the PF is + * deliberately withholding mailbox CTS (for example, when the VF is + * quarantined). + */ + hw->mac.ops.stop_adapter(hw); return; } @@ -1865,6 +1883,9 @@ ixv_if_enable_intr(if_ctx_t ctx) struct ix_rx_queue *que = sc->rx_queues; u32 mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); + if (hw->adapter_stopped) + return; + IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask); mask = IXGBE_EIMS_ENABLE_MASK;