[patch] sys/dev/nfe/if_nfe.c

Yonghyeon PYUN pyunyh at gmail.com
Fri Oct 4 02:27:16 UTC 2013


On Thu, Oct 03, 2013 at 03:13:58AM -0400, Paul A. Patience wrote:
> Hello,
> 
> I _may_ have found another bug in nfe(4).
> If the goal in nfe_stats_clear() is to read all
> the stats registers, then it is doing it wrong.
> It currently reads every fourth register.
> Here is a patch to fix this behaviour:
> 
> --- if_nfe.c.original	Thu Oct  3 03:10:11 2013
> +++ if_nfe.c	Thu Oct  3 03:11:10 2013
> @@ -3205,8 +3205,8 @@
>  	else
>  		return;
>  
> -	for (i = 0; i < mib_cnt; i += sizeof(uint32_t))
> -		NFE_READ(sc, NFE_TX_OCTET + i);
> +	for (i = 0; i < mib_cnt; i++)
> +		NFE_READ(sc, NFE_TX_OCTET + i*sizeof(uint32_t));
>  
>  	if ((sc->nfe_flags & NFE_MIB_V3) != 0) {
>  		NFE_READ(sc, NFE_TX_UNICAST);

Committed in r256038.
Thanks a lot for the fix!


More information about the freebsd-drivers mailing list