From nobody Wed Aug 26 00:56:59 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 4hV5p44jMJz6qL7Q for ; Wed, 26 Aug 2026 00:57:00 +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 4hV5p42Dlqz3tw8 for ; Wed, 26 Aug 2026 00:57:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787705820; 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=ARcj+J96i1WCYHsHX/Zt9b7x2dRh7lSZPylkM5iNGyQ=; b=kL03AXF5GzEYWsymEYsG61UCjAo9xEaqxX6wiJPkpopgRpooTMYgV0gt4RHNlviakgFiqD edsUsEWmHVeMlhAR5vSq8ksWs1WDhe+v/6vr1MLMrfK9biXUM2iMqWrdD/eYLkn1NZoThv YH0W59AAsTdy4SfYWkhDPduM19al0hDBSZOSEg4QEREqNa5n0vy4K+nQVAtXHnCZsr8IMO qiRm1vvidVTMPs1eb4Ib7Id+uoCCUgesRtxGwi9MtiKl5O1/i4UBb2hHDuJO2OfjQkVeGW jJmSN7xge15OAhPRZVfIL1vObIqoJsJiRGZid0W/7KWbX5O2LKHrZQAiC37CRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787705820; a=rsa-sha256; cv=none; b=wMfVY/6/xoym8SZYXI8WdG1KS5vjAKHX8CCxfgDdhIXeFjPnsP7Z2LtNJwArqRLy2CrdZj DfO/eMEM42YHq6EhpuwJcHpnNrWuq2LFqcSAGEugrs/em5jiYu4J1SFXmOtVoWPdFKIKin WKeMxmTcHH/Z7qiQHtrnp0lFGQWicvOiChYl9Df2/+rlKeBOpaJtvIajmhjZ+u4+2ZAkrO 6kCUUu9KU0xbLb2ine02RyZvAK1qjsiCPebHfohCTi6i2FPCFojfgD/5jJYNUcijO5EdiQ SX/17oyq/vEmgURAYdrmJdXZU8ITnPNGEgNkyr8VHXmwA3GxRoMf5IKEE9GcmQ== 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=1787705820; 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=ARcj+J96i1WCYHsHX/Zt9b7x2dRh7lSZPylkM5iNGyQ=; b=NeMNRXcQPU2bRWHS88puOgwWwEnSJVRHa+6R1IGh/0OA54yOqozb7fd0HUYJD7eDZKCkeh I0QnqDzbPYhXLgA3B8ntOiMqwp1Wb2gQGijEr1haQeSTdJ/BuKsqtC+94uRqWHfhLZ80yz vnjI4zug/Z3dG/+l2dcKF6GkpZlfsNVbNKAIOTMcmgxB/BAXCCQkhUz+4jQAEd82ikNbDT tPOANUcGt1rByIePo6ysSzv+dYPMh//ilRq0aQbtfUoWZoC1sEnZUVv3GaF4QoNm7cG99r EFJe+affjWySss9NaLODG23sq8kl6vBFbNjU1jdkBPEp+hz19GnyqAVwuHOBSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hV5p36W5WzVW for ; Wed, 26 Aug 2026 00:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43c8a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Aug 2026 00:56:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 37f1ac5b871b - stable/15 - igc: 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/15 X-Git-Reftype: branch X-Git-Commit: 37f1ac5b871b1e53a8f03917662b1e2b4f7eb493 Auto-Submitted: auto-generated Date: Wed, 26 Aug 2026 00:56:59 +0000 Message-Id: <6a8e39db.43c8a.7917b558@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=37f1ac5b871b1e53a8f03917662b1e2b4f7eb493 commit 37f1ac5b871b1e53a8f03917662b1e2b4f7eb493 Author: Kevin Bowling AuthorDate: 2026-08-12 00:22:35 +0000 Commit: Kevin Bowling CommitDate: 2026-08-26 00:56:51 +0000 igc: Add led(4) identification support I225 and I226 expose three programmable LED outputs. Use LED1 for adapter identification, following the convention in DPDK. Preserve the OEM configuration across identification requests. Restore the OEM configuration before a device reset so an active led(4) pattern cannot leave the output overridden across stop or detach. The LED mode values follow the Intel I225 Software User Manual. (cherry picked from commit 19f75b38199b9d30e85fab83e61ff36b0b9ed015) --- share/man/man4/igc.4 | 10 +++++++++- sys/dev/igc/if_igc.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ sys/dev/igc/if_igc.h | 4 ++-- sys/dev/igc/igc_defines.h | 7 +++++-- 4 files changed, 61 insertions(+), 5 deletions(-) diff --git a/share/man/man4/igc.4 b/share/man/man4/igc.4 index 521a36531208..1fe87421738d 100644 --- a/share/man/man4/igc.4 +++ b/share/man/man4/igc.4 @@ -3,7 +3,7 @@ .\" Copyright 2021 Rubicon Communications, LLC (Netgate) .\" SPDX-License-Identifier: BSD-3-Clause .\" -.Dd August 3, 2026 +.Dd August 11, 2026 .Dt IGC 4 .Os .Sh NAME @@ -43,6 +43,13 @@ This driver version supports VLAN hardware insertion / extraction, VLAN checksum offload, and VLAN hardware filtering. For information on enabling VLANs, see .Xr ifconfig 8 . +.Pp +The identification LED of an adapter supported by the +.Nm +driver can be controlled via the +.Xr led 4 +interface at +.Pa /dev/led/igc* . The .Nm driver supports the following media types: @@ -154,6 +161,7 @@ address. .Xr altq 4 , .Xr arp 4 , .Xr iflib 4 , +.Xr led 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 53795c34b135..6722061df54c 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -141,6 +141,8 @@ static bool igc_if_vlan_filter_used(if_ctx_t); static void igc_if_vlan_filter_enable(struct igc_softc *); static void igc_if_vlan_filter_disable(struct igc_softc *); static void igc_setup_vlan_hw_support(if_ctx_t); +static void igc_if_led_func(if_ctx_t, int); +static void igc_led_restore(struct igc_softc *); static void igc_fw_version(struct igc_softc *); static void igc_sbuf_fw_version(struct igc_fw_version *, struct sbuf *); static void igc_print_fw_version(struct igc_softc *); @@ -234,6 +236,7 @@ static device_method_t igc_if_methods[] = { DEVMETHOD(ifdi_tx_queue_intr_enable, igc_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, igc_if_debug), DEVMETHOD(ifdi_needs_restart, igc_if_needs_restart), + DEVMETHOD(ifdi_led_func, igc_if_led_func), DEVMETHOD_END }; @@ -1512,10 +1515,51 @@ igc_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("igc_if_stop: begin"); + igc_led_restore(sc); igc_reset_hw(&sc->hw); IGC_WRITE_REG(&sc->hw, IGC_WUC, 0); } +/* + * I225/I226 have three configurable LED outputs. DPDK uses LED1 for + * adapter identification; retain that convention and preserve the OEM's + * configuration for normal link and activity indication. + */ +static void +igc_if_led_func(if_ctx_t ctx, int onoff) +{ + struct igc_softc *sc; + struct igc_hw *hw; + u32 ledctl; + + sc = iflib_get_softc(ctx); + hw = &sc->hw; + if (onoff) { + if (!sc->led_active) { + sc->ledctl_default = IGC_READ_REG(hw, IGC_LEDCTL); + sc->led_active = true; + } + ledctl = sc->ledctl_default; + ledctl &= ~(IGC_LEDCTL_LED1_MODE_MASK | + IGC_LEDCTL_LED1_BLINK); + ledctl |= IGC_LEDCTL_MODE_LED_ON << + IGC_LEDCTL_LED1_MODE_SHIFT; + IGC_WRITE_REG(hw, IGC_LEDCTL, ledctl); + } else { + igc_led_restore(sc); + } +} + +static void +igc_led_restore(struct igc_softc *sc) +{ + + if (!sc->led_active) + return; + IGC_WRITE_REG(&sc->hw, IGC_LEDCTL, sc->ledctl_default); + sc->led_active = false; +} + /********************************************************************* * * Determine hardware revision. @@ -1903,6 +1947,7 @@ igc_reset(if_ctx_t ctx) u32 pba; INIT_DEBUGOUT("igc_reset: begin"); + igc_led_restore(sc); /* Let the firmware know the OS is in control */ igc_get_hw_control(sc); diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index d9834212fee8..753aec2678e4 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -81,7 +81,6 @@ #include #include -#include #include #include @@ -350,7 +349,8 @@ struct igc_softc { /* FreeBSD operating-system-specific structures. */ struct igc_osdep osdep; device_t dev; - struct cdev *led_dev; + u32 ledctl_default; + bool led_active; struct igc_tx_queue *tx_queues; struct igc_rx_queue *rx_queues; diff --git a/sys/dev/igc/igc_defines.h b/sys/dev/igc/igc_defines.h index 9fc1c72022c3..885f0799f6a6 100644 --- a/sys/dev/igc/igc_defines.h +++ b/sys/dev/igc/igc_defines.h @@ -297,9 +297,12 @@ #define IGC_LEDCTL_LED0_MODE_SHIFT 0 #define IGC_LEDCTL_LED0_IVRT 0x00000040 #define IGC_LEDCTL_LED0_BLINK 0x00000080 +#define IGC_LEDCTL_LED1_MODE_MASK 0x00000F00 +#define IGC_LEDCTL_LED1_MODE_SHIFT 8 +#define IGC_LEDCTL_LED1_BLINK 0x00008000 -#define IGC_LEDCTL_MODE_LED_ON 0xE -#define IGC_LEDCTL_MODE_LED_OFF 0xF +#define IGC_LEDCTL_MODE_LED_ON 0x0 +#define IGC_LEDCTL_MODE_LED_OFF 0x1 /* Transmit Descriptor bit definitions */ #define IGC_TXD_DTYP_D 0x00100000 /* Data Descriptor */