linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grzegorz Bernacki <gjb@semihalf.com>
To: linuxppc-embedded@ozlabs.org
Subject: [PATCH] mpc52xx: Correct calculation of FEC RX errors.
Date: Fri, 25 May 2007 00:01:24 +0200	[thread overview]
Message-ID: <46560B34.2070800@semihalf.com> (raw)

'ifconfig eth0' command for mpc5200B-based cards shows error for RX.
However none of RX MIB counters is set to value greater than zero.
Number of errors is equal to number of multicast packet. In linux 2.4
calculation of RX errors is slightly different and takes into account
number of multicast packet. This change is a port of calculation method
of RX errors for FEC controller from linux 2.4 to 2.6.

Signed-off-by: Grzegorz Bernacki <gjb@semihalf.com>
---

 drivers/net/fec_mpc52xx/fec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec_mpc52xx/fec.c b/drivers/net/fec_mpc52xx/fec.c
index f0ce87e..d2087f6 100644
--- a/drivers/net/fec_mpc52xx/fec.c
+++ b/drivers/net/fec_mpc52xx/fec.c
@@ -395,7 +395,9 @@ static struct net_device_stats *fec_get_stats(struct
net_device *dev)

        stats->rx_bytes = in_be32(&fec->rmon_r_octets);
        stats->rx_packets = in_be32(&fec->rmon_r_packets);
-       stats->rx_errors = stats->rx_packets -
in_be32(&fec->ieee_r_frame_ok);
+       stats->rx_errors = stats->rx_packets - (
+                       in_be32(&fec->ieee_r_frame_ok) +
+                       in_be32(&fec->rmon_r_mc_pkt));
        stats->tx_bytes = in_be32(&fec->rmon_t_octets);
        stats->tx_packets = in_be32(&fec->rmon_t_packets);
        stats->tx_errors = stats->tx_packets - (

             reply	other threads:[~2007-05-24 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 22:01 Grzegorz Bernacki [this message]
2007-05-28 19:04 ` [PATCH] mpc52xx: Correct calculation of FEC RX errors Sylvain Munaut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46560B34.2070800@semihalf.com \
    --to=gjb@semihalf.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).