Skip to content

Commit ff20393

Browse files
mindachen1987davem330
authored andcommitted
net: stmmac: mmc_core: Add GMAC mmc tx/rx missing statistics
The missing statistics including Rx_Receive_Error_Packets and Tx_OSize_Packets_Good. Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dfe073f commit ff20393

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/mmc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct stmmac_counters {
5252
unsigned int mmc_tx_excessdef;
5353
unsigned int mmc_tx_pause_frame;
5454
unsigned int mmc_tx_vlan_frame_g;
55+
unsigned int mmc_tx_oversize_g;
5556
unsigned int mmc_tx_lpi_usec;
5657
unsigned int mmc_tx_lpi_tran;
5758

@@ -80,6 +81,7 @@ struct stmmac_counters {
8081
unsigned int mmc_rx_fifo_overflow;
8182
unsigned int mmc_rx_vlan_frames_gb;
8283
unsigned int mmc_rx_watchdog_error;
84+
unsigned int mmc_rx_error;
8385
unsigned int mmc_rx_lpi_usec;
8486
unsigned int mmc_rx_lpi_tran;
8587
unsigned int mmc_rx_discard_frames_gb;

drivers/net/ethernet/stmicro/stmmac/mmc_core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#define MMC_TX_EXCESSDEF 0x6c
5454
#define MMC_TX_PAUSE_FRAME 0x70
5555
#define MMC_TX_VLAN_FRAME_G 0x74
56+
#define MMC_TX_OVERSIZE_G 0x78
5657

5758
/* MMC RX counter registers */
5859
#define MMC_RX_FRAMECOUNT_GB 0x80
@@ -79,6 +80,7 @@
7980
#define MMC_RX_FIFO_OVERFLOW 0xd4
8081
#define MMC_RX_VLAN_FRAMES_GB 0xd8
8182
#define MMC_RX_WATCHDOG_ERROR 0xdc
83+
#define MMC_RX_ERROR 0xe0
8284

8385
#define MMC_TX_LPI_USEC 0xec
8486
#define MMC_TX_LPI_TRAN 0xf0
@@ -289,6 +291,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
289291
mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF);
290292
mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME);
291293
mmc->mmc_tx_vlan_frame_g += readl(mmcaddr + MMC_TX_VLAN_FRAME_G);
294+
mmc->mmc_tx_oversize_g += readl(mmcaddr + MMC_TX_OVERSIZE_G);
292295
mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC);
293296
mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN);
294297

@@ -324,6 +327,7 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
324327
mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW);
325328
mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB);
326329
mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR);
330+
mmc->mmc_rx_error += readl(mmcaddr + MMC_RX_ERROR);
327331
mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC);
328332
mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN);
329333

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static const struct stmmac_stats stmmac_mmc[] = {
212212
STMMAC_MMC_STAT(mmc_tx_excessdef),
213213
STMMAC_MMC_STAT(mmc_tx_pause_frame),
214214
STMMAC_MMC_STAT(mmc_tx_vlan_frame_g),
215+
STMMAC_MMC_STAT(mmc_tx_oversize_g),
215216
STMMAC_MMC_STAT(mmc_tx_lpi_usec),
216217
STMMAC_MMC_STAT(mmc_tx_lpi_tran),
217218
STMMAC_MMC_STAT(mmc_rx_framecount_gb),
@@ -238,6 +239,7 @@ static const struct stmmac_stats stmmac_mmc[] = {
238239
STMMAC_MMC_STAT(mmc_rx_fifo_overflow),
239240
STMMAC_MMC_STAT(mmc_rx_vlan_frames_gb),
240241
STMMAC_MMC_STAT(mmc_rx_watchdog_error),
242+
STMMAC_MMC_STAT(mmc_rx_error),
241243
STMMAC_MMC_STAT(mmc_rx_lpi_usec),
242244
STMMAC_MMC_STAT(mmc_rx_lpi_tran),
243245
STMMAC_MMC_STAT(mmc_rx_discard_frames_gb),

0 commit comments

Comments
 (0)