From nobody Wed Aug 12 03:20:22 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 4hKYdy5YWZz6mBxD for ; Wed, 12 Aug 2026 03:20:22 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hKYdy4rL4z3lcG for ; Wed, 12 Aug 2026 03:20:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786504822; 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=mBKsl/jOl6bs4Zkwrb+eFdrvl8rojs9WiswIp+ahVjM=; b=NmJ4LHzpc2suenfyX/796Y1DCEv00IeAvrDTWHr8R6laRUNysKO1h6m+Gyu+DGlJ5B7iNC E91s/kboCftI3YxjICOtNcTyIIuJ6pBVxDh35MQHO5L6GOxRqRBccxYQrqXHXrBe4pefmt NUZK1HROjIADdl7C1VspJ1MQuN8BsgJVoxna5ToAtRjtJTpF4Y+KK9Gp1ut3a+qfcvCEHS CLA9CqD3h+VQG5LPokATTN+Tcdt2HYQa6hDA2luTnLFDT+9Lt1yjOZp2KvhGvXhgaHhBrV goEeUsGUmdJ74ZXmKEN0a7It6/CsIUNjqwmgecukF6Wz1tODrWcEuEFtTZtSAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786504822; a=rsa-sha256; cv=none; b=QP0dAIqi11pkeTRAjAJs9HUFUyamr2l+kNaWfFs2UtXqgJ9aUaZreKE3LCjH6ikuODmhNi lAqEoBz8YYcM2O7Wvv9KMzc1g/5wlrAQS9rmGc228bJvwHZ5LEpz0NA0klka+c6ZVLHoWp htWEC/wK+oIzogSr82O8wVP+vkpsFbhOGwW5LcPDgJ96hyd66ggSsCCx8BpM8wKorpt6VD XG/u8SCEp81txfXhEOxz2V3aL2XfI4rPaeS0AzSs41AqVUO0gQ35ok88CHt6GVOqpd7+SV hn6VuAx0OphpZnL+/cj96AKz6EiMzhSrDhj3w/jfW4QeFfyuIklYYkLDFq4KmA== 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=1786504822; 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=mBKsl/jOl6bs4Zkwrb+eFdrvl8rojs9WiswIp+ahVjM=; b=ugUyknYjN8iS51pS8ct2x7KX7xB2Vt4jV9kuIGunIzyOgKEe436uHeVFswPnFwDQKRZa6i nbnykdjXLkNpLZN+igl1yHsGJauNVGcW/rDV1ZxsCFmLZGp2bXn9de3SJiTBpiABY2TD+G xbhddNoTpegGpL7PSbHdt8rAi2FhGcITxv1tPKonLd3sUQQKY+BS5WzvX4UB/rkmvJM4hJ RppoSx7QZNyPjn0o58fa2V7VrckVan9/0KVW9nwnI70UWgCOwr4g7xC0Wd2HAYinbsK8rZ aL1gaHZ9lcmPiMpbHMVJQaOA5GxO1+o2S10otykMJmwWXo2vEOmXIx6CpN59/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hKYdy3bj4z1M5Q for ; Wed, 12 Aug 2026 03:20:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 388a7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 12 Aug 2026 03:20:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 8b2e75970c03 - main - ixl: 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: 8b2e75970c0328e7397290417cc06e9d9c763d2a Auto-Submitted: auto-generated Date: Wed, 12 Aug 2026 03:20:22 +0000 Message-Id: <6a7be676.388a7.390be8b3@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2e75970c0328e7397290417cc06e9d9c763d2a commit 8b2e75970c0328e7397290417cc06e9d9c763d2a Author: Kevin Bowling AuthorDate: 2026-08-12 00:54:21 +0000 Commit: Kevin Bowling CommitDate: 2026-08-12 03:16:08 +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. MFC after: 2 weeks --- 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 953882287386..886a4e52303c 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 }; @@ -1063,6 +1064,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; @@ -1085,6 +1087,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 74e1cad79731..7d751d3bd1dc 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -137,6 +137,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; @@ -388,6 +392,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);