git: 13d78e4b9d0a - main - igc: Export EEE Low Power Idle counters

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Tue, 11 Aug 2026 21:00:11 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=13d78e4b9d0a27128319a1241f00f7ab9aa864bb

commit 13d78e4b9d0a27128319a1241f00f7ab9aa864bb
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-11 19:39:52 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-11 20:59:33 +0000

    igc: Export EEE Low Power Idle counters
    
    The driver already accumulates the clear-on-read transmit and receive
    LPI event counters.  Expose the 64-bit totals under the per-device eee
    sysctl node.
    
    MFC after:      2 weeks
---
 sys/dev/igc/if_igc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c
index a06caaaceeab..8753209e8ea6 100644
--- a/sys/dev/igc/if_igc.c
+++ b/sys/dev/igc/if_igc.c
@@ -2856,8 +2856,8 @@ igc_add_hw_stats(struct igc_softc *sc)
 	struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
 	struct igc_hw_stats *stats = &sc->stats;
 
-	struct sysctl_oid *stat_node, *queue_node, *int_node;
-	struct sysctl_oid_list *stat_list, *queue_list, *int_list;
+	struct sysctl_oid *eee_node, *stat_node, *queue_node, *int_node;
+	struct sysctl_oid_list *eee_list, *stat_list, *queue_list, *int_list;
 
 #define QUEUE_NAME_LEN 32
 	char namebuf[QUEUE_NAME_LEN];
@@ -2886,6 +2886,14 @@ igc_add_hw_stats(struct igc_softc *sc)
 	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "fc_low_water",
 	    CTLFLAG_RD, &sc->hw.fc.low_water, 0,
 	    "Flow Control Low Watermark");
+	eee_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "eee",
+	    CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
+	    "Energy Efficient Ethernet statistics");
+	eee_list = SYSCTL_CHILDREN(eee_node);
+	SYSCTL_ADD_UQUAD(ctx, eee_list, OID_AUTO, "tx_lpi_count",
+	    CTLFLAG_RD, &stats->tlpic, "TX LPI event count");
+	SYSCTL_ADD_UQUAD(ctx, eee_list, OID_AUTO, "rx_lpi_count",
+	    CTLFLAG_RD, &stats->rlpic, "RX LPI event count");
 
 	for (int i = 0; i < sc->tx_num_queues; i++, tx_que++) {
 		struct tx_ring *txr = &tx_que->txr;