aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-10 15:12:43 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-10 16:33:12 +0000
commitff86fd4f36618dacf1628180034c312c70294276 (patch)
treee5ee65024424e6d805262e6e05ed446ff3ff113a
parenta884921abbaf52ff862a32ff6806bf071974faa6 (diff)
ixgbe: Expose EEE LPI event counters
X550-family devices provide clear-on-read counters for transmit and receive Low Power Idle events. Accumulate each register once in the normal statistics poll and expose the monotonic totals below the eee sysctl node. Document the counters together with the existing EEE control. Obtained from: Intel ix 3.4.39 MFC after: 2 weeks
-rw-r--r--share/man/man4/ix.48
-rw-r--r--sys/dev/ixgbe/if_ix.c18
-rw-r--r--sys/dev/ixgbe/ixgbe_type.h2
3 files changed, 27 insertions, 1 deletions
diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4
index 33b723c0fcd2..7177f0f9c962 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 8, 2026
+.Dd August 10, 2026
.Dt IX 4
.Os
.Sh NAME
@@ -242,6 +242,12 @@ Enable firmware logging during driver initialization when set via
.Xr kenv 1 .
.Pp
This feature is only supported on E610 devices.
+.It Va dev.ix.?.eee_state
+Enable or disable Energy Efficient Ethernet on supported devices.
+.It Va dev.ix.?.eee.tx_lpi_count
+Count transmit Low Power Idle events.
+.It Va dev.ix.?.eee.rx_lpi_count
+Count receive Low Power Idle events.
.El
.Sh DIAGNOSTICS
.Bl -diag
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 49b383518df4..ba1f3121ae4f 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -2037,6 +2037,12 @@ ixgbe_update_stats_counters(struct ixgbe_softc *sc)
stats->fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC);
}
+ /* TLPIC and RLPIC are clear-on-read. */
+ if (sc->feat_cap & IXGBE_FEATURE_EEE) {
+ stats->tlpic += IXGBE_READ_REG(hw, IXGBE_TLPIC);
+ stats->rlpic += IXGBE_READ_REG(hw, IXGBE_RLPIC);
+ }
+
/* Fill out the OS statistics structure */
IXGBE_SET_IPACKETS(sc, stats->gprc);
IXGBE_SET_OPACKETS(sc, stats->gptc);
@@ -3679,9 +3685,21 @@ ixgbe_add_device_sysctls(if_ctx_t ctx)
}
if (sc->feat_cap & IXGBE_FEATURE_EEE) {
+ struct sysctl_oid *eee_node;
+ struct sysctl_oid_list *eee_list;
+
SYSCTL_ADD_PROC(ctx_list, child, OID_AUTO, "eee_state",
CTLTYPE_INT | CTLFLAG_RW, sc, 0,
ixgbe_sysctl_eee_state, "I", "EEE Power Save State");
+
+ eee_node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, "eee",
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
+ "Energy Efficient Ethernet statistics");
+ eee_list = SYSCTL_CHILDREN(eee_node);
+ SYSCTL_ADD_UQUAD(ctx_list, eee_list, OID_AUTO, "tx_lpi_count",
+ CTLFLAG_RD, &sc->stats.pf.tlpic, "TX LPI event count");
+ SYSCTL_ADD_UQUAD(ctx_list, eee_list, OID_AUTO, "rx_lpi_count",
+ CTLFLAG_RD, &sc->stats.pf.rlpic, "RX LPI event count");
}
ixgbe_add_debug_sysctls(sc);
diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h
index 80f8effca6d5..648f790194db 100644
--- a/sys/dev/ixgbe/ixgbe_type.h
+++ b/sys/dev/ixgbe/ixgbe_type.h
@@ -3943,6 +3943,8 @@ struct ixgbe_hw_stats {
u64 mlfc;
u64 mrfc;
u64 rlec;
+ u64 tlpic;
+ u64 rlpic;
u64 lxontxc;
u64 lxonrxc;
u64 lxofftxc;