lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 16 Jul 2013 09:24:30 -0700
From:	Joe Perches <joe@...ches.com>
To:	Dmitry Kravkov <dmitry@...adcom.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net 1/6] bnx2x: properly initialize statistic counters

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.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