From nobody Wed Aug 26 01:07:07 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 4hV61l6LWrz6qLtH for ; Wed, 26 Aug 2026 01:07:07 +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 4hV61l2jGTz42F3 for ; Wed, 26 Aug 2026 01:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787706427; 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=xqLmaBdw4/gL8W13mrvBqV3D6bPA7wiMtBzi6PxqXfw=; b=XVP+X6R/hRpfJixIqdOvT8Rxo5fu0z7P1GfhHkwcP89I5XUZhItMV5uJTs8xDbC8vMEqXN cYClNhC16unHv31C5hngRTmvvKdFNyIVaIXzgr5f45MuG3iclxIG4rF6GZhINEE9xz+v1f V22ri87u8ZHDrlZo1I3Lltu4Ag+sGK4btW8Llzfk1p8mCAzK1Bp6gbyQ4xkLGLoD/aE3Vb WgO2z1Ro4NQxOWjhfvmnhw1gx7m8ur1s0SJuenSBSu6FziXuN8WV8dbrWj+PpglLmvleXg h83DwYY92W5nc/Vlhu4kilg8EfPAUh/68LAYmqfeD/0wFO/l5hMeKoL6S09MMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787706427; a=rsa-sha256; cv=none; b=WeU/pggdcJFyOvb/WBJPN/801K8lEiRAg9LMvTmYtpkY1kjYXtCbNmJk8dYzAd4I49yMHE v7A9QNpm8hha48iXMlcOYqM6rf97NtTVuWUCqZiSJ4tvfJOakLFcefAy8lHs9kZzvTVruw jp33EPH3p2Q3BwWrPBXmVEcYi91nFsMsnuizamw8f86QZha06XBXkT9PowqLb+Z3u1BR7h 5UZcsAv8z3FGpouHJB45DXN0ny8TsbO7ZZfBghyNysRbBAMDtI8613HQxhvHj1aIsYkTLL yPJ9/23EHOwCXthauf7/YAxnf8NFoWdP5uO4JxJx0ly7474/fsADu2GJEmLFiA== 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=1787706427; 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=xqLmaBdw4/gL8W13mrvBqV3D6bPA7wiMtBzi6PxqXfw=; b=aqMXTcSI2IQZDIcogMaI4S7Z76CClxBvJikCMiFXxTvaX1usRXe/+yqyHmPIlD5qPnjrwV iuA+PKUsrJ3rN+xniu3K2REz/n8sLHowSNj2jiE/OTRY0KkMVJ0ebFYXpsOy0C+auAw9LW Ys5DlW17DNBqvMqOBym96lTIcEQvwyE1LHjhtQHoaBFfQIl8qjQpKh7vpDgg2KraWaK4qw jZNMyPcxOetk9tGMDT3XhED6HvLel4JNEVtIaIgPIAB2XW1MklFvBHiVU+LiaQIRFL7M+v fziF1bTNhKrPFRazqUTvwa1rza8g9qBCUZefBOpCsLLQH2JhB3NEy1Atw63sfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hV61l1MwvzxN for ; Wed, 26 Aug 2026 01:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44f1a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Aug 2026 01:07:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 553667cae5ba - stable/14 - ixl: Add led(4) identification support 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 553667cae5baebcbf897d90fdddf583ee881fc46 Auto-Submitted: auto-generated Date: Wed, 26 Aug 2026 01:07:07 +0000 Message-Id: <6a8e3c3b.44f1a.12df85db@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=553667cae5baebcbf897d90fdddf583ee881fc46 commit 553667cae5baebcbf897d90fdddf583ee881fc46 Author: Kevin Bowling AuthorDate: 2026-08-12 00:54:21 +0000 Commit: Kevin Bowling CommitDate: 2026-08-26 01:02:27 +0000 ixl: Add led(4) identification support Expose each physical port identification LED through /dev/led/ixl*. Use the existing GPIO LED helpers for most devices and the PHY provisioning interface for X710 10GBASE-T adapters. Preserve and restore the original GPIO or PHY indication mode, including before the interface is stopped. (cherry picked from commit 8b2e75970c0328e7397290417cc06e9d9c763d2a) --- share/man/man4/ixl.4 | 7 ++++- sys/dev/ixl/if_ixl.c | 78 +++++++++++++++++++++++++++++++++++++++++++++- sys/dev/ixl/ixl_pf.h | 5 +++ sys/dev/ixl/ixl_pf_iflib.c | 2 ++ 4 files changed, 90 insertions(+), 2 deletions(-) diff --git a/share/man/man4/ixl.4 b/share/man/man4/ixl.4 index 37d8c0cf5db8..b9c22e8b9b9c 100644 --- a/share/man/man4/ixl.4 +++ b/share/man/man4/ixl.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd August 9, 2026 +.Dd August 12, 2026 .Dt IXL 4 .Os .Sh NAME @@ -88,6 +88,10 @@ and/or TSO6, and finally LRO can be set and unset. .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Pp +The identification LED for each port is controlled through its +.Pa /dev/led/ixl* +device node. .Ss Additional Utilities There are additional tools available from Intel to help configure and update the adapters covered by this driver. @@ -301,6 +305,7 @@ email all the specific information related to the issue to .Xr arp 4 , .Xr iavf 4 , .Xr iflib 4 , +.Xr led 4 , .Xr netintro 4 , .Xr vlan 4 , .Xr ifconfig 8 , diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index a0e1fefe09fc..3215dd163b72 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -122,6 +122,7 @@ static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); +static void ixl_if_led_func(if_ctx_t ctx, int onoff); #ifdef PCI_IOV static void ixl_if_vflr_handle(if_ctx_t ctx); #endif @@ -193,13 +194,13 @@ static device_method_t ixl_if_methods[] = { DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart), + DEVMETHOD(ifdi_led_func, ixl_if_led_func), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), DEVMETHOD(ifdi_iov_vf_add, ixl_if_iov_vf_add), DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), #endif - // ifdi_led_func // ifdi_debug DEVMETHOD_END }; @@ -1064,6 +1065,7 @@ ixl_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("ixl_if_stop: begin\n"); + ixl_led_restore(pf); if (IXL_PF_IN_RECOVERY_MODE(pf)) return; @@ -1086,6 +1088,80 @@ ixl_if_stop(if_ctx_t ctx) ixl_set_link(pf, false); } +#define IXL_PHY_DEBUG_ALL \ + (I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW | \ + I40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW) + +static bool +ixl_phy_controls_leds(const struct i40e_hw *hw) +{ + + /* These external 10GBASE-T PHYs own the identification LED. */ + return (hw->device_id == I40E_DEV_ID_10G_BASE_T || + hw->device_id == I40E_DEV_ID_10G_BASE_T4); +} + +static void +ixl_if_led_func(if_ctx_t ctx, int onoff) +{ + struct ixl_pf *pf; + struct i40e_hw *hw; + enum i40e_status_code status; + u16 phy_status; + + pf = iflib_get_softc(ctx); + hw = &pf->hw; + if (!onoff) { + ixl_led_restore(pf); + return; + } + if (pf->led_active) + return; + + pf->led_phy_controlled = ixl_phy_controls_leds(hw); + if (!pf->led_phy_controlled) { + pf->led_status = i40e_led_get(hw); + pf->led_active = true; + i40e_led_set(hw, 0xf, false); + return; + } + + if ((hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) == 0) + (void)i40e_aq_set_phy_debug(hw, IXL_PHY_DEBUG_ALL, NULL); + pf->led_phy_addr = I40E_PHY_LED_PROV_REG_1; + status = i40e_led_get_phy(hw, &pf->led_phy_addr, &phy_status); + if (status != I40E_SUCCESS) { + if ((hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) == 0) + (void)i40e_aq_set_phy_debug(hw, 0, NULL); + return; + } + pf->led_status = phy_status; + pf->led_active = true; + status = i40e_led_set_phy(hw, true, pf->led_phy_addr, 0); + if (status != I40E_SUCCESS) + ixl_led_restore(pf); +} + +void +ixl_led_restore(struct ixl_pf *pf) +{ + struct i40e_hw *hw; + + if (!pf->led_active) + return; + + hw = &pf->hw; + if (pf->led_phy_controlled) { + (void)i40e_led_set_phy(hw, false, pf->led_phy_addr, + pf->led_status | I40E_PHY_LED_MODE_ORIG); + if ((hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE) == 0) + (void)i40e_aq_set_phy_debug(hw, 0, NULL); + } else { + i40e_led_set(hw, pf->led_status, false); + } + pf->led_active = false; +} + static int ixl_if_msix_intr_assign(if_ctx_t ctx, int msix) { diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 02d455c806a7..b81799196429 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -136,6 +136,10 @@ struct ixl_pf { #endif u32 state; u8 supported_speeds; + bool led_active; + bool led_phy_controlled; + u16 led_phy_addr; + u32 led_status; struct ixl_pf_qmgr qmgr; struct ixl_pf_qtag qtag; @@ -385,6 +389,7 @@ void ixl_shutdown_hmc(struct ixl_pf *); void ixl_handle_empr_reset(struct ixl_pf *); int ixl_prepare_for_reset(struct ixl_pf *pf, bool is_up); int ixl_rebuild_hw_structs_after_reset(struct ixl_pf *, bool is_up); +void ixl_led_restore(struct ixl_pf *pf); int ixl_pf_reset(struct ixl_pf *); #ifdef PCI_IOV diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index bdacf0cfa06d..90fc85198523 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -944,6 +944,8 @@ ixl_prepare_for_reset(struct ixl_pf *pf, bool is_up) int error, first_error; first_error = 0; + /* Restore identification before the reset tears down AdminQ access. */ + ixl_led_restore(pf); #ifdef PCI_IOV ixl_notify_vfs_reset(pf); error = ixl_quiesce_vfs_for_reset(pf);