From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Kleine-Budde Subject: Re: [PATCH 3/6] can: janz-ican3: fix error and byte counters Date: Thu, 19 Jul 2012 21:32:23 +0200 Message-ID: <500860C7.7080603@pengutronix.de> References: <20120719155026.GG25905@ovro.caltech.edu> <1342713258-14822-1-git-send-email-iws@ovro.caltech.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig78F0B4F7711E48B33AD7BB51" Return-path: Received: from metis.ext.pengutronix.de ([92.198.50.35]:33310 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031Ab2GSTcb (ORCPT ); Thu, 19 Jul 2012 15:32:31 -0400 In-Reply-To: <1342713258-14822-1-git-send-email-iws@ovro.caltech.edu> Sender: linux-can-owner@vger.kernel.org List-ID: To: "Ira W. Snyder" Cc: linux-can@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig78F0B4F7711E48B33AD7BB51 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 07/19/2012 05:54 PM, Ira W. Snyder wrote: > From: "Ira W. Snyder" >=20 > The error and byte counter statistics were being incremented > incorrectly. For example, a TX error would be counted both in tx_errors= > and rx_errors. >=20 > This corrects the problem so that tx_errors and rx_errors are only > incremented for errors caused by packets sent to the bus. Error packets= > generated by the driver are not counted. >=20 > The byte counters are only increased for packets which are actually > transmitted or received from the bus. Error packets generated by the > driver are not counted. >=20 > Signed-off-by: Ira W. Snyder > --- >=20 > Changes for this version: > - for RX overflow errors, both rx_over_errors and rx_errors are increme= nted >=20 > drivers/net/can/janz-ican3.c | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.= c > index ea1919e..14d5abc 100644 > --- a/drivers/net/can/janz-ican3.c > +++ b/drivers/net/can/janz-ican3.c > @@ -907,8 +907,8 @@ static void ican3_handle_msglost(struct ican3_dev *= mod, struct ican3_msg *msg) > if (skb) { > cf->can_id |=3D CAN_ERR_CRTL; > cf->data[1] =3D CAN_ERR_CRTL_RX_OVERFLOW; > + stats->rx_over_errors++; > stats->rx_errors++; > - stats->rx_bytes +=3D cf->can_dlc; > netif_rx(skb); > } > } > @@ -982,7 +982,6 @@ static int ican3_handle_cevtind(struct ican3_dev *m= od, struct ican3_msg *msg) > =20 > dev_dbg(mod->dev, "bus error interrupt\n"); > mod->can.can_stats.bus_error++; > - stats->rx_errors++; ^^^^^^^^^^^^^^^^^^ What about this one? Accidentally removed? Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de | --------------enig78F0B4F7711E48B33AD7BB51 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAIYMsACgkQjTAFq1RaXHMqCgCdHFVh86lx6QCT5J6Kd7dXq8Bs BuEAn25wZS0VNMLK+kHwwgIx+v/JywrH =ZqsZ -----END PGP SIGNATURE----- --------------enig78F0B4F7711E48B33AD7BB51--