From nobody Thu Nov 05 15:12:57 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 4jL5Qx3hgJz70B50 for ; Thu, 05 Nov 2026 15:12:57 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jL5Qx19gQz4DNr for ; Thu, 05 Nov 2026 15:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793891577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e6V6aAfVmtPtA30Hx0MEGPrDQyYqTxiKGYc/tZtpVZc=; b=IYEOK4jKWz6eAR/UFFQCHdk7j25HZ0eIYXqnSz1LyO4p/nQ/bQHP5fM/X069Pt/Co/ET1H Z0SIugzr3FxfSO93E6z1TXbdqZFnI70eZc4dvcej4keTOPqONQly6Svd5D5ZE+BWWmu9BC k+dN1xCvT4lOaJFIWNoqMbgVDXxJG9P9ZVYazWihlfZoI4kk9Bd2HxupAV2EKp9FC1t4YC 1dOoeTbL4eaBYxT3Yf8/8ZTNq12d0/W75YR5mYco6Bc9VzJNnC/97jtnGL71N/quncE2u1 DzyVm6TxOkm2dDEqo35S7Ac/vWT/+dtoxjU5t7NruJZ13dHWnIw2Phd5EzjK/A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793891577; b=rhAO1tI794/GDtqodVaQxakIgWAQV3k0PsbvE8IWo7pB0dRt5q0XZpM18xaMZZJrxuXJXi pJsXFz5G6mMSjlVI/gKq1zx1eAnuZ9gRsRgB8owtV+7HBPMJ7AjRbBC40MBMtMCuq7P65x lkPUVmPtLx1O/1mBZ3NYJlax7Y+qOQIUBjB2IMlRb4MJdToJJSp7FW7xGMo8iCSYgx+SpQ ayqqKS6afaU/u0rpmExmlvnTk/BUOESuEXBvqNGeMvSkalyBpW7fOnKaQUUiqt9xs3hdGn GLh2UvjeNXmaZWPuc/7Z0IWClt3CvTqpUDPAKfyPlKT03DpCG/3eG0fEg3dFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793891577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e6V6aAfVmtPtA30Hx0MEGPrDQyYqTxiKGYc/tZtpVZc=; b=xDtvuV9Zv5eGVOfib9GyCHkPcynoz07WuHMlAVRNWHdoySFlxCaw0pwWFMPDe/6ePqNox+ Ph7T3TTj0YZJp06yPzkLCufiydWib88mBAb4gS6Hd4deFjPgQx6Zj4o8e0UGchLlAOnNCI ahQXPaPFxxivbEH9elXkQrdtrQCd6XJMXQIhx6a+jqpLVeJ1fzWY4Gk+xCb+ItlDn01H0L q7yd6NZSAbPf34FLNBvN/vveH/pWqF/6XcbwJb+agFZjEACXuAYXPeKt2hv1JwXlYqL4Ox aV+Cgru+pbYBik9bJN/2suhpSQdgon6Qi//zXE6rMmvHvYXiX8OHt5WZqVJh0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jL5Qx0n7kzvv2 for ; Thu, 05 Nov 2026 15:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 246a9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Nov 2026 15:12:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Sobczyk, Pawel From: Krzysztof Galazka Subject: git: ae65253312b0 - stable/15 - ice(4): Do not leave device non-functional if Tx scheduler config fails List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository 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: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: ae65253312b0bd9fbdc70b16609cccb52732abe7 Auto-Submitted: auto-generated Date: Thu, 05 Nov 2026 15:12:57 +0000 Message-Id: <6aec9cf9.246a9.387f4f35@gitrepo.freebsd.org> The branch stable/15 has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=ae65253312b0bd9fbdc70b16609cccb52732abe7 commit ae65253312b0bd9fbdc70b16609cccb52732abe7 Author: Sobczyk, Pawel AuthorDate: 2026-11-02 07:31:05 +0000 Commit: Krzysztof Galazka CommitDate: 2026-11-05 15:12:31 +0000 ice(4): Do not leave device non-functional if Tx scheduler config fails The ice_cfg_tx_topo function attempts to apply Tx scheduler topology configuration based on NVM parameters, selecting either a 5 or 9 layer topology. As part of this flow, the driver acquires the "Global Configuration Lock", which is a hardware resource associated with programming the DDP package to the device. This "lock" is implemented by firmware as a way to guarantee that only one PF can program the DDP for a device. Unlike a traditional lock, once a PF has acquired this lock, no other PF will be able to acquire it again (including that PF) until a CORER of the device. However, if configuration of the Tx topology fails, (i.e. ice_get_set_tx_topo returns an error code), the driver exits ice_cfg_tx_topo() immediately, and fails to trigger CORER. While the global configuration lock is held, the firmware rejects most AdminQ commands, as it is waiting for the DDP package download (or Tx scheduler topology programming) to occur. Refactor ice_cfg_tx_topo() to always trigger a CORER after acquiring the global lock, regardless of success or failure of the topology configuration. We need to re-initialize the HW structure when we trigger the CORER. Previously, this was the responsibility of the core driver to cleanup after the CORER. Instead, make it the responsibility of this function. This avoids needless re-initialization for the cases where no reset occurred. Authored-by: Jacob Keller Co-Authored-by: Pawel Sobczyk Signed-off-by: Sobczyk, Pawel Reviewed by: kbowling Tested by: Mateusz Moga Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D60168 (cherry picked from commit 013f1779f63413173535ab770abb70715e92bee6) --- sys/dev/ice/ice_ddp_common.c | 32 +++++++++++++++++++++----------- sys/dev/ice/if_ice_iflib.c | 17 +++++++---------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/sys/dev/ice/ice_ddp_common.c b/sys/dev/ice/ice_ddp_common.c index dfc50cc1f966..da5af86c9bfd 100644 --- a/sys/dev/ice/ice_ddp_common.c +++ b/sys/dev/ice/ice_ddp_common.c @@ -2527,25 +2527,35 @@ update_topo: /* check reset was triggered already or not */ reg = rd32(hw, GLGEN_RSTAT); if (reg & GLGEN_RSTAT_DEVSTATE_M) { - /* Reset is in progress, re-init the hw again */ ice_debug(hw, ICE_DBG_INIT, "Reset is in progress. layer topology might be applied already\n"); ice_check_reset(hw); - return 0; + /* Reset is in progress, re-init the hw again */ + goto reinit_hw; } /* set new topology */ status = ice_get_set_tx_topo(hw, new_topo, size, NULL, NULL, true); if (status) { - ice_debug(hw, ICE_DBG_INIT, "Set tx topology is failed\n"); - return status; + ice_debug(hw, ICE_DBG_INIT, "Failed setting Tx topology, status %d\n", + status); + status = ICE_ERR_CFG; } - /* new topology is updated, delay 1 second before issuing the CORRER */ - for (i = 0; i < 10; i++) - ice_msec_delay(100, true); - ice_reset(hw, ICE_RESET_CORER); - /* CORER will clear the global lock, so no explicit call - * required for release + /* Even if Tx topology config failed, we need to CORE reset here to + * clear the global configuration lock. Delay 1 second to allow + * hardware to settle then issue a CORER */ - return 0; + ice_msec_delay(1000, true); + ice_reset(hw, ICE_RESET_CORER); + ice_check_reset(hw); + +reinit_hw: + /* Since we triggered a CORER, re-initialize hardware */ + ice_deinit_hw(hw); + if (ice_init_hw(hw)) { + ice_debug(hw, ICE_DBG_INIT, "Failed to re-init hardware after setting Tx topology\n"); + return ICE_ERR_RESET_FAILED; + } + + return status; } diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 5576d7883a55..d5dca978601c 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -528,11 +528,11 @@ ice_if_attach_pre(if_ctx_t ctx) /* Setup ControlQ lengths */ ice_set_ctrlq_len(hw); -reinit_hw: - fw_mode = ice_get_fw_mode(hw); if (fw_mode == ICE_FW_MODE_REC) { - device_printf(dev, "Firmware recovery mode detected. Limiting functionality. Refer to Intel(R) Ethernet Adapters and Devices User Guide for details on firmware recovery mode.\n"); + device_printf(dev, "Firmware recovery mode detected. \ + Limiting functionality. Refer to Intel(R) Ethernet Adapters and \ + Devices User Guide for details on firmware recovery mode.\n"); err = ice_attach_pre_recovery_mode(sc); if (err) @@ -574,14 +574,11 @@ reinit_hw: if (err) goto deinit_hw; - /* - * Success indicates a change was made that requires a reinitialization - * of the hardware - */ err = ice_load_pkg_file(sc); - if (!err) { - ice_deinit_hw(hw); - goto reinit_hw; + if (err == ICE_ERR_RESET_FAILED) { + device_printf(dev, + "Failed to re-init hardware after setting Tx topology\n"); + goto deinit_hw; } err = ice_init_link_events(sc);