]> git.baikalelectronics.ru Git - kernel.git/commit
gianfar: Fix and cleanup rxbd status handling
authorClaudiu Manoil <claudiu.manoil@freescale.com>
Mon, 13 Jul 2015 13:22:04 +0000 (16:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jul 2015 00:13:24 +0000 (17:13 -0700)
commit7a92a03bec43c82709bcf1cce29a31265bdcb299
treed747fd4bdc788e3dbd482b7697dc31ff7ae62df7
parent653b2be6b4430099a96071738cf7bef64f89f879
gianfar: Fix and cleanup rxbd status handling

There are several (long standing) problems about how the status
field of the rx buffer descriptor (rxbd) is currently handled on
the error path:
- too many unnecessary 16bit reads of the two halves of the rxbd
status field (32bit), also resulting in overuse of endianness
convesion macros;
- "bdp->status = RXBD_LARGE" makes no sense, since the "large"
flag is read only (only eTSEC can write it), and trying to clear
the other status bits is also error prone in this context
(most of the rx status bits are read only anyway).

This is fixed with a single 32bit read of the "status" field,
and then the appropriate 16bit shifting is applied to access
the various status bits or the rx frame length. Also corrected
the use of the RXBD_LARGE flag.

Additional fix:
"rx_over_errors" stat is incremented instead of "rx_crc_errors"
in case of RXBD_OVERRUN occurrence.

Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c