Subject: [PATCH net 1/6] bnx2x: properly initialize statistic counters

From: "Dmitry Kravkov" <[email-masked]>
Date: Tue, 16 Jul 2013 18:21:42 +0300

This prevent second statistics query be sent before first one is complete.
This is required since two outstanding queries may cause FW assert.

Signed-off-by: Dmitry Kravkov <[email-masked]>
Signed-off-by: Ariel Elior <[email-masked]>
Signed-off-by: Eilon Greenstein <[email-masked]>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 98366ab..69c4cb6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -1591,10 +1591,16 @@ void bnx2x_stats_init(struct bnx2x *bp)
 {
 	int /*abs*/port = BP_PORT(bp);
 	int mb_idx = BP_FW_MB_IDX(bp);
+	__le16 init_fw_counter = le16_to_cpu(0xFFFF);
+	struct stats_counter *counters = &bp->fw_stats_data->storm_counters;
 
 	bp->stats_pending = 0;
 	bp->executer_idx = 0;
 	bp->stats_counter = 0;
+	counters->xstats_counter = init_fw_counter;
+	counters->tstats_counter = init_fw_counter;
+	counters->ustats_counter = init_fw_counter;
+	counters->cstats_counter = init_fw_counter;
 
 	/* port and func stats for management */
 	if (!BP_NOMCP(bp)) {
-- 
1.8.1.4