From nobody Tue Sep 01 00:28:08 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 4hYmt119Jqz6qVPr for ; Tue, 01 Sep 2026 00:28:09 +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 4hYmt10NR9z3Psd for ; Tue, 01 Sep 2026 00:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788222489; 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=pt/JKpc6L2kHMDhWqG8pn0A6BzkDJhAdfJk2nAiXPhE=; b=HO316qpYayivZpdXXurD/xIjzNjHQp3rCY13o77tA1a0IoC9eTQ8TkYVZ8B+sKjmJACpJG +8Fs/bowVkM226kqwuEYVjRp5sUeFaBD4+9fc3nuTMCYDGGOUTJYkBbPslYIehY3w/VpeM QntT30N5WQoisBObugzkvRTLJaVEvD5GChzH2Myyyl40Qtklhkw+3CLUCpywZufFh2pOJ2 GKXA/Bbh5zw9U/MXp3OSzJGlvPC4/3On/acKySjWs8s9+gU/bW2X6pq/bCVwTAGk+M3MPK O6Mq4qtRk5q2IEwaZpEaYuMLu1iu3hDbWUKfJIwvZuKjg81PmULmPPEKaOVBgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788222489; a=rsa-sha256; cv=none; b=uUs+LA1gndHrQcK9fMphOSMzW6sLslv4jOk/XjLEGDSoi5b75fljbETBQm8WN5wOZdKzw+ aEoLg2uDOBQmOjZcKYAnwYubGE93nkhuQBybI6wak0WUYUrHcC2qH+4KmQCMt/BNHVBMou 4WT5LCLV04J0rtqBdbymikS2/IhB0U+dQxSZsxs3esS2tkLgWVgh1eYU5OnSine06kJSH3 vzpJuDmyOQgehwTCbh8kMl8sjb3m3SYeXt9Yi7LAzxI8nDgh6cYpSiGzIGNpiU5f4npDMj oh2psqNVObCw/aWzMnmUscDK0khqkAvEcqbDUtVRmFLhmrN1ALfaT2/8r6JXxg== 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=1788222489; 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=pt/JKpc6L2kHMDhWqG8pn0A6BzkDJhAdfJk2nAiXPhE=; b=iyGU6Yaa+rfXleDa3oxZ/ySFERfnoNnev2Epn+IWXDOpUud0kLkkZ7NvFjklG+W9lcVqdO ZbbiNqUteSgAg9J62kigd22WJcAAVDyZgOt2ueDKkFsUAkW9RetLTFLBk/xdg3VCAyRsh4 vyd7oDr+g9jbcqHQIWpqe7mmtxxotXIJ8RJRkgKg5/fpJkz4aDxfVpCU8fH0gc1uLPQCpm 7iu+YljVUhllRBLXwj+/8yt8fyr/qb1N/NXEAcVij4yA61iH/rm2ZYRMMSMuJfVcnk4tjC EYzsn015nEouex5gHWQl0NUouVEBoKSU2iAQub8YItC+TAie1vZ3PYIP+TMzGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hYmt066Ljzbk1 for ; Tue, 01 Sep 2026 00:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ce0f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 01 Sep 2026 00:28:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 310c4c9bfb31 - stable/15 - ice: Add led(4) identification support 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: 310c4c9bfb31371aa2f8f5355806631677f37420 Auto-Submitted: auto-generated Date: Tue, 01 Sep 2026 00:28:08 +0000 Message-Id: <6a961c18.3ce0f.2e9a8f97@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=310c4c9bfb31371aa2f8f5355806631677f37420 commit 310c4c9bfb31371aa2f8f5355806631677f37420 Author: Kevin Bowling AuthorDate: 2026-08-12 01:29:31 +0000 Commit: Kevin Bowling CommitDate: 2026-09-01 00:27:47 +0000 ice: Add led(4) identification support Expose the firmware-controlled physical port identification LED through /dev/led/ice*. Use the AdminQ port-identification command to select blinking mode and restore the netlist-selected original mode before the interface is stopped. Sponsored by: BBOX.io (cherry picked from commit a781965b91ea390f9576ae42c35c842db74aab86) --- share/man/man4/ice.4 | 9 ++++++++- sys/dev/ice/ice_iflib.h | 1 + sys/dev/ice/if_ice_iflib.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ice.4 b/share/man/man4/ice.4 index a54a6b3fd6f3..35f752e5e7f8 100644 --- a/share/man/man4/ice.4 +++ b/share/man/man4/ice.4 @@ -32,7 +32,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd November 5, 2025 +.Dd August 11, 2026 .Dt ICE 4 .Os .Sh NAME @@ -155,6 +155,12 @@ be set and unset. For more information on configuring this device, see .Xr ifconfig 8 . .Pp +The identification LED for each port is controlled through the +.Xr led 4 +interface at its +.Pa /dev/led/ice* +device node. +.Pp The associated Virtual Function (VF) driver for this driver is .Xr iavf 4 . .Pp @@ -1156,6 +1162,7 @@ email all the specific information related to the issue to .Aq Mt freebsd@intel.com . .Sh SEE ALSO .Xr iflib 4 , +.Xr led 4 , .Xr vlan 4 , .Xr ifconfig 8 , .Xr sysctl 8 diff --git a/sys/dev/ice/ice_iflib.h b/sys/dev/ice/ice_iflib.h index e1d5307a9516..3e3d4e5f8d84 100644 --- a/sys/dev/ice/ice_iflib.h +++ b/sys/dev/ice/ice_iflib.h @@ -314,6 +314,7 @@ struct ice_softc { /* link status */ bool link_up; + bool led_active; /* Ethertype filters enabled */ bool enable_tx_fc_filter; diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 2722b8892d61..41324cc6779a 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -81,6 +81,7 @@ static void ice_if_multi_set(if_ctx_t ctx); static void ice_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ice_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static void ice_if_stop(if_ctx_t ctx); +static void ice_if_led_func(if_ctx_t ctx, int onoff); static uint64_t ice_if_get_counter(if_ctx_t ctx, ift_counter counter); static int ice_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); static int ice_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); @@ -139,6 +140,7 @@ static void ice_rebuild_recovery_mode(struct ice_softc *sc); static void ice_free_irqvs(struct ice_softc *sc); static void ice_update_rx_mbuf_sz(struct ice_softc *sc); static void ice_poll_for_media_avail(struct ice_softc *sc); +static void ice_led_restore(struct ice_softc *sc); static void ice_setup_scctx(struct ice_softc *sc); static int ice_allocate_msix(struct ice_softc *sc); static void ice_admin_timer(void *arg); @@ -201,6 +203,7 @@ static device_method_t ice_iflib_methods[] = { DEVMETHOD(ifdi_media_change, ice_if_media_change), DEVMETHOD(ifdi_init, ice_if_init), DEVMETHOD(ifdi_stop, ice_if_stop), + DEVMETHOD(ifdi_led_func, ice_if_led_func), DEVMETHOD(ifdi_timer, ice_if_timer), DEVMETHOD(ifdi_update_admin_status, ice_if_update_admin_status), DEVMETHOD(ifdi_multi_set, ice_if_multi_set), @@ -2524,6 +2527,9 @@ ice_prepare_for_reset(struct ice_softc *sc) if (ice_test_state(&sc->state, ICE_STATE_RECOVERY_MODE)) return; + /* Restore identification while the control queues are still usable. */ + ice_led_restore(sc); + /* inform the RDMA client */ ice_rdma_notify_reset(sc); /* stop the RDMA client */ @@ -2718,6 +2724,9 @@ ice_rebuild(struct ice_softc *sc) if (err) goto err_shutdown_ctrlq; + /* Retry a restore which could not complete while reset was pending. */ + ice_led_restore(sc); + err = ice_init_link_events(sc); if (err) { device_printf(dev, "ice_init_link_events failed: %s\n", @@ -3139,6 +3148,7 @@ ice_if_stop(if_ctx_t ctx) struct ice_softc *sc = (struct ice_softc *)iflib_get_softc(ctx); ASSERT_CTX_LOCKED(sc); + ice_led_restore(sc); /* * The iflib core may call IFDI_STOP prior to the first call to @@ -3192,6 +3202,40 @@ ice_if_stop(if_ctx_t ctx) } } +/** + * ice_if_led_func - Control the physical port identification LED + * @ctx: iflib context structure + * @onoff: non-zero to identify the port, zero to restore normal operation + * + * The firmware implements identification as a blinking mode and retains the + * netlist-selected mode so it can be restored without a register snapshot. + */ +static void +ice_if_led_func(if_ctx_t ctx, int onoff) +{ + struct ice_softc *sc = iflib_get_softc(ctx); + enum ice_status status; + bool active; + + active = onoff != 0; + if (active == sc->led_active) + return; + + status = ice_aq_set_port_id_led(sc->hw.port_info, !active, NULL); + if (status == ICE_SUCCESS) + sc->led_active = active; +} + +static void +ice_led_restore(struct ice_softc *sc) +{ + + if (!sc->led_active) + return; + if (ice_aq_set_port_id_led(sc->hw.port_info, true, NULL) == ICE_SUCCESS) + sc->led_active = false; +} + /** * ice_if_get_counter - Get current value of an ifnet statistic * @ctx: iflib context pointer