From nobody Mon Nov 02 07:35:14 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 4jJ3QH5BgYz6xl9d for ; Mon, 02 Nov 2026 07:35:19 +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 4jJ3QH2yQ1z3MCg for ; Mon, 02 Nov 2026 07:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793604919; 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=SSL5Oh+v3su6bfHAFJGD42yc/oe5bvrwCgmLQYOGEGM=; b=KiP8uy+cMOAYth+hCkTuTxg1FsZrSmuGSk3o/eBCd79uEjhKh36mPrB7Ykx6NCzoBus5wq evnZ2Dk+u+q8ucAaNWeVR4atwxoZ9I1Z1oDLNmO/rJnx3o9joU+aAoyiVcT801Du/8VnRi TsbQwGHtrciiiGOadwkFcSzpYG1hSaSlN/bKj2YVpY5BfCI0PBSSKW0WPBTwbNZdKG47bG LlhoCoT+qfQ8mWT+Bt/CV5POhbKBlG3/QZ2MkMbsYSDiRr563aL7QsmK02GW0cIYqbvckH f58vdrut/9XbnwlIfPOSNyRIPezflgRasZpEaZZX+0QyaN29l/AYqNpQYbxVmw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793604919; b=bhsr+ijmtjodmBqNON6YvEn8b3tdBq/7X/NQKUxUPAemJsuCuG13BATYzXwEuHQ0OD8kwT h5SIeli4WyRyKARUiM/Qf6Iixm8nDRa0mpEHbgjW3U18D2lrvHiyHqpup+3dfmaTVOkxz2 bEyH23JiyhnWLPxhIQunkKD46F/E+bzQ0Dj33OBEFFDjadMSkYPj1JERwnIK/LK/kD60V/ gT2qqcDj7xeLquZ1srq+e2eM7Bl7Q2sNGJ3Gb+CBx71uuf7rZ5DYnck4DTCkpk/mOiFs5K Mhb1NMN5+RxzIM1JJhoJJWL9JvU5dPbZ9jrmfp0M3+7UDVG0/nu0XWBrdrvjKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793604919; 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=SSL5Oh+v3su6bfHAFJGD42yc/oe5bvrwCgmLQYOGEGM=; b=IjRZhs7CzZNqjB7JeR2sD2fC1ReunJPqqy+EmgQY9cV0Y4G40AW2UdbJRjWotQitXKIZu0 59e9HGeMk08B3maiWheam+fo/K8MYVKKvO864Y0Ewxb+RcsAfEKcrMPcjVU9XUNGnLrw3P S95Xyodd1SADTpkNxNc5v2Y+CUPFOizev/10TyzlqVBls/n4LAylK3bi1abn3hy/MuWU3i kFfUWmUAsTJN8YRYEFSo5YgavMxbpZrJ2rV4YLPBC/FCKACgD4+1Y6f+iJadmGItEqsxAA jC8x1H27nhgc+5vyYpkejH0iJrp7/Kgzfwd1qgdSNhSYHeyZViPJK51bcmn9VQ== 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 4jJ3QH2K9zzcGH for ; Mon, 02 Nov 2026 07:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26a48 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 02 Nov 2026 07:35:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sobczyk, Pawel From: Krzysztof Galazka Subject: git: 013f1779f634 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 013f1779f63413173535ab770abb70715e92bee6 Auto-Submitted: auto-generated Date: Mon, 02 Nov 2026 07:35:14 +0000 Message-Id: <6ae83d32.26a48.76310349@gitrepo.freebsd.org> The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=013f1779f63413173535ab770abb70715e92bee6 commit 013f1779f63413173535ab770abb70715e92bee6 Author: Sobczyk, Pawel AuthorDate: 2026-11-02 07:31:05 +0000 Commit: Krzysztof Galazka CommitDate: 2026-11-02 07:32:16 +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 MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D60168 --- 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);