Patchwork [net,v3,1/6] bnx2x: properly initialize statistic counters

login
register
mail settings
Submitter Dmitry Kravkov
Date July 17, 2013, 10 p.m.
Message ID <1374098440-27877-2-git-send-email-dmitry@broadcom.com>
Download mbox | patch
Permalink /patch/259778/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Dmitry Kravkov - July 17, 2013, 10 p.m.
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 <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | 5 +++++
 1 file changed, 5 insertions(+)
David Miller - July 18, 2013, 1:16 a.m.
From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Thu, 18 Jul 2013 01:00:35 +0300

>  {
>  	int /*abs*/port = BP_PORT(bp);
>  	int mb_idx = BP_FW_MB_IDX(bp);
> +	struct stats_counter *counters = &bp->fw_stats_data->storm_counters;

Please order local variable declarations from longest to shortest
line.

Thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index 98366ab..7b39424 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -1591,10 +1591,15 @@  void bnx2x_stats_init(struct bnx2x *bp)
 {
 	int /*abs*/port = BP_PORT(bp);
 	int mb_idx = BP_FW_MB_IDX(bp);
+	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 = cpu_to_le16(0xFFFF);
+	counters->tstats_counter = cpu_to_le16(0xFFFF);
+	counters->ustats_counter = cpu_to_le16(0xFFFF);
+	counters->cstats_counter = cpu_to_le16(0xFFFF);
 
 	/* port and func stats for management */
 	if (!BP_NOMCP(bp)) {