Skip to content

Commit

Permalink
bnx2x: properly initialize FW stats
Browse files Browse the repository at this point in the history
Client statistics need to be initialized to -1

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dmitry Kravkov authored and David S. Miller committed Oct 6, 2010
1 parent f85582f commit 6fe8bce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/net/bnx2x/bnx2x_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,7 @@ void bnx2x_stats_init(struct bnx2x *bp)
int port = BP_PORT(bp);
int mb_idx = BP_FW_MB_IDX(bp);
int i;
struct eth_stats_query *stats = bnx2x_sp(bp, fw_stats);

bp->stats_pending = 0;
bp->executer_idx = 0;
Expand Down Expand Up @@ -1380,6 +1381,18 @@ void bnx2x_stats_init(struct bnx2x *bp)
memset(&fp->eth_q_stats, 0, sizeof(struct bnx2x_eth_q_stats));
}

for_each_queue(bp, i) {
/* Set initial stats counter in the stats ramrod data to -1 */
int cl_id = bp->fp[i].cl_id;

stats->xstorm_common.client_statistics[cl_id].
stats_counter = 0xffff;
stats->ustorm_common.client_statistics[cl_id].
stats_counter = 0xffff;
stats->tstorm_common.client_statistics[cl_id].
stats_counter = 0xffff;
}

memset(&bp->dev->stats, 0, sizeof(struct net_device_stats));
memset(&bp->eth_stats, 0, sizeof(struct bnx2x_eth_stats));

Expand Down

0 comments on commit 6fe8bce

Please sign in to comment.