Commit 364a97f5 authored by Roman Yeryomin's avatar Roman Yeryomin Committed by David S. Miller

net: korina: optimize rx descriptor flags processing

Signed-off-by: default avatarRoman Yeryomin <roman@advem.lv>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ce103b4
...@@ -363,11 +363,18 @@ static int korina_rx(struct net_device *dev, int limit) ...@@ -363,11 +363,18 @@ static int korina_rx(struct net_device *dev, int limit)
if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0) if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0)
break; 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 */ /* Update statistics counters */
dev->stats.rx_errors++;
dev->stats.rx_dropped++;
if (devcs & ETH_RX_CRC) if (devcs & ETH_RX_CRC)
dev->stats.rx_crc_errors++; dev->stats.rx_crc_errors++;
if (devcs & ETH_RX_LOR)
dev->stats.rx_length_errors++;
if (devcs & ETH_RX_LE) if (devcs & ETH_RX_LE)
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
if (devcs & ETH_RX_OVR) if (devcs & ETH_RX_OVR)
...@@ -375,17 +382,11 @@ static int korina_rx(struct net_device *dev, int limit) ...@@ -375,17 +382,11 @@ static int korina_rx(struct net_device *dev, int limit)
if (devcs & ETH_RX_CV) if (devcs & ETH_RX_CV)
dev->stats.rx_frame_errors++; dev->stats.rx_frame_errors++;
if (devcs & ETH_RX_CES) if (devcs & ETH_RX_CES)
dev->stats.rx_length_errors++; dev->stats.rx_frame_errors++;
if (devcs & ETH_RX_MP)
dev->stats.multicast++; 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); pkt_len = RCVPKT_LENGTH(devcs);
/* must be the (first and) last /* must be the (first and) last
...@@ -414,8 +415,8 @@ static int korina_rx(struct net_device *dev, int limit) ...@@ -414,8 +415,8 @@ static int korina_rx(struct net_device *dev, int limit)
dev->stats.multicast++; dev->stats.multicast++;
lp->rx_skb[lp->rx_next_done] = skb_new; lp->rx_skb[lp->rx_next_done] = skb_new;
}
next:
rd->devcs = 0; rd->devcs = 0;
/* Restore descriptor's curr_addr */ /* Restore descriptor's curr_addr */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment