From nobody Mon Sep 28 11:53:41 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 4htfpY4t8Mz6vKkq for ; Mon, 28 Sep 2026 11:53: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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4htfpY4G3Gz4tjC for ; Mon, 28 Sep 2026 11:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790596421; 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=DvL96SXUDa9DgIsUZarF4wH63ub6wwG4DSFxyC6ects=; b=sJIxznleEkxg46IYW+SvtLsbAXBtHhtLzvLnv983+wN92KchzgIkixqwi8zBTR597TLe/n gwP0YHjKitn0a5AP+SgBZ5QO1rdrexFmkj9s1cYG0+bK9zBRTdRBKRZpVzGp3EjwwtaQY8 TuJxPOrqjs/WduUI4Ng64BtzcTpnxaVE2nvxE94rUmjGt9RH/1mDN8tAMo23krCG6bPxO8 NTUi0GSanEspxy6zwBlm2DbwmP7U8lua9zb/6pLL2rf3qifDzaki2eeBDlLE7qErIaJQ5s Ksm6tFffhvn2j/Uatst73WfEeJg+FnvRRAhwHLldHTFHn68x17tG4k+459OjrA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790596421; b=u4KnNg9OJedmtv+/1khhUXLtFsDr8uS4WeR9y9+Vbw5k8e3lbuodx/WRylihAJcJtBSN4H +X/CgiqE6Ci06ZStKXdVUmo/OkR3tVsBfWaQJoqXOkb8TXNti1SANedA+bd1Ecv55KXZv9 l9SWJ/jZbVzyU5RO7feEt5lvIhqtCYTzb5wLnkEzwFWNOZTv58XmP15wlB101E2/R+l/P5 yOjHwjEnquhQ9syIKpHIjEkl7jkRsTX5B4rwxxe6KZzNxu2oj432Vmw+kplzSZFyc1uk9A Tzz+LZykHArW5yydkdhRJw/8r9r8Uz5v0mr3GbThaSouzhlX69Ysqc3wQN60lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790596421; 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=DvL96SXUDa9DgIsUZarF4wH63ub6wwG4DSFxyC6ects=; b=OJLfR3WM888jrpNl+pB+C6nJzXjEUzbcToHfkFS+SgjgNvUER8TL2WTHnREorkdEyR87TA VK+3VnOvwOvKgX87wids5wnqAgXDh+IuHdM+FxicNNUNxIOs7D+ilNwPBUAeel7hWJBfgY CXNmGhfC37qY0QzpGCb0JApYJnV8EumnXygN97OzhRMB+1X7hwHPSz4T6OoJqsMZtqSoxV WoX1X64R8n3BRBJVxX+b1P8r+iqR5pF9Zfkrp4S7NY5BjyXR+eUmRVoFz0vGg3kCCcBCHC Zskr8+ua4440zj7RWhRahap7E6PZyrv6aomCE5RYntvfmWHZPHNPjcFa6Lr5Lw== 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 4htfpY3KvJzQZh for ; Mon, 28 Sep 2026 11:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b989 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 28 Sep 2026 11:53:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Krzysztof Galazka Subject: git: dcb84ddcfe89 - main - ice(4): Fix link bringup on driver load 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: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcb84ddcfe89d358a66cffb45196e6b45b45502c Auto-Submitted: auto-generated Date: Mon, 28 Sep 2026 11:53:41 +0000 Message-Id: <6aba5545.3b989.5333bd13@gitrepo.freebsd.org> The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=dcb84ddcfe89d358a66cffb45196e6b45b45502c commit dcb84ddcfe89d358a66cffb45196e6b45b45502c Author: Krzysztof Galazka AuthorDate: 2026-09-28 11:47:43 +0000 Commit: Krzysztof Galazka CommitDate: 2026-09-28 11:48:10 +0000 ice(4): Fix link bringup on driver load Patch adding Total Port Shutdown support incorrectly handled a case when this feature was not enabled in the NVM. When TPS bit is not set driver should apply link configuration according to user settings and update the status. Those steps were mistakenly omitted, while the state flag was still set to prevent link renegotation and status update on first attempt to bring interface up with ifconfig. Signed-off-by: Krzysztof Galazka Reported by: kbowling Reviewed by: kbowling Fixes: 0011cd9f8863 ("ice(4): Support Total Port Shutdown on E830 devices") MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D59578 --- sys/dev/ice/ice_lib.c | 26 ++++++++++++++++++++++---- sys/dev/ice/if_ice_iflib.c | 6 ++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 9c5732003494..f027e9092b97 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -9699,15 +9699,33 @@ retry: } return; } + ice_debug(hw, ICE_DBG_LINK, + "%s IFF_UP: %d, media: %d, TPS: %d, link_active_on_if_down: %d\n", + __func__, + (if_getflags(sc->ifp) & IFF_UP) != 0, + (pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE) != 0, + ice_test_state(&sc->state, ICE_STATE_TOTAL_PORT_SHUTDOWN), + ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN)); if (pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE) { ice_clear_state(&sc->state, ICE_STATE_NO_MEDIA); - /* Apply default link settings */ - if (!ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN)) { + if ((if_getflags(sc->ifp) & IFF_UP) != 0 || + ice_test_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN)) { + /* Apply default link settings if link was administratively + * brought up or link_active_on_if_down flag is enabled */ + ice_debug(hw, ICE_DBG_LINK, + "%s: applying saved phy cfg\n", + __func__); + ice_apply_saved_phy_cfg(sc, ICE_APPLY_LS_FEC_FC); + } else { + /* Either link_active_on_if_down is disabled or + * Total Port Shutdown is enabled in NVM */ + ice_debug(hw, ICE_DBG_LINK, + "%s: bringing link down\n", + __func__); ice_set_link(sc, false); ice_set_state(&sc->state, ICE_STATE_LINK_STATUS_REPORTED); - } else - ice_apply_saved_phy_cfg(sc, ICE_APPLY_LS_FEC_FC); + } } else { /* Set link down, and poll for media available in timer. This prevents the * driver from receiving spurious link-related events. diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index d9143618a0ec..5576d7883a55 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -3583,10 +3583,8 @@ ice_init_link(struct ice_softc *sc) } else { ice_clear_state(&sc->state, ICE_STATE_PHY_FW_INIT_PENDING); - if (ice_is_e830(hw)) { - if (!(sc->ldo_tlv.options & ICE_LINK_OVERRIDE_PORT_DIS)) - return; - + if (ice_is_e830(hw) && + (sc->ldo_tlv.options & ICE_LINK_OVERRIDE_PORT_DIS) != 0) { ice_set_state(&sc->state, ICE_STATE_TOTAL_PORT_SHUTDOWN); ice_clear_state(&sc->state, ICE_STATE_LINK_ACTIVE_ON_DOWN); }