From nobody Wed Aug 12 03:11:52 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 4hKYS85Klgz6mBMl for ; Wed, 12 Aug 2026 03:11:52 +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 4hKYS83X83z3kjJ for ; Wed, 12 Aug 2026 03:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786504312; 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=xEsp0C4Fxo8ppv9Zlq1gNgIGlDR45sLaNbgjgYARfLE=; b=YUbg1kVAUdtZ+COrPgYa7YMq1InRRDyTwtyVfiBWcqaFdk/iSG0FPp+G9EnqRDVkiqZJ7O oy/oV5ToBHvfxVa14cI0f1EA5Gaf6U92t1MpZ33d5IaWfTvtAJ2oLKpONbZgFllcBGcbzD NB32mPxsmlrRbr5YziWgbJvrJz+i9aXbj6qLUxGm+qFdKcJiKsQo5OcFbs2EDaXZcNeAji iLWYGf0G2MH4qUokWV8JbGRMbEjV0IN29uwVwlexRUWb0t7iMRJzHJsTh5sKJNBbWrSiaT WVQKhnkuiGZmCVS7mDEsVM1qLcN+Vs1YaHd03kTvzBCNTGLZjLyXWUUAfR+4ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786504312; a=rsa-sha256; cv=none; b=OAwnycNDexUa0hR01s6zHPe8bj6Jvv5nE9J6vlr2hi6L+QVLddD4N3jOyNbETnSz8447y7 tpQD8j3x9xgiQNKq90qZtrEkeQea+mkm8axh/BaMfAHwPQ1rs17HSrF66JHHDB/o7XHQ9A JnN+ujkA7lXiJSsZkjcW95ahuU5y/kNik33F8CRSGxsnf/q0T7YyuapewzrdF+WIyQW3EL jpLDLqURUZccUS11/B4/3jiodX6wWdk2Mx3h7OLfAzQTPMbZTGgsD5GAAUApr7KQNZvYzV siL6Sx1ACOob365rUTXCUlcMYtf9Yn5zBrgynHaYS2CVjVQwnA3kadHRMOZZcQ== 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=1786504312; 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=xEsp0C4Fxo8ppv9Zlq1gNgIGlDR45sLaNbgjgYARfLE=; b=KigZmO5o699/SUDv3L6QziIwS++T+miZAm97ssULczEw0G5L3gb5XByMibhNnxIYulUY2+ CGmA4B/Ot9Vu0uhRe3CC17b+JVRlUji6iZhk5F+BFmIcbQDP9Thj37pzbyMvzvnxQFl2ge JNH9GgkDhw8WZ/QoHNJDAyvDvqvYPO8KRlaHYr2yoaG8FGNl4DfGgB3FevJGV2sDlXgHha bBCmwULcZQ0rKT63fNxyEShsAG2p7xRcFOcIQcdFOHln8A1xb3OoMhvRLppmeRqF8I96t4 qhubM1QSllc5HjJZ00uWLgfZN+gfcr1V4zPh/gcakJ04IS/VfIm8upshZFOOhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hKYS82QT1z1MQc for ; Wed, 12 Aug 2026 03:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38589 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 12 Aug 2026 03:11:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: fb7e249ce4fd - main - ixgbe: 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: fb7e249ce4fd03fe53e4407efe661f9e94852bb6 Auto-Submitted: auto-generated Date: Wed, 12 Aug 2026 03:11:52 +0000 Message-Id: <6a7be478.38589.67aaebbc@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=fb7e249ce4fd03fe53e4407efe661f9e94852bb6 commit fb7e249ce4fd03fe53e4407efe661f9e94852bb6 Author: Kevin Bowling AuthorDate: 2026-08-12 00:54:21 +0000 Commit: Kevin Bowling CommitDate: 2026-08-12 03:06:41 +0000 ixgbe: Add led(4) identification support Expose the physical port identification LED through /dev/led/ix*. Save and restore the NVM-selected LEDCTL value around each request. The X550 operations also clear their PHY manual override before the register is restored. Use the dedicated firmware port-identification command on E610. Its interface selects between firmware blinking and the original mode rather than directly controlling LEDCTL. Restore the normal indication before a device stop or reset. MFC after: 2 weeks --- share/man/man4/ix.4 | 7 ++++++- sys/dev/ixgbe/if_ix.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/ixgbe.h | 2 ++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4 index 7177f0f9c962..433ec164688e 100644 --- a/share/man/man4/ix.4 +++ b/share/man/man4/ix.4 @@ -29,7 +29,7 @@ .\" .\" * Other names and brands may be claimed as the property of others. .\" -.Dd August 10, 2026 +.Dd August 12, 2026 .Dt IX 4 .Os .Sh NAME @@ -56,6 +56,10 @@ The driver provides support for Intel(R) 10Gb Ethernet PCIe adapters. The driver supports Jumbo Frames, MSIX, TSO, and RSS. .Pp +The identification LED for each port is controlled through its +.Pa /dev/led/ix* +device node. +.Pp For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. All hardware requirements listed apply to use with @@ -272,6 +276,7 @@ issue to .Xr altq 4 , .Xr arp 4 , .Xr iflib 4 , +.Xr led 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 8165d18998fd..8610bfad0d4c 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -200,6 +200,8 @@ static void ixgbe_if_vlan_register(if_ctx_t, u16); static void ixgbe_if_vlan_unregister(if_ctx_t, u16); static int ixgbe_if_i2c_req(if_ctx_t, struct ifi2creq *); static bool ixgbe_if_needs_restart(if_ctx_t, enum iflib_restart_event); +static void ixgbe_if_led_func(if_ctx_t, int); +static void ixgbe_led_restore(struct ixgbe_softc *); int ixgbe_intr(void *); static int ixgbe_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); @@ -376,6 +378,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), DEVMETHOD(ifdi_priv_ioctl, ixgbe_if_priv_ioctl), + DEVMETHOD(ifdi_led_func, ixgbe_if_led_func), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -4820,6 +4823,7 @@ ixgbe_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("ixgbe_if_stop: begin\n"); + ixgbe_led_restore(sc); if (sc->feat_en & IXGBE_FEATURE_SRIOV) { ixgbe_disable_mdd(hw); ixgbe_quiesce_vfs(sc); @@ -4845,6 +4849,56 @@ ixgbe_if_stop(if_ctx_t ctx) return; } /* ixgbe_if_stop */ +/* + * Identify the physical port while retaining the NVM-selected LED mode. + * E610 exposes identification through firmware rather than LEDCTL. + */ +static void +ixgbe_if_led_func(if_ctx_t ctx, int onoff) +{ + struct ixgbe_softc *sc; + struct ixgbe_hw *hw; + + sc = iflib_get_softc(ctx); + hw = &sc->hw; + if (!onoff) { + ixgbe_led_restore(sc); + return; + } + if (sc->led_active) + return; + + if (hw->mac.type == ixgbe_mac_E610) { + if (ixgbe_aci_set_port_id_led(hw, false) == IXGBE_SUCCESS) + sc->led_active = true; + return; + } + + sc->ledctl_default = IXGBE_READ_REG(hw, IXGBE_LEDCTL); + if (ixgbe_led_on(hw, hw->mac.led_link_act) == IXGBE_SUCCESS) + sc->led_active = true; +} + +static void +ixgbe_led_restore(struct ixgbe_softc *sc) +{ + struct ixgbe_hw *hw; + + if (!sc->led_active) + return; + + hw = &sc->hw; + if (hw->mac.type == ixgbe_mac_E610) { + (void)ixgbe_aci_set_port_id_led(hw, true); + } else { + /* Clear any PHY manual override before restoring LEDCTL. */ + (void)ixgbe_led_off(hw, hw->mac.led_link_act); + IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, sc->ledctl_default); + IXGBE_WRITE_FLUSH(hw); + } + sc->led_active = false; +} + /************************************************************************ * ixgbe_link_speed_to_str - Convert link speed to string * diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 3d06920352ec..85b8c3480edd 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -441,9 +441,11 @@ struct ixgbe_softc { u32 link_speed; bool link_up; bool link_enabled; + bool led_active; u32 vector; u16 dmac; u32 phy_layer; + u32 ledctl_default; /* Power management-related */ bool wol_support;