mpc52xx: Correct calculation of FEC RX errors???
Hi We are showing figures of more than 4 billion error frames in our ethernet interfaces. We have tested that the problem is in a substraction (the number of errors decrements with the number of frames). So... looking in the fec driver (fec.c) for the calculations we have seen that the number of multicast packets is added to the number of correct frames in order to get the frame errors... But the interesting thing is that we have checked that this calculation is something that we have added with a patch by Grzegorz Bernacki in this list. So... The funny thing is... Why a patch that solves the problem for Grzegorz produces "the same problem" for us? And... by the way... I have seen IEEE802.3, and when they talk about aFramesReceivedOK (which I suppose is the ieee_r_frame_ok in the driver), and they do not say a word about not including multicast packets in it... Any comment will be appreciate. Miguel Ángel Álvarez ** - PLEASE NOTE --- This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help. ZIV uses virus scanning software but excludes any liability for viruses contained in any attachment. ROGAMOS LEA ESTE TEXTO --- Este mensaje y sus anexos pueden contener información confidencial y/o con derecho legal. Está dirigido únicamente a la/s persona/s o entidad/es reseñadas como único destinatario autorizado. Si este mensaje le hubiera llegado por error, por favor elimínelo sin revisarlo ni reenviarlo y notifíquelo inmediatamente al remitente. Gracias por su colaboración. ZIV utiliza software antivirus, pero no se hace responsable de los virus contenidos en los ficheros anexos. ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: mpc52xx: Correct calculation of FEC RX errors???
> Hi > > We are showing figures of more than 4 billion error frames in our > ethernet interfaces. We have tested that the problem is in a > substraction (the number of errors decrements with the number of frames). > > So... looking in the fec driver (fec.c) for the calculations we have > seen that the number of multicast packets is added to the number of > correct frames in order to get the frame errors... > > But the interesting thing is that we have checked that this > calculation is something that we have added with a patch by Grzegorz > Bernacki in this list. > > So... The funny thing is... Why a patch that solves the problem for > Grzegorz produces "the same problem" for us? > > And... by the way... I have seen IEEE802.3, and when they talk about > aFramesReceivedOK (which I suppose is the ieee_r_frame_ok in the > driver), and they do not say a word about not including multicast > packets in it... > > Any comment will be appreciate. The only comment I have, is that yes, the computation are flawed. And that's not very high in my priority list. I don't think the path posted on the list fully fix the issue but I really don't want to spend hours trying to figure out exactly what values are reported in all those counters. You're welcome to do so if you have some free time ... There are other stuff wrong in this driver (try ifconfig eth0 down, then send some broad cast traffic on the network you'll see some fifo error popping up ) ... Sylvain ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Re: [PATCH] mpc52xx: Correct calculation of FEC RX errors.
Nice catch, I knew something was wrong ( 4 billion errors ;) but I never bothered to look it up. Sylvain Grzegorz Bernacki wrote: > '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 <[EMAIL PROTECTED]> > --- > > 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 - ( > > ___ > Linuxppc-embedded mailing list > Linuxppc-embedded@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-embedded > > ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
[PATCH] mpc52xx: Correct calculation of FEC RX errors.
'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 <[EMAIL PROTECTED]> --- 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 - ( ___ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded