Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2013 11:27:12 +0900
From:      Yonghyeon PYUN <pyunyh@gmail.com>
To:        "Paul A. Patience" <paul-a.patience@polymtl.ca>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: [patch] sys/dev/nfe/if_nfe.c
Message-ID:  <20131004022712.GB3091@michelle.cdnetworks.com>
In-Reply-To: <64bad99f27cc6c5cafd063e2d3232e68@yourdomain.dom>

index | next in thread | previous in thread | raw e-mail

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!


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131004022712.GB3091>