From nobody Wed Aug 26 00:59:43 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 4hV5sD0N04z6qL9J for ; Wed, 26 Aug 2026 00:59:44 +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 4hV5sC6vfmz410q for ; Wed, 26 Aug 2026 00:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787705984; 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=8CxhW7o3KTGFymLLSZ715OFT/SN7xWR3Xl9WV5jGyRE=; b=GCRsoUM6kl8qaU0TqxQ6HZeDtVOn64W36IVlqqMK+0tMuSL9w7saOuRRFFiY7yCvkK+7Jo a00EsbMTqPyOPuLG95HxM8vL97yKdjBNTYdci7KQTM3NrAv3zm4q3dIuCdD32gChCJ4KV8 vZbrfWvbHtsGsea3Q4irjqO9NlW7bewYqnrmIMuAM6dXn3z2t7s/R9w9Pvn6kjMbk3akVe IX8n94PR3u0rW5M+NwYO7MjWkV9PWIpzYZga5YlS2RF1SgKq0RGSRdSIx7Kdx/DrWrDvxF CxIUS0gsMx14vFEc8K9WP8bQw2dR7DZO/YRpHPG4d1LJoIeo0oXHiGLptI1ZSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787705984; a=rsa-sha256; cv=none; b=gbWkFqSq9b1t/UP1YxzcCF4fr4B26OUX4T1sw8EMWA54E5kpeo/UFi1h2EKo5cw5w+ybDj YIKZ+Rs07ryNu8F1oZcqLyinHLPtjde8r94AqTkEQRnYClrm8mvh3r/FaUeNxTgcF4j7vI N0oLWIrNKcdveuAomOVwHZH6wsqPqd//HNUJXymSw1kGEsYC0SBeXdoAF4gieVC+Y9pZIM IN2OLAqpEYmwBVc3kAJ4Fq1OiqSytLfWYkPN5Yy091AH50vHiau2zGK4ILpbsypPyM/Whp s9nTIC+/gFRMq0g2X1PLmXKeGOIqrR0z/EA0m8y8FNFufn+Q8RQzj6epOVOXvw== 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=1787705984; 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=8CxhW7o3KTGFymLLSZ715OFT/SN7xWR3Xl9WV5jGyRE=; b=COP+TntP4nE7EaChHAgXQfXpb6+4MY0Oo/thnkhmIwCT/PuzdEaZwvGKLIrkY5Iyj9H+Za h9n4Yzth3eM2TV+StuDz/sGHFoGVYSj8XX2llTZP5AP7dRVV5D4A6L7p9VQJ15dFB1XOLe mQBCFFO2/7282+CmQcaGWuG2nrft3eAqGxarAfCjKHhAK8HmGbgMmCyMRK5rC3qL4RWhpO vlOiMRNjtA/h6LoTqLHAxGEUdBGu3vPAC9jCx1fhC7oSXK6zagQTMQncUonCC+5XorIBhO GHTPK7gYMsfp8lqIkNgY31MPUdDCh7mQ7XZFOgh8xTxTcVZtSGCTWNV9E/7KVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hV5sC5Vqgz19R for ; Wed, 26 Aug 2026 00:59:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43158 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 26 Aug 2026 00:59:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 34817fae3a2c - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 34817fae3a2cd1aa1718c2cc25a49e66b1d38617 Auto-Submitted: auto-generated Date: Wed, 26 Aug 2026 00:59:43 +0000 Message-Id: <6a8e3a7f.43158.41684383@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=34817fae3a2cd1aa1718c2cc25a49e66b1d38617 commit 34817fae3a2cd1aa1718c2cc25a49e66b1d38617 Author: Kevin Bowling AuthorDate: 2026-08-12 00:22:35 +0000 Commit: Kevin Bowling CommitDate: 2026-08-26 00:59:32 +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 */