Commit 8becd196 authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Add tx_resets ring counter

Add a new tx_resets ring counter.  This counter will be saved as
tx_total_resets across any reset.  Since we currently do a full reset
in bnxt_sched_reset_txr(), the per ring counter will always be cleared
during reset.  Only the tx_total_resets count will be meaningful and we
only display this under ethtool -S.

Link: https://lore.kernel.org/netdev/CACKFLimD-bKmJ1tGZOLYRjWzEwxkri-Mw7iFme1x2Dr0twdCeg@mail.gmail.com/Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20230817231911.165035-7-michael.chan@broadcom.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a080b47a
...@@ -9397,6 +9397,8 @@ static void bnxt_disable_napi(struct bnxt *bp) ...@@ -9397,6 +9397,8 @@ static void bnxt_disable_napi(struct bnxt *bp)
struct bnxt_cp_ring_info *cpr; struct bnxt_cp_ring_info *cpr;
cpr = &bnapi->cp_ring; cpr = &bnapi->cp_ring;
if (bnapi->tx_fault)
cpr->sw_stats.tx.tx_resets++;
if (bnapi->in_reset) if (bnapi->in_reset)
cpr->sw_stats.rx.rx_resets++; cpr->sw_stats.rx.rx_resets++;
napi_disable(&bnapi->napi); napi_disable(&bnapi->napi);
...@@ -10951,6 +10953,7 @@ static void bnxt_get_one_ring_err_stats(struct bnxt *bp, ...@@ -10951,6 +10953,7 @@ static void bnxt_get_one_ring_err_stats(struct bnxt *bp,
stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards; stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards;
stats->rx_total_ring_discards += stats->rx_total_ring_discards +=
BNXT_GET_RING_STATS64(hw_stats, rx_discard_pkts); BNXT_GET_RING_STATS64(hw_stats, rx_discard_pkts);
stats->tx_total_resets += sw_stats->tx.tx_resets;
stats->tx_total_ring_discards += stats->tx_total_ring_discards +=
BNXT_GET_RING_STATS64(hw_stats, tx_discard_pkts); BNXT_GET_RING_STATS64(hw_stats, tx_discard_pkts);
stats->total_missed_irqs += sw_stats->cmn.missed_irqs; stats->total_missed_irqs += sw_stats->cmn.missed_irqs;
......
...@@ -939,12 +939,17 @@ struct bnxt_rx_sw_stats { ...@@ -939,12 +939,17 @@ struct bnxt_rx_sw_stats {
u64 rx_netpoll_discards; u64 rx_netpoll_discards;
}; };
struct bnxt_tx_sw_stats {
u64 tx_resets;
};
struct bnxt_cmn_sw_stats { struct bnxt_cmn_sw_stats {
u64 missed_irqs; u64 missed_irqs;
}; };
struct bnxt_sw_stats { struct bnxt_sw_stats {
struct bnxt_rx_sw_stats rx; struct bnxt_rx_sw_stats rx;
struct bnxt_tx_sw_stats tx;
struct bnxt_cmn_sw_stats cmn; struct bnxt_cmn_sw_stats cmn;
}; };
...@@ -955,6 +960,7 @@ struct bnxt_total_ring_err_stats { ...@@ -955,6 +960,7 @@ struct bnxt_total_ring_err_stats {
u64 rx_total_oom_discards; u64 rx_total_oom_discards;
u64 rx_total_netpoll_discards; u64 rx_total_netpoll_discards;
u64 rx_total_ring_discards; u64 rx_total_ring_discards;
u64 tx_total_resets;
u64 tx_total_ring_discards; u64 tx_total_ring_discards;
u64 total_missed_irqs; u64 total_missed_irqs;
}; };
......
...@@ -346,6 +346,7 @@ static const char *const bnxt_ring_err_stats_arr[] = { ...@@ -346,6 +346,7 @@ static const char *const bnxt_ring_err_stats_arr[] = {
"rx_total_oom_discards", "rx_total_oom_discards",
"rx_total_netpoll_discards", "rx_total_netpoll_discards",
"rx_total_ring_discards", "rx_total_ring_discards",
"tx_total_resets",
"tx_total_ring_discards", "tx_total_ring_discards",
"total_missed_irqs", "total_missed_irqs",
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment