@@ -1408,37 +1408,31 @@ fec_enet_rx_queue(struct net_device *ndev, int budget, u16 queue_id)
1408
1408
break ;
1409
1409
pkt_received ++ ;
1410
1410
1411
- /* Since we have allocated space to hold a complete frame,
1412
- * the last indicator should be set.
1413
- */
1414
- if ((status & BD_ENET_RX_LAST ) == 0 )
1415
- netdev_err (ndev , "rcv is not +last\n" );
1416
-
1417
1411
writel (FEC_ENET_RXF , fep -> hwp + FEC_IEVENT );
1418
1412
1419
1413
/* Check for errors. */
1414
+ status ^= BD_ENET_RX_LAST ;
1420
1415
if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
1421
- BD_ENET_RX_CR | BD_ENET_RX_OV )) {
1416
+ BD_ENET_RX_CR | BD_ENET_RX_OV | BD_ENET_RX_LAST |
1417
+ BD_ENET_RX_CL )) {
1422
1418
ndev -> stats .rx_errors ++ ;
1423
- if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH )) {
1419
+ if (status & BD_ENET_RX_OV ) {
1420
+ /* FIFO overrun */
1421
+ ndev -> stats .rx_fifo_errors ++ ;
1422
+ goto rx_processing_done ;
1423
+ }
1424
+ if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH
1425
+ | BD_ENET_RX_LAST )) {
1424
1426
/* Frame too long or too short. */
1425
1427
ndev -> stats .rx_length_errors ++ ;
1428
+ if (status & BD_ENET_RX_LAST )
1429
+ netdev_err (ndev , "rcv is not +last\n" );
1426
1430
}
1427
- if (status & BD_ENET_RX_NO ) /* Frame alignment */
1428
- ndev -> stats .rx_frame_errors ++ ;
1429
1431
if (status & BD_ENET_RX_CR ) /* CRC Error */
1430
1432
ndev -> stats .rx_crc_errors ++ ;
1431
- if (status & BD_ENET_RX_OV ) /* FIFO overrun */
1432
- ndev -> stats .rx_fifo_errors ++ ;
1433
- }
1434
-
1435
- /* Report late collisions as a frame error.
1436
- * On this error, the BD is closed, but we don't know what we
1437
- * have in the buffer. So, just drop this frame on the floor.
1438
- */
1439
- if (status & BD_ENET_RX_CL ) {
1440
- ndev -> stats .rx_errors ++ ;
1441
- ndev -> stats .rx_frame_errors ++ ;
1433
+ /* Report late collisions as a frame error. */
1434
+ if (status & (BD_ENET_RX_NO | BD_ENET_RX_CL ))
1435
+ ndev -> stats .rx_frame_errors ++ ;
1442
1436
goto rx_processing_done ;
1443
1437
}
1444
1438
0 commit comments