From nobody Tue Aug 18 00:35:09 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 4hP9hY6Lfkz6pcS3 for ; Tue, 18 Aug 2026 00:35: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 4hP9hY3nwjz48tk for ; Tue, 18 Aug 2026 00:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787013309; 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=ypCO9O9W2c3fQWGJp+J8BrgZXiZvBuX/uHwq2cCmS84=; b=glFdP3efohzXb/78FsiJNQd5m4/8YDixurGRH5ZIbQ1oaYt3Yx6fo5uFEy0ccMT/U63pgx VdDw/FlzvpYodn2cnZ911oRUCgBBIlOqjPAwxftUoCqPf43CYSBEKtbEajcT334cXcehWc MWIsFwfL0CiNMB5ug90nA/JPx72ILgK2P5o1hu3GFydkp5RwHoR6O6XGlmw80fiihrNZPx b1mkdgePl65rO2RmFvQU9Zhruotw94vQGiE37SeMCmsYXUGzZrB2/yZbBaBv8lKNdI6uq4 ZB2JhNloPHIO01QTYHzWEbzzNglGEPiLf5wouVJmdR+/Sqr8WL+PvYPMphycQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787013309; a=rsa-sha256; cv=none; b=r09hWdoR5Pwk0hCdMEl31DzeRZ5/CMcXBlMWi1r8z7q3aNHuBzMlW3QeI2yt7Ntg1iYVgr G3dCo3uIhNC7CW0QROu+YUJOSdDWMY2u7IoDt9t8Z2ptpUU8RiB0vh1GVqTaD8ixR5eY8j Pki02hYiI/XcZgov9Jb7uZyXjQiz+6PzJoDA3XiH+GJQ9fM7wqA9gWoU6D20hfm73BPNm6 oGcAeqwQ+S8uBU36Y2PRvqiNY6RbRfhIIRfZlYtEbCAAO+1z2//LhfniKdhnF0Zv1cxOov SiDhmAeRTkDkDF4UXJgU66D/oJDjSh+9JWnWyJOXM2cYT1dyyT8xGMQQnaaNcw== 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=1787013309; 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=ypCO9O9W2c3fQWGJp+J8BrgZXiZvBuX/uHwq2cCmS84=; b=XQxS7KxpzVSH9Lwiz2RJdH/sIp3j3Dt32s+isZ4PWsLqXDYqVUGTo82/MNJJLORfCdKBH8 rOFZlK5yzuCHM50PxjSJM/8eCTF5C3x5AqLYhK0fwwnouAz7S4CD6mH0BMpGjM4xj7dhOy UGtpKVAXJbdzdGD7HlU9h0RhTSEh7zHv3SH+J/6+k4awooOm98TIuyuJzfmvU4kbY1UBrk 1RsbQAhITL14WbPZ28T19GvGVTW7Z0HDptP/NPpznVO/s9aF2Ruk6ZFZfESe/NMXaOitOd EFbwfPljjKQVaLACbJ/Vm6yony5eKu2PgSUTdTDFy0g+QObuxeMqdsuAnOmoYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hP9hY2Wwqz6R3 for ; Tue, 18 Aug 2026 00:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42161 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 18 Aug 2026 00:35:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a781965b91ea - main - ice: Add led(4) identification support 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: a781965b91ea390f9576ae42c35c842db74aab86 Auto-Submitted: auto-generated Date: Tue, 18 Aug 2026 00:35:09 +0000 Message-Id: <6a83a8bd.42161.11e1e6e4@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a781965b91ea390f9576ae42c35c842db74aab86 commit a781965b91ea390f9576ae42c35c842db74aab86 Author: Kevin Bowling AuthorDate: 2026-08-12 01:29:31 +0000 Commit: Kevin Bowling CommitDate: 2026-08-18 00:33:19 +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. MFC after: 2 weeks Sponsored by: BBOX.io --- 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