Skip to contentSkip to conversation

net: enetc: improve statistics for v1 and add statistics for v4

PATCH Applied Wei Fang 2 participants 7 messages Apr 8 – Apr 12

Subsystems (4)
lore
Share & tools
lore

Wei Fang

author maintainer
#0 lore raw

cover net: enetc: improve statistics for v1 and add statistics for v4

For ENETC v1, some standardized statistics were redundantly included in the unstructured statistics, so remove these duplicated entries. Previously, the unstructured statistics only contained eMAC data and did not include pMAC data; add pMAC statistics to ensure completeness.

For ENETC v4, the driver previously reported MAC statistics only for the internal ENETC (Pseudo MAC). Extend the implementation to provide additional statistics for both the internal ENETC and the standalone ENETC.

Wei Fang (5):
net: enetc: add support for the standardized counters
net: enetc: show RX drop counters only for assigned RX rings
net: enetc: remove standardized counters from enetc_pm_counters
net: enetc: add unstructured pMAC counters for ENETC v1
net: enetc: add unstructured counters for ENETC v4

 drivers/net/ethernet/freescale/enetc/enetc.h  |   2 +
 .../net/ethernet/freescale/enetc/enetc4_hw.h  | 192 ++++++++
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 427 +++++++++++++-----
 3 files changed, 519 insertions(+), 102 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 1/5 net: enetc: add support for the standardized counters

ENETC v4 provides 64-bit counters for IEEE 802.3 basic and mandatory managed objects, the IETF Management Information Database (MIB) package (RFC2665), and Remote Network Monitoring (RMON) statistics. In addition, some ENETCs support preemption, so these ENETCs have two MACs: MAC 0 is the express MAC (eMAC), MAC 1 is the preemptible MAC (pMAC). Both MACs support these statistics.

---
 drivers/net/ethernet/freescale/enetc/enetc.h  |   2 +
 .../net/ethernet/freescale/enetc/enetc4_hw.h  | 120 +++++++++++++++
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 141 +++++++++++++++---
 3 files changed, 245 insertions(+), 18 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.h +2 -0
index aecd40aeef9c..e663bb5e614e 100644
@@ -264,6 +264,8 @@ struct enetc_msg_swbd {
 };
 
 #define ENETC_REV1	0x1
