Skip to content

Commit 7e68708

Browse files
committed
Merge branch 'stmmac-missing-stats-DW-GMAC'
Minda Chen says: ==================== Add missing mmc statistics in DW GMAC Add miss MMC statistic in DW GMAC base on 6.9-rc1 changed v2: patch2 : remove mmc_rx_control_g due to it is gotten in ethtool_ops::get_eth_ctrl_stats. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 49563be + ff20393 commit 7e68708

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-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: 15 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,13 @@
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
84+
85+
#define MMC_TX_LPI_USEC 0xec
86+
#define MMC_TX_LPI_TRAN 0xf0
87+
#define MMC_RX_LPI_USEC 0xf4
88+
#define MMC_RX_LPI_TRAN 0xf8
89+
8290
/* IPC*/
8391
#define MMC_RX_IPC_INTR_MASK 0x100
8492
#define MMC_RX_IPC_INTR 0x108
@@ -283,6 +291,9 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
283291
mmc->mmc_tx_excessdef += readl(mmcaddr + MMC_TX_EXCESSDEF);
284292
mmc->mmc_tx_pause_frame += readl(mmcaddr + MMC_TX_PAUSE_FRAME);
285293
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);
295+
mmc->mmc_tx_lpi_usec += readl(mmcaddr + MMC_TX_LPI_USEC);
296+
mmc->mmc_tx_lpi_tran += readl(mmcaddr + MMC_TX_LPI_TRAN);
286297

287298
/* MMC RX counter registers */
288299
mmc->mmc_rx_framecount_gb += readl(mmcaddr + MMC_RX_FRAMECOUNT_GB);
@@ -316,6 +327,10 @@ static void dwmac_mmc_read(void __iomem *mmcaddr, struct stmmac_counters *mmc)
316327
mmc->mmc_rx_fifo_overflow += readl(mmcaddr + MMC_RX_FIFO_OVERFLOW);
317328
mmc->mmc_rx_vlan_frames_gb += readl(mmcaddr + MMC_RX_VLAN_FRAMES_GB);
318329
mmc->mmc_rx_watchdog_error += readl(mmcaddr + MMC_RX_WATCHDOG_ERROR);
330+
mmc->mmc_rx_error += readl(mmcaddr + MMC_RX_ERROR);
331+
mmc->mmc_rx_lpi_usec += readl(mmcaddr + MMC_RX_LPI_USEC);
332+
mmc->mmc_rx_lpi_tran += readl(mmcaddr + MMC_RX_LPI_TRAN);
333+
319334
/* IPv4 */
320335
mmc->mmc_rx_ipv4_gd += readl(mmcaddr + MMC_RX_IPV4_GD);
321336
mmc->mmc_rx_ipv4_hderr += readl(mmcaddr + MMC_RX_IPV4_HDERR);

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)