Skip to content

Commit 8a27d4b

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Add a software counter for RX ring reset.
Add a per ring rx_resets counter to count these RX resets. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8fbf58e commit 8a27d4b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8770,14 +8770,19 @@ static void bnxt_enable_napi(struct bnxt *bp)
87708770
int i;
87718771

87728772
for (i = 0; i < bp->cp_nr_rings; i++) {
8773-
struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
8774-
bp->bnapi[i]->in_reset = false;
8773+
struct bnxt_napi *bnapi = bp->bnapi[i];
8774+
struct bnxt_cp_ring_info *cpr;
8775+
8776+
cpr = &bnapi->cp_ring;
8777+
if (bnapi->in_reset)
8778+
cpr->sw_stats.rx.rx_resets++;
8779+
bnapi->in_reset = false;
87758780

8776-
if (bp->bnapi[i]->rx_ring) {
8781+
if (bnapi->rx_ring) {
87778782
INIT_WORK(&cpr->dim.work, bnxt_dim_work);
87788783
cpr->dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
87798784
}
8780-
napi_enable(&bp->bnapi[i]->napi);
8785+
napi_enable(&bnapi->napi);
87818786
}
87828787
}
87838788

@@ -10704,6 +10709,7 @@ static void bnxt_rx_ring_reset(struct bnxt *bp)
1070410709
rxr->bnapi->in_reset = false;
1070510710
bnxt_alloc_one_rx_ring(bp, i);
1070610711
cpr = &rxr->bnapi->cp_ring;
10712+
cpr->sw_stats.rx.rx_resets++;
1070710713
if (bp->flags & BNXT_FLAG_AGG_RINGS)
1070810714
bnxt_db_write(bp, &rxr->rx_agg_db, rxr->rx_agg_prod);
1070910715
bnxt_db_write(bp, &rxr->rx_db, rxr->rx_prod);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ struct bnxt_rx_ring_info {
907907

908908
struct bnxt_rx_sw_stats {
909909
u64 rx_l4_csum_errors;
910+
u64 rx_resets;
910911
u64 rx_buf_errors;
911912
};
912913

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static const char * const bnxt_ring_tpa2_stats_str[] = {
178178

179179
static const char * const bnxt_rx_sw_stats_str[] = {
180180
"rx_l4_csum_errors",
181+
"rx_resets",
181182
"rx_buf_errors",
182183
};
183184

0 commit comments

Comments
 (0)