git: 2726df27627b - stable/14 - e1000: Add sysctls for some missing MAC stats

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Wed, 02 Oct 2024 19:53:17 UTC
The branch stable/14 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=2726df27627b4674246db5e56cb3ec98f797b587

commit 2726df27627b4674246db5e56cb3ec98f797b587
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2024-09-24 09:39:33 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2024-10-02 19:51:43 +0000

    e1000: Add sysctls for some missing MAC stats
    
    Sponsored by:   Blue Box Systems
    
    (cherry picked from commit aa7d086ad94642fa40375db9976177fc9e54a2cf)
---
 sys/dev/e1000/if_em.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index e2d8535143ef..5fb46c9f6dce 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -4304,6 +4304,10 @@ em_update_stats_counters(struct e1000_softc *sc)
 	sc->stats.roc += E1000_READ_REG(&sc->hw, E1000_ROC);
 	sc->stats.rjc += E1000_READ_REG(&sc->hw, E1000_RJC);
 
+	sc->stats.mgprc += E1000_READ_REG(&sc->hw, E1000_MGTPRC);
+	sc->stats.mgpdc += E1000_READ_REG(&sc->hw, E1000_MGTPDC);
+	sc->stats.mgptc += E1000_READ_REG(&sc->hw, E1000_MGTPTC);
+
 	sc->stats.tor += E1000_READ_REG(&sc->hw, E1000_TORH);
 	sc->stats.tot += E1000_READ_REG(&sc->hw, E1000_TOTH);
 
@@ -4520,6 +4524,9 @@ em_add_hw_stats(struct e1000_softc *sc)
 	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "missed_packets",
 			CTLFLAG_RD, &sc->stats.mpc,
 			"Missed Packets");
+	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_length_errors",
+			CTLFLAG_RD, &sc->stats.rlec,
+			"Receive Length Errors");
 	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "recv_no_buff",
 			CTLFLAG_RD, &sc->stats.rnbc,
 			"Receive No Buffers");
@@ -4560,6 +4567,18 @@ em_add_hw_stats(struct e1000_softc *sc)
 	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "xoff_txd",
 			CTLFLAG_RD, &sc->stats.xofftxc,
 			"XOFF Transmitted");
+	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "unsupported_fc_recvd",
+			CTLFLAG_RD, &sc->stats.fcruc,
+			"Unsupported Flow Control Received");
+	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_recvd",
+			CTLFLAG_RD, &sc->stats.mgprc,
+			"Management Packets Received");
+	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_drop",
+			CTLFLAG_RD, &sc->stats.mgpdc,
+			"Management Packets Dropped");
+	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mgmt_pkts_txd",
+			CTLFLAG_RD, &sc->stats.mgptc,
+			"Management Packets Transmitted");
 
 	/* Packet Reception Stats */
 	SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "total_pkts_recvd",