+#define ENETC_REV4	0x4
+
 enum enetc_errata {
 	ENETC_ERR_VLAN_ISOL	= BIT(0),
 	ENETC_ERR_UCMCSWP	= BIT(1),
drivers/net/ethernet/freescale/enetc/enetc4_hw.h +120 -0

126 lines not on this page · raw message

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +123 -18

226 lines not on this page · raw message

Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/5 net: enetc: show RX drop counters only for assigned RX rings

In reply to Wei Fang

For ENETC v1, each SI provides 16 RBDCR registers for RX ring drop counters, but this does not imply that an SI actually owns 16 RX rings. The ENETC hardware supports a total of 16 RX rings, which are assigned to 3 SIs (1 PSI and 2 VSIs), so each SI is assigned fewer than 16 RX rings.

The current implementation always reports 16 RX drop counters per SI, leading to redundant output for SIs with fewer RX rings. Update the logic to display drop counters only for the RX rings that are actually assigned to the SI.

---
 .../ethernet/freescale/enetc/enetc_ethtool.c   | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +2 -16
index c30a119e9142..36d1a2b810c2 100644
@@ -124,22 +124,6 @@ static const struct {
 	{ ENETC_SITFRM, "SI tx frames" },
 	{ ENETC_SITUCA, "SI tx u-cast frames" },
 	{ ENETC_SITMCA, "SI tx m-cast frames" },
-	{ ENETC_RBDCR(0), "Rx ring  0 discarded frames" },
-	{ ENETC_RBDCR(1), "Rx ring  1 discarded frames" },
-	{ ENETC_RBDCR(2), "Rx ring  2 discarded frames" },
-	{ ENETC_RBDCR(3), "Rx ring  3 discarded frames" },
-	{ ENETC_RBDCR(4), "Rx ring  4 discarded frames" },
-	{ ENETC_RBDCR(5), "Rx ring  5 discarded frames" },
-	{ ENETC_RBDCR(6), "Rx ring  6 discarded frames" },
-	{ ENETC_RBDCR(7), "Rx ring  7 discarded frames" },
-	{ ENETC_RBDCR(8), "Rx ring  8 discarded frames" },
-	{ ENETC_RBDCR(9), "Rx ring  9 discarded frames" },
-	{ ENETC_RBDCR(10), "Rx ring 10 discarded frames" },
-	{ ENETC_RBDCR(11), "Rx ring 11 discarded frames" },
-	{ ENETC_RBDCR(12), "Rx ring 12 discarded frames" },
-	{ ENETC_RBDCR(13), "Rx ring 13 discarded frames" },
-	{ ENETC_RBDCR(14), "Rx ring 14 discarded frames" },
-	{ ENETC_RBDCR(15), "Rx ring 15 discarded frames" },
 };
 
 static const struct {
@@ -224,6 +208,7 @@ static const char rx_ring_stats[][ETH_GSTRING_LEN] = {
 	"Rx ring %2d recycle failures",
 	"Rx ring %2d redirects",
 	"Rx ring %2d redirect failures",
+	"Rx ring %2d discarded frames",
 };
 
 static const char tx_ring_stats[][ETH_GSTRING_LEN] = {
@@ -308,6 +293,7 @@ static void enetc_get_ethtool_stats(struct net_device *ndev,
 		data[o++] = priv->rx_ring[i]->stats.recycle_failures;
 		data[o++] = priv->rx_ring[i]->stats.xdp_redirect;
 		data[o++] = priv->rx_ring[i]->stats.xdp_redirect_failures;
+		data[o++] = enetc_rd(hw, ENETC_RBDCR(i));
 	}
 
 	if (!enetc_si_is_pf(priv->si))
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH 3/5 net: enetc: remove standardized counters from enetc_pm_counters

In reply to Wei Fang

The standardized counters are already exposed via the get_pause_stats(), get_rmon_stats(), get_eth_ctrl_stats() and get_eth_mac_stats() interfaces. Keeping the same counters in enetc_pm_counters results in redundant output.

Remove these standardized counters from enetc_pm_counters and rely on the existing statistics interfaces to report them.

---
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 40 -------------------
 1 file changed, 40 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +0 -40
index 36d1a2b810c2..504def405489 100644
@@ -130,57 +130,17 @@ static const struct {
 	int reg;
 	char name[ETH_GSTRING_LEN] __nonstring;
 } enetc_pm_counters[] = {
-	{ ENETC_PM_REOCT(0),	"MAC rx ethernet octets" },
-	{ ENETC_PM_RALN(0),	"MAC rx alignment errors" },
-	{ ENETC_PM_RXPF(0),	"MAC rx valid pause frames" },
-	{ ENETC_PM_RFRM(0),	"MAC rx valid frames" },
-	{ ENETC_PM_RFCS(0),	"MAC rx fcs errors" },
 	{ ENETC_PM_RVLAN(0),	"MAC rx VLAN frames" },
 	{ ENETC_PM_RERR(0),	"MAC rx frame errors" },
 	{ ENETC_PM_RUCA(0),	"MAC rx unicast frames" },
-	{ ENETC_PM_RMCA(0),	"MAC rx multicast frames" },
-	{ ENETC_PM_RBCA(0),	"MAC rx broadcast frames" },
 	{ ENETC_PM_RDRP(0),	"MAC rx dropped packets" },
 	{ ENETC_PM_RPKT(0),	"MAC rx packets" },
-	{ ENETC_PM_RUND(0),	"MAC rx undersized packets" },
-	{ ENETC_PM_R64(0),	"MAC rx 64 byte packets" },
-	{ ENETC_PM_R127(0),	"MAC rx 65-127 byte packets" },
-	{ ENETC_PM_R255(0),	"MAC rx 128-255 byte packets" },
-	{ ENETC_PM_R511(0),	"MAC rx 256-511 byte packets" },
-	{ ENETC_PM_R1023(0),	"MAC rx 512-1023 byte packets" },
-	{ ENETC_PM_R1522(0),	"MAC rx 1024-1522 byte packets" },
-	{ ENETC_PM_R1523X(0),	"MAC rx 1523 to max-octet packets" },
-	{ ENETC_PM_ROVR(0),	"MAC rx oversized packets" },
-	{ ENETC_PM_RJBR(0),	"MAC rx jabber packets" },
-	{ ENETC_PM_RFRG(0),	"MAC rx fragment packets" },
-	{ ENETC_PM_RCNP(0),	"MAC rx control packets" },
-	{ ENETC_PM_RDRNTP(0),	"MAC rx fifo drop" },
-	{ ENETC_PM_TEOCT(0),	"MAC tx ethernet octets" },
 	{ ENETC_PM_TOCT(0),	"MAC tx octets" },
-	{ ENETC_PM_TCRSE(0),	"MAC tx carrier sense errors" },
-	{ ENETC_PM_TXPF(0),	"MAC tx valid pause frames" },
-	{ ENETC_PM_TFRM(0),	"MAC tx frames" },
 	{ ENETC_PM_TFCS(0),	"MAC tx fcs errors" },
 	{ ENETC_PM_TVLAN(0),	"MAC tx VLAN frames" },
-	{ ENETC_PM_TERR(0),	"MAC tx frame errors" },
 	{ ENETC_PM_TUCA(0),	"MAC tx unicast frames" },
-	{ ENETC_PM_TMCA(0),	"MAC tx multicast frames" },
-	{ ENETC_PM_TBCA(0),	"MAC tx broadcast frames" },
 	{ ENETC_PM_TPKT(0),	"MAC tx packets" },
 	{ ENETC_PM_TUND(0),	"MAC tx undersized packets" },
-	{ ENETC_PM_T64(0),	"MAC tx 64 byte packets" },
-	{ ENETC_PM_T127(0),	"MAC tx 65-127 byte packets" },
-	{ ENETC_PM_T255(0),	"MAC tx 128-255 byte packets" },
-	{ ENETC_PM_T511(0),	"MAC tx 256-511 byte packets" },
-	{ ENETC_PM_T1023(0),	"MAC tx 512-1023 byte packets" },
-	{ ENETC_PM_T1522(0),	"MAC tx 1024-1522 byte packets" },
-	{ ENETC_PM_T1523X(0),	"MAC tx 1523 to max-octet packets" },
-	{ ENETC_PM_TCNP(0),	"MAC tx control packets" },
-	{ ENETC_PM_TDFR(0),	"MAC tx deferred packets" },
-	{ ENETC_PM_TMCOL(0),	"MAC tx multiple collisions" },
-	{ ENETC_PM_TSCOL(0),	"MAC tx single collisions" },
-	{ ENETC_PM_TLCOL(0),	"MAC tx late collisions" },
-	{ ENETC_PM_TECOL(0),	"MAC tx excessive collisions" },
 };
 
 static const struct {
Signature · 1 line
2.34.1
author maintainer
#4 lore raw

PATCH 4/5 net: enetc: add unstructured pMAC counters for ENETC v1

In reply to Wei Fang

The ENETC v1 has two MACs (eMAC and pMAC) to support preemption. The existing unstructured counters include the eMAC counters, but not the pMAC counters. So add pMAC counters to improve statistical coverage.

---
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 77 ++++++++++++++-----
 1 file changed, 56 insertions(+), 21 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +56 -21
index 504def405489..bdc5916e4400 100644
@@ -129,18 +129,35 @@ static const struct {
 static const struct {
 	int reg;
 	char name[ETH_GSTRING_LEN] __nonstring;
-} enetc_pm_counters[] = {
-	{ ENETC_PM_RVLAN(0),	"MAC rx VLAN frames" },
-	{ ENETC_PM_RERR(0),	"MAC rx frame errors" },
-	{ ENETC_PM_RUCA(0),	"MAC rx unicast frames" },
-	{ ENETC_PM_RDRP(0),	"MAC rx dropped packets" },
-	{ ENETC_PM_RPKT(0),	"MAC rx packets" },
-	{ ENETC_PM_TOCT(0),	"MAC tx octets" },
-	{ ENETC_PM_TFCS(0),	"MAC tx fcs errors" },
-	{ ENETC_PM_TVLAN(0),	"MAC tx VLAN frames" },
-	{ ENETC_PM_TUCA(0),	"MAC tx unicast frames" },
-	{ ENETC_PM_TPKT(0),	"MAC tx packets" },
-	{ ENETC_PM_TUND(0),	"MAC tx undersized packets" },
+} enetc_emac_counters[] = {
+	{ ENETC_PM_RVLAN(0),	"eMAC rx VLAN frames" },
+	{ ENETC_PM_RERR(0),	"eMAC rx frame errors" },
+	{ ENETC_PM_RUCA(0),	"eMAC rx unicast frames" },
+	{ ENETC_PM_RDRP(0),	"eMAC rx dropped packets" },
+	{ ENETC_PM_RPKT(0),	"eMAC rx packets" },
+	{ ENETC_PM_TOCT(0),	"eMAC tx octets" },
+	{ ENETC_PM_TFCS(0),	"eMAC tx fcs errors" },
+	{ ENETC_PM_TVLAN(0),	"eMAC tx VLAN frames" },
+	{ ENETC_PM_TUCA(0),	"eMAC tx unicast frames" },
+	{ ENETC_PM_TPKT(0),	"eMAC tx packets" },
+	{ ENETC_PM_TUND(0),	"eMAC tx undersized packets" },
+};
+
+static const struct {
+	int reg;
+	char name[ETH_GSTRING_LEN] __nonstring;
+} enetc_pmac_counters[] = {
+	{ ENETC_PM_RVLAN(1),	"pMAC rx VLAN frames" },
+	{ ENETC_PM_RERR(1),	"pMAC rx frame errors" },
+	{ ENETC_PM_RUCA(1),	"pMAC rx unicast frames" },
+	{ ENETC_PM_RDRP(1),	"pMAC rx dropped packets" },
+	{ ENETC_PM_RPKT(1),	"pMAC rx packets" },
+	{ ENETC_PM_TOCT(1),	"pMAC tx octets" },
+	{ ENETC_PM_TFCS(1),	"pMAC tx fcs errors" },
+	{ ENETC_PM_TVLAN(1),	"pMAC tx VLAN frames" },
+	{ ENETC_PM_TUCA(1),	"pMAC tx unicast frames" },
+	{ ENETC_PM_TPKT(1),	"pMAC tx packets" },
+	{ ENETC_PM_TUND(1),	"pMAC tx undersized packets" },
 };
 
 static const struct {
@@ -181,6 +198,7 @@ static const char tx_ring_stats[][ETH_GSTRING_LEN] = {
 static int enetc_get_sset_count(struct net_device *ndev, int sset)
 {
 	struct enetc_ndev_priv *priv = netdev_priv(ndev);
+	struct enetc_si *si = priv->si;
 	int len;
 
 	if (sset != ETH_SS_STATS)
@@ -190,11 +208,14 @@ static int enetc_get_sset_count(struct net_device *ndev, int sset)
 	      ARRAY_SIZE(tx_ring_stats) * priv->num_tx_rings +
 	      ARRAY_SIZE(rx_ring_stats) * priv->num_rx_rings;
 
-	if (!enetc_si_is_pf(priv->si))
+	if (!enetc_si_is_pf(si))
 		return len;
 
 	len += ARRAY_SIZE(enetc_port_counters);
-	len += ARRAY_SIZE(enetc_pm_counters);
+	len += ARRAY_SIZE(enetc_emac_counters);
+
+	if (si->hw_features & ENETC_SI_F_QBU)
+		len += ARRAY_SIZE(enetc_pmac_counters);
 
 	return len;
 }
@@ -202,6 +223,7 @@ static int enetc_get_sset_count(struct net_device *ndev, int sset)
 static void enetc_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
 {
 	struct enetc_ndev_priv *priv = netdev_priv(ndev);
+	struct enetc_si *si = priv->si;
 	int i, j;
 
 	switch (stringset) {
@@ -215,14 +237,20 @@ static void enetc_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
 			for (j = 0; j < ARRAY_SIZE(rx_ring_stats); j++)
 				ethtool_sprintf(&data, rx_ring_stats[j], i);
 
-		if (!enetc_si_is_pf(priv->si))
+		if (!enetc_si_is_pf(si))
 			break;
 
 		for (i = 0; i < ARRAY_SIZE(enetc_port_counters); i++)
 			ethtool_cpy(&data, enetc_port_counters[i].name);
 
-		for (i = 0; i < ARRAY_SIZE(enetc_pm_counters); i++)
-			ethtool_cpy(&data, enetc_pm_counters[i].name);
+		for (i = 0; i < ARRAY_SIZE(enetc_emac_counters); i++)
+			ethtool_cpy(&data, enetc_emac_counters[i].name);
+
+		if (!(si->hw_features & ENETC_SI_F_QBU))
+			break;
+
+		for (i = 0; i < ARRAY_SIZE(enetc_pmac_counters); i++)
+			ethtool_cpy(&data, enetc_pmac_counters[i].name);
 
 		break;
 	}
@@ -232,7 +260,8 @@ static void enetc_get_ethtool_stats(struct net_device *ndev,
 				    struct ethtool_stats *stats, u64 *data)
 {
 	struct enetc_ndev_priv *priv = netdev_priv(ndev);
-	struct enetc_hw *hw = &priv->si->hw;
+	struct enetc_si *si = priv->si;
+	struct enetc_hw *hw = &si->hw;
 	int i, o = 0;
 
 	for (i = 0; i < ARRAY_SIZE(enetc_si_counters); i++)
@@ -256,14 +285,20 @@ static void enetc_get_ethtool_stats(struct net_device *ndev,
 		data[o++] = enetc_rd(hw, ENETC_RBDCR(i));
 	}
 
-	if (!enetc_si_is_pf(priv->si))
+	if (!enetc_si_is_pf(si))
 		return;
 
 	for (i = 0; i < ARRAY_SIZE(enetc_port_counters); i++)
 		data[o++] = enetc_port_rd(hw, enetc_port_counters[i].reg);
 
-	for (i = 0; i < ARRAY_SIZE(enetc_pm_counters); i++)
-		data[o++] = enetc_port_rd64(hw, enetc_pm_counters[i].reg);
+	for (i = 0; i < ARRAY_SIZE(enetc_emac_counters); i++)
+		data[o++] = enetc_port_rd64(hw, enetc_emac_counters[i].reg);
+
+	if (!(si->hw_features & ENETC_SI_F_QBU))
+		return;
+
+	for (i = 0; i < ARRAY_SIZE(enetc_pmac_counters); i++)
+		data[o++] = enetc_port_rd64(hw, enetc_pmac_counters[i].reg);
 }
 
 static void enetc_pause_stats(struct enetc_si *si, int mac,
Signature · 1 line
2.34.1
author maintainer
#5 lore raw

PATCH 5/5 net: enetc: add unstructured counters for ENETC v4

In reply to Wei Fang

Like ENETC v1, ENETC v4 also has many non-standard counters, so these counters are added to improve statistical coverage.

---
 .../net/ethernet/freescale/enetc/enetc4_hw.h  |  72 +++++++
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 187 +++++++++++++++---
 2 files changed, 234 insertions(+), 25 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc4_hw.h +72 -0
index 392992a646fb..f18437556a0e 100644
@@ -64,6 +64,9 @@
 #define ENETC4_PPAUONTR			0x108
 #define ENETC4_PPAUOFFTR		0x10c
 
+/* Port ingress congestion DRa (a=0,1,2,3) discard count register */
+#define ENETC4_PICDRDCR(a)		((a) * 0x10 + 0x140)
+
 /* Port Station interface promiscuous MAC mode register */
 #define ENETC4_PSIPMMR			0x200
 #define  PSIPMMR_SI_MAC_UP(a)		BIT(a) /* a = SI index */
@@ -72,6 +75,12 @@
 /* Port Station interface promiscuous VLAN mode register */
 #define ENETC4_PSIPVMR			0x204
 
+/* Port broadcast frames dropped due to MAC filtering register */
+#define ENETC4_PBFDSIR			0x208
+
+/* Port frame drop MAC source address pruning register */
+#define ENETC4_PFDMSAPR			0x20c
+
 /* Port RSS key register n. n = 0,1,2,...,9 */
 #define ENETC4_PRSSKR(n)		((n) * 0x4 + 0x250)
 
@@ -79,6 +88,12 @@
 #define ENETC4_PSIMAFCAPR		0x280
 #define  PSIMAFCAPR_NUM_MAC_AFTE	GENMASK(11, 0)
 
+/* Port unicast frames dropped due to MAC filtering register */
+#define ENETC4_PUFDMFR			0x284
+
+/* Port multicast frames dropped due to MAC filtering register */
+#define ENETC4_PMFDMFR			0x288
+
 /* Port station interface VLAN filtering capability register */
 #define ENETC4_PSIVLANFCAPR		0x2c0
 #define  PSIVLANFCAPR_NUM_VLAN_FTE	GENMASK(11, 0)
@@ -87,6 +102,15 @@
 #define ENETC4_PSIVLANFMR		0x2c4
 #define  PSIVLANFMR_VS			BIT(0)
 
+/* Port unicast frames dropped VLAN filtering register */
+#define ENETC4_PUFDVFR			0x2d0
+
+/* Port multicast frames dropped VLAN filtering register */
+#define ENETC4_PMFDVFR			0x2d4
+
+/* Port broadcast frames dropped VLAN filtering register */
+#define ENETC4_PBFDVFR			0x2d8
+
 /* Port Station interface a primary MAC address registers */
 #define ENETC4_PSIPMAR0(a)		((a) * 0x80 + 0x2000)
 #define ENETC4_PSIPMAR1(a)		((a) * 0x80 + 0x2004)
@@ -141,6 +165,18 @@
 #define ENETC4_PSR			0x4104
 #define  PSR_RX_BUSY			BIT(1)
 
+/* Port Rx discard count register */
+#define ENETC4_PRXDCR			0x41c0
+
+/* Port Rx discard count read-reset register */
+#define ENETC4_PRXDCRRR			0x41c4
+
+/* Port Rx discard count reason register 0 */
+#define ENETC4_PRXDCRR0			0x41c8
+
+/* Port Rx discard count reason register 1 */
+#define ENETC4_PRXDCRR1			0x41cc
+
 /* Port traffic class a transmit maximum SDU register */
 #define ENETC4_PTCTMSDUR(a)		((a) * 0x20 + 0x4208)
 #define  PTCTMSDUR_MAXSDU		GENMASK(15, 0)
@@ -199,6 +235,9 @@
 /* Port MAC 0/1 Receive Ethernet Octets Counter */
 #define ENETC4_PM_REOCT(mac)		(0x5100 + (mac) * 0x400)
 
+/* Port MAC 0/1 Receive Octets Counter */
+#define ENETC4_PM_ROCT(mac)		(0x5108 + (mac) * 0x400)
+
 /* Port MAC 0/1 Receive Alignment Error Counter Register */
 #define ENETC4_PM_RALN(mac)		(0x5110 + (mac) * 0x400)
 
@@ -211,12 +250,27 @@
 /* Port MAC 0/1 Receive Frame Check Sequence Error Counter */
 #define ENETC4_PM_RFCS(mac)		(0x5128 + (mac) * 0x400)
 
+/* Port MAC 0/1 Receive VLAN Frame Counter */
+#define ENETC4_PM_RVLAN(mac)		(0x5130 + (mac) * 0x400)
+
+/* Port MAC 0/1 Receive Frame Error Counter */
+#define ENETC4_PM_RERR(mac)		(0x5138 + (mac) * 0x400)
+
+/* Port MAC 0/1 Receive Unicast Frame Counter */
+#define ENETC4_PM_RUCA(mac)		(0x5140 + (mac) * 0x400)
+
 /* Port MAC 0/1 Receive Multicast Frame Counter */
 #define ENETC4_PM_RMCA(mac)		(0x5148 + (mac) * 0x400)
 
 /* Port MAC 0/1 Receive Broadcast Frame Counter */
 #define ENETC4_PM_RBCA(mac)		(0x5150 + (mac) * 0x400)
 
+/* Port MAC 0/1 Receive Dropped Packets Counter */
+#define ENETC4_PM_RDRP(mac)		(0x5158 + (mac) * 0x400)
+
+/* Port MAC 0/1 Receive Packets Counter */
+#define ENETC4_PM_RPKT(mac)		(0x5160 + (mac) * 0x400)
+
 /* Port MAC 0/1 Receive Undersized Packet Counter */
 #define ENETC4_PM_RUND(mac)		(0x5168 + (mac) * 0x400)
 
@@ -259,21 +313,36 @@
 /* Port MAC 0/1 Transmit Ethernet Octets Counter */
 #define ENETC4_PM_TEOCT(mac)		(0x5200 + (mac) * 0x400)
 
+/* Port MAC 0/1 Transmit Octets Counter */
+#define ENETC4_PM_TOCT(mac)		(0x5208 + (mac) * 0x400)
+
 /* Port MAC 0/1 Transmit Valid Pause Frame Counter */
 #define ENETC4_PM_TXPF(mac)		(0x5218 + (mac) * 0x400)
 
 /* Port MAC 0/1 Transmit Frame Counter */
 #define ENETC4_PM_TFRM(mac)		(0x5220 + (mac) * 0x400)
 
+/* Port MAC 0/1 Transmit Frame Check Sequence Error Counter */
+#define ENETC4_PM_TFCS(mac)		(0x5228 + (mac) * 0x400)
+
+/* Port MAC 0/1 Transmit VLAN Frame Counter */
+#define ENETC4_PM_TVLAN(mac)		(0x5230 + (mac) * 0x400)
+
 /* Port MAC 0/1 Transmit Frame Error Counter */
 #define ENETC4_PM_TERR(mac)		(0x5238 + (mac) * 0x400)
 
+/* Port MAC 0/1 Transmit Unicast Frame Counter */
+#define ENETC4_PM_TUCA(mac)		(0x5240 + (mac) * 0x400)
+
 /* Port MAC 0/1 Transmit Multicast Frame Counter */
 #define ENETC4_PM_TMCA(mac)		(0x5248 + (mac) * 0x400)
 
 /* Port MAC 0/1 Transmit Broadcast Frame Counter */
 #define ENETC4_PM_TBCA(mac)		(0x5250 + (mac) * 0x400)
 
+/* Port MAC 0/1 Transmit Packets Counter */
+#define ENETC4_PM_TPKT(mac)		(0x5260 + (mac) * 0x400)
+
 /* Port MAC 0/1 Transmit Undersized Packet Counter */
 #define ENETC4_PM_TUND(mac)		(0x5268 + (mac) * 0x400)
 
@@ -316,6 +385,9 @@
 /* Port MAC 0/1 Transmit Excessive Collisions Counter */
 #define ENETC4_PM_TECOL(mac)		(0x52f0 + (mac) * 0x400)
 
+/* Port MAC 0/1 Transmit Invalid Octets Counter */
+#define ENETC4_PM_TIOCT(mac)		(0x52f8 + (mac) * 0x400)
+
 /* Port MAC 0 Interface Mode Control Register */
 #define ENETC4_PM_IF_MODE(mac)		(0x5300 + (mac) * 0x400)
 #define  PM_IF_MODE_IFMODE		GENMASK(2, 0)
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +162 -25

232 lines not on this page · raw message

Signature · 1 line
2.34.1
#6 lore raw
In reply to Wei Fang
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Wed, 8 Apr 2026 13:58:44 +0800 you wrote:

For ENETC v1, some standardized statistics were redundantly included in the unstructured statistics, so remove these duplicated entries. Previously, the unstructured statistics only contained eMAC data and did not include pMAC data; add pMAC statistics to ensure completeness.

For ENETC v4, the driver previously reported MAC statistics only for the internal ENETC (Pseudo MAC). Extend the implementation to provide additional statistics for both the internal ENETC and the standalone ENETC.

[...]

Here is the summary with links:
- [net-next,1/5] net: enetc: add support for the standardized counters

    https://git.kernel.org/netdev/net-next/c/c6c223fd06ed
  - [net-next,2/5] net: enetc: show RX drop counters only for assigned RX rings
    https://git.kernel.org/netdev/net-next/c/c571d309d4cf
  - [net-next,3/5] net: enetc: remove standardized counters from enetc_pm_counters
    https://git.kernel.org/netdev/net-next/c/6d78c37a73e0
  - [net-next,4/5] net: enetc: add unstructured pMAC counters for ENETC v1
    https://git.kernel.org/netdev/net-next/c/dbc30b154e33
  - [net-next,5/5] net: enetc: add unstructured counters for ENETC v4
    https://git.kernel.org/netdev/net-next/c/98a4f3d34132

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html