Date: Mon, 31 Aug 2009 20:15:53 +0100 From: Andrew Brampton <brampton+freebsd-hackers@gmail.com> To: John Baldwin <jhb@freebsd.org> Cc: jfv@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: netstat -i Ierrs column, Is it total, or per second? Message-ID: <d41814900908311215o24cbded5y4c8dcb14ece5f670@mail.gmail.com> In-Reply-To: <200908310804.27417.jhb@freebsd.org> References: <d41814900908310318n113867dsf9e47f149b0e61b4@mail.gmail.com> <200908310804.27417.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--001517473652d794ef047274dcf6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2009/8/31 John Baldwin <jhb@freebsd.org>: > It should be total and it sounds like a bug in the device driver. =C2=A0I= t looks > like ixgbe_update_stats_counters() overwrites the accumulated value of > if_ierrors: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Rx Errors */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0ifp->if_ierrors =3D total_missed_rx + adapter-= >stats.crcerrs + > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0adapter->stats.rle= c; > > It also increments if_ierrors in ixgbe_rxeof(). =C2=A0The driver should o= nly do one > or the other, but probably not both. > > -- > John Baldwin > Thanks for your reply. I had wondered that, but looking at e1000/if_em.c it does a similar thing. However, a quick look at non-intel drivers and it seems others don't. So perhaps this is a problem across the intel drivers? So anyway I spent my afternoon reading the ixgbe spec sheet and creating the attached patch, which hopefully fixes this problem. I will forward this patch to freebsd <at> intel.com unless someone can point me toward the maintainers email address, or should I just create a PR? thanks Andrew --001517473652d794ef047274dcf6 Content-Type: text/plain; charset=US-ASCII; name="freebsd-ixgbe.ierrors.patch.txt" Content-Disposition: attachment; filename="freebsd-ixgbe.ierrors.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fz1lbj720 ZGlmZiAtdSBpeGdiZS5vbGQvaXhnYmUuYyBpeGdiZS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UkVHKGh3LCBJWEdCRV9FUlJCQyk7CiAKIAlm b3IgKGludCBpID0gMDsgaSA8IDg7IGkrKykgewogCQlpbnQgbXA7CiAJCW1wID0gSVhHQkVfUkVB RF9SRUcoaHcsIElYR0JFX01QQyhpKSk7CiAJCW1pc3NlZF9yeCArPSBtcDsKICAgICAgICAgCWFk YXB0ZXItPnN0YXRzLm1wY1tpXSArPSBtcDsKKyAgICAgICAgCWFkYXB0ZXItPnN0YXRzLm1wY3Rv dGFsICs9IG1wOwogCQlhZGFwdGVyLT5zdGF0cy5ybmJjW2ldICs9IElYR0JFX1JFQURfUkVHKGh3 LCBJWEdCRV9STkJDKGkpKTsKIAl9CiAKQEAgLTQ1MzIsOCArNDUzNSwxMSBAQAogCWlmcC0+aWZf Y29sbGlzaW9ucyA9IDA7CiAKIAkvKiBSeCBFcnJvcnMgKi8KLQlpZnAtPmlmX2llcnJvcnMgPSBt aXNzZWRfcnggKyBhZGFwdGVyLT5zdGF0cy5jcmNlcnJzICsKLQkJYWRhcHRlci0+c3RhdHMucmxl YzsKKwlpZnAtPmlmX2llcnJvcnMgPSBhZGFwdGVyLT5zdGF0cy5tcGN0b3RhbCArCisJICAgICAg ICAgICAgICAgICAgYWRhcHRlci0+c3RhdHMuY3JjZXJycyArCisJICAgICAgICAgICAgICAgICAg YWRhcHRlci0+c3RhdHMuaWxsZXJyYyArCisJICAgICAgICAgICAgICAgICAgYWRhcHRlci0+c3Rh dHMuZXJyYmMgKworCSAgICAgICAgICAgICAgICAgIGFkYXB0ZXItPnN0YXRzLnJsZWM7CiB9Cgo= --001517473652d794ef047274dcf6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d41814900908311215o24cbded5y4c8dcb14ece5f670>