From nobody Sat Aug 8 07:12:34 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 4hHBzl1khBz6n9Zs for ; Sat, 08 Aug 2026 07:12:35 +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 4hHBzl0t2Wz3nsC for ; Sat, 08 Aug 2026 07:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786173155; 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=k/tNjTPBUkePd4KNG91jxB96nN76k6Ig6+6AWJWsP29N0ZVJzHvaR3IPMc4GnE1GjBatxj j+BAicpIvDeniR4cjyLlCrtKtxEgjegLT1P5orEN4EjhYQacSz3QcNpX0hFS4m2xbggwku D80mrl18ApTd3RYZ+khk3Enw2NAnF86Ggicei7W2+QtE8xRqNOaIrO4k9ty5XOqMp/txQv gzbeOnA9itcQVB7YqFVT7bIZJ6VJ2yvbPsnEPv8QGQFw38f4wnJITRCWocBq/61ZMYOPXr WiGWUMxWXPSED8Gshno0dpsYfEER0Q8Zen1/6vpUN0GQ0tJc3BC2/KK8pVT2dQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786173155; a=rsa-sha256; cv=none; b=nqWKwRJw9DwHW56Pgx/KKdKmVLyAg8sA6myhrMVpyrQBi7RAwOTMi5iOWsPEwPS1Zi3qfK A/nb7+8Flmv7OvU+yHWSc6bT743uFoiPXSVseBvjuhamvzhhFX1BW8qJW4V27ivsnxTtcL nG5k3mYQY87dQcQTGeRN9z27R/Ml68tjKsFlZmBxH53yrtuPc1TWid2JR2GDJSf6YgCs/0 oJ7aGdVQenwJrKGY6Yde6BlYf/LDa0kjfgOFag88rRYLUnaf2N5UI/um+1EyEdePMB/FSV UwUdEsEw50BFkkt7IOWu/ap+cbkE8+xFuf4+1bl8fTX3v4cMcodUJFbW5Idbig== 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=1786173155; 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=mbMsWumLlSTaTkiReh3QBEjOGZRkRDLIby2rGXRK76o91/mrCm+GVaJ3it0BcRdL3xVzf0 lSY8nWc1QRDnvbjLUF0MkgkbQxryzy1ihF2f1inS0Tau3F9YmB9Cq7Zdq7sTsO1YhBUBdy eRNgN6rBnSa+LkRGjhn9ka6FDgXsrwC/faKPUJnZHADVo73HmZvKeCcG3sw9/QDHPjQj8V mqMUV+TqkNQoZyCmGEr/GJLuttS4JPhpYDqJ6uQ/IzTdzY1jtLVjpdKnyLh/obeMo76CcW lipVvTIjlNJ+oxMrMnKsnYfFge0WjBgowWNNaVjTp2XwL9ZQ2mPJtaq/CvSmeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHBzk6y2CzCdH for ; Sat, 08 Aug 2026 07:12:34 +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 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: 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;