public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dmitry Kravkov <dmitry@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net 1/6] bnx2x: properly initialize statistic counters
Date: Tue, 16 Jul 2013 09:24:30 -0700	[thread overview]
Message-ID: <1373991870.1949.3.camel@joe-AO722> (raw)
In-Reply-To: <1373988107-305-2-git-send-email-dmitry@broadcom.com>

On Tue, 2013-07-16 at 18:21 +0300, Dmitry Kravkov wrote:
> This prevent second statistics query be sent before first one is complete.
> This is required since two outstanding queries may cause FW assert.

Please run sparse on your code before submitting patches.

> diff --git 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);

	__le16 init_fw_counter = cpu_to_le16(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;

It might be better to remove init_fw_counter from
stack and use a #define or just use cpu_to_le16(0xffff)
in each init.

  reply	other threads:[~2013-07-16 16:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 15:21 [PATCH net 0/6] bnx2x: fixes Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 1/6] bnx2x: properly initialize statistic counters Dmitry Kravkov
2013-07-16 16:24   ` Joe Perches [this message]
2013-07-16 18:14     ` Dmitry Kravkov
2013-07-16 18:35       ` Joe Perches
2013-07-16 15:21 ` [PATCH net 2/6] bnx2x: prevent statistics update flow to act before statistics are started Dmitry Kravkov
2013-07-16 18:14   ` Sergei Shtylyov
2013-07-16 15:21 ` [PATCH net 3/6] bnx2x: update fairness parameters following DCB negotiation Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 4/6] bnx2x: fix memory leak in VF Dmitry Kravkov
2013-07-16 18:12   ` Sergei Shtylyov
2013-07-16 15:21 ` [PATCH net 5/6] bnx2x: fix PTE write access error Dmitry Kravkov
2013-07-16 15:21 ` [PATCH net 6/6] bnx2x: prevent crash in shutdown flow with CNIC Dmitry Kravkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373991870.1949.3.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=dmitry@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox