From nobody Sat Aug 22 00:26:17 2026 X-Original-To: dev-commits-src-branches@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 4hRdJZ3pHPz6ppqp for ; Sat, 22 Aug 2026 00:26:22 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hRdJT37c9z3CwG for ; Sat, 22 Aug 2026 00:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787358377; 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=YMyjghHY2mQYvM2nWagwhnN05oHAnqveh27yxUxBL48=; b=jCqTrMVSPreJ/3GgZjZkt9dh2vgBnXAgwaOdnSxtpafljov6ZSaiZUJqf+SUGahhaBxAe9 gvtk+FIuFGmkhloxcCnuiANkOshUAA7NltXSLW3qy7QUtIevTGOi9klRBdgUGptEcD1bVA uAOC7umzOpaCu+1MdFh6jA9K9NtA118PeXZBGznzIrM6keDHEYgle56C57dIQ2wq6HG9mE 9AkVJN8h/0c9Dp6bqQSVQfa5Ul+lov46ZPtujihF5ecY00RJUmlX/H3GQa7AOMqbTOUI0a 9mJ1df+BCHNtOoP7EFJvcRteJSvKK0E156ZMZWUH6iCcO8M1LsnCNx489v1lEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787358377; a=rsa-sha256; cv=none; b=rUQ61sg8uouDRmSa7rEu2FWOWtyP+6RShSczqD9dFK0lTyd4oWKo4zvsO48gudJgk3IXn/ X+lHD7Y8XMRsAZzuyNp/48dJ/7FvYb6aKa8TwzQspgCfcvBMUdOlWcedwcQG8T3XwlRdFD 9wDaWWv3YOxpaRv/A9ABpvwoqtjw/quilhi8M90fn7O0rZOKponl7Kv5B6V4PcXPj0yP9A tIfRoNdF2BZRFTsJ2FzAROXORlU0ctJwFGcgQOur7XuPRhTJQ7ERgbT0gy8UlS5LmcLVxM dM/hZjDifZrIj3ssFVSc82qOptnWITpJ+pacqCLefMXGgtzmBozacEwK49QTfw== 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=1787358377; 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=YMyjghHY2mQYvM2nWagwhnN05oHAnqveh27yxUxBL48=; b=o/3MKCBgvFGOFJDqjRnJfcRuiLPb8gE3La1axZw6tWchHSueNTroAqFnm62e/yOJfl+jSV rcYOCyNpjl7vbWAjyPP4gt5Rc7mGPTQ21NcZVU/vBivg1mLLKjDJdZa/s4ldsUmlZJeNH3 06WRnAOSnCJJuGEEa4U0EOpGZRH3NkdPhhgBJZuvKsz3/6iOsFU8zjM1B8GZ0kFSS98DKR x34ZLPX58kCg/X8SjIDJt1hgBpunSaFrXKJ5E/d/jHC6pg34N8otw/rPqodG28fu1Ptufx 5tnqLaADN2DLLfsbJGdxoki7gKPqTSFHh3PEnt5gU5hNGNXduRuiPikpV1FXWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hRdJT1qyMz9wl for ; Sat, 22 Aug 2026 00:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22cd6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 22 Aug 2026 00:26:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 7ce4b30f2f69 - stable/15 - ixv: Tolerate temporary PF mailbox unavailability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 7ce4b30f2f69efd0bf0fe003790da8ad1927e961 Auto-Submitted: auto-generated Date: Sat, 22 Aug 2026 00:26:17 +0000 Message-Id: <6a88eca9.22cd6.644f08ea@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=7ce4b30f2f69efd0bf0fe003790da8ad1927e961 commit 7ce4b30f2f69efd0bf0fe003790da8ad1927e961 Author: Kevin Bowling AuthorDate: 2026-08-06 08:22:11 +0000 Commit: Kevin Bowling CommitDate: 2026-08-22 00:25:45 +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. (cherry picked from commit 26e3a8045ec7e2abfea9e2e49577c5e2c4226df1) --- 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;