Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fe8bce7 authored by Dmitry Kravkov's avatar Dmitry Kravkov Committed by David S. Miller
Browse files

bnx2x: properly initialize FW stats



Client statistics need to be initialized to -1

Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f85582f8
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -1339,6 +1339,7 @@ void bnx2x_stats_init(struct bnx2x *bp)
	int port = BP_PORT(bp);
	int port = BP_PORT(bp);
	int mb_idx = BP_FW_MB_IDX(bp);
	int mb_idx = BP_FW_MB_IDX(bp);
	int i;
	int i;
	struct eth_stats_query *stats = bnx2x_sp(bp, fw_stats);


	bp->stats_pending = 0;
	bp->stats_pending = 0;
	bp->executer_idx = 0;
	bp->executer_idx = 0;
@@ -1380,6 +1381,18 @@ void bnx2x_stats_init(struct bnx2x *bp)
		memset(&fp->eth_q_stats, 0, sizeof(struct bnx2x_eth_q_stats));
		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->dev->stats, 0, sizeof(struct net_device_stats));
	memset(&bp->eth_stats, 0, sizeof(struct bnx2x_eth_stats));
	memset(&bp->eth_stats, 0, sizeof(struct bnx2x_eth_stats));