mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-06 17:43:43 +00:00
net: systemport: fix software maintained statistics
Commit60b4ea1781
("net: systemport: log RX buffer allocation and RX/TX DMA failures") added a few software maintained statistics using BCM_SYSPORT_STAT_MIB_RX and BCM_SYSPORT_STAT_MIB_TX. These statistics are read from the hardware MIB counters, such that bcm_sysport_update_mib_counters() was trying to read from a non-existing MIB offset for these counters. Fix this by introducing a special type: BCM_SYSPORT_STAT_SOFT, similar to BCM_SYSPORT_STAT_NETDEV, such that bcm_sysport_get_ethtool_stats will read from the software mib. Fixes:60b4ea1781
("net: systemport: log RX buffer allocation and RX/TX DMA failures") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f62ba9c14b
commit
55ff4ea9a8
@ -274,9 +274,9 @@ static const struct bcm_sysport_stats bcm_sysport_gstrings_stats[] = {
|
||||
/* RBUF misc statistics */
|
||||
STAT_RBUF("rbuf_ovflow_cnt", mib.rbuf_ovflow_cnt, RBUF_OVFL_DISC_CNTR),
|
||||
STAT_RBUF("rbuf_err_cnt", mib.rbuf_err_cnt, RBUF_ERR_PKT_CNTR),
|
||||
STAT_MIB_RX("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
|
||||
STAT_MIB_RX("rx_dma_failed", mib.rx_dma_failed),
|
||||
STAT_MIB_TX("tx_dma_failed", mib.tx_dma_failed),
|
||||
STAT_MIB_SOFT("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
|
||||
STAT_MIB_SOFT("rx_dma_failed", mib.rx_dma_failed),
|
||||
STAT_MIB_SOFT("tx_dma_failed", mib.tx_dma_failed),
|
||||
};
|
||||
|
||||
#define BCM_SYSPORT_STATS_LEN ARRAY_SIZE(bcm_sysport_gstrings_stats)
|
||||
@ -345,6 +345,7 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv)
|
||||
s = &bcm_sysport_gstrings_stats[i];
|
||||
switch (s->type) {
|
||||
case BCM_SYSPORT_STAT_NETDEV:
|
||||
case BCM_SYSPORT_STAT_SOFT:
|
||||
continue;
|
||||
case BCM_SYSPORT_STAT_MIB_RX:
|
||||
case BCM_SYSPORT_STAT_MIB_TX:
|
||||
|
@ -570,6 +570,7 @@ enum bcm_sysport_stat_type {
|
||||
BCM_SYSPORT_STAT_RUNT,
|
||||
BCM_SYSPORT_STAT_RXCHK,
|
||||
BCM_SYSPORT_STAT_RBUF,
|
||||
BCM_SYSPORT_STAT_SOFT,
|
||||
};
|
||||
|
||||
/* Macros to help define ethtool statistics */
|
||||
@ -590,6 +591,7 @@ enum bcm_sysport_stat_type {
|
||||
#define STAT_MIB_RX(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_MIB_RX)
|
||||
#define STAT_MIB_TX(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_MIB_TX)
|
||||
#define STAT_RUNT(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_RUNT)
|
||||
#define STAT_MIB_SOFT(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_SOFT)
|
||||
|
||||
#define STAT_RXCHK(str, m, ofs) { \
|
||||
.stat_string = str, \
|
||||
|
Loading…
Reference in New Issue
Block a user