mirror of https://gitee.com/openkylin/linux.git
net: korina: optimize rx descriptor flags processing
Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7ce103b4cb
commit
364a97f5d1
|
@ -363,11 +363,18 @@ static int korina_rx(struct net_device *dev, int limit)
|
|||
if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0)
|
||||
break;
|
||||
|
||||
/* check that this is a whole packet
|
||||
* WARNING: DMA_FD bit incorrectly set
|
||||
* in Rc32434 (errata ref #077) */
|
||||
if (!(devcs & ETH_RX_LD))
|
||||
goto next;
|
||||
|
||||
if (!(devcs & ETH_RX_ROK)) {
|
||||
/* Update statistics counters */
|
||||
dev->stats.rx_errors++;
|
||||
dev->stats.rx_dropped++;
|
||||
if (devcs & ETH_RX_CRC)
|
||||
dev->stats.rx_crc_errors++;
|
||||
if (devcs & ETH_RX_LOR)
|
||||
dev->stats.rx_length_errors++;
|
||||
if (devcs & ETH_RX_LE)
|
||||
dev->stats.rx_length_errors++;
|
||||
if (devcs & ETH_RX_OVR)
|
||||
|
@ -375,17 +382,11 @@ static int korina_rx(struct net_device *dev, int limit)
|
|||
if (devcs & ETH_RX_CV)
|
||||
dev->stats.rx_frame_errors++;
|
||||
if (devcs & ETH_RX_CES)
|
||||
dev->stats.rx_length_errors++;
|
||||
if (devcs & ETH_RX_MP)
|
||||
dev->stats.multicast++;
|
||||
dev->stats.rx_frame_errors++;
|
||||
|
||||
goto next;
|
||||
}
|
||||
|
||||
if ((devcs & ETH_RX_LD) != ETH_RX_LD) {
|
||||
/* check that this is a whole packet
|
||||
* WARNING: DMA_FD bit incorrectly set
|
||||
* in Rc32434 (errata ref #077) */
|
||||
dev->stats.rx_errors++;
|
||||
dev->stats.rx_dropped++;
|
||||
} else if ((devcs & ETH_RX_ROK)) {
|
||||
pkt_len = RCVPKT_LENGTH(devcs);
|
||||
|
||||
/* must be the (first and) last
|
||||
|
@ -414,8 +415,8 @@ static int korina_rx(struct net_device *dev, int limit)
|
|||
dev->stats.multicast++;
|
||||
|
||||
lp->rx_skb[lp->rx_next_done] = skb_new;
|
||||
}
|
||||
|
||||
next:
|
||||
rd->devcs = 0;
|
||||
|
||||
/* Restore descriptor's curr_addr */
|
||||
|
|
Loading…
Reference in New Issue