Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2013 03:13:58 -0400
From:      Paul A. Patience <paul-a.patience@polymtl.ca>
To:        freebsd-drivers@freebsd.org
Subject:   [patch] sys/dev/nfe/if_nfe.c
Message-ID:  <64bad99f27cc6c5cafd063e2d3232e68@yourdomain.dom>

index | next in thread | raw e-mail

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

--
pap


home | help

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