Commit f7f312a0 authored by Wang Chen's avatar Wang Chen Committed by Jeff Garzik

3C509: rx_bytes should not be increased when alloc_skb failed

If alloc_skb failed, the recieved packet will be dropped. Do not increase
rx_bytes for dropped packet.
Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 56cfe5d0
...@@ -1063,7 +1063,6 @@ el3_rx(struct net_device *dev) ...@@ -1063,7 +1063,6 @@ el3_rx(struct net_device *dev)
struct sk_buff *skb; struct sk_buff *skb;
skb = dev_alloc_skb(pkt_len+5); skb = dev_alloc_skb(pkt_len+5);
dev->stats.rx_bytes += pkt_len;
if (el3_debug > 4) if (el3_debug > 4)
printk("Receiving packet size %d status %4.4x.\n", printk("Receiving packet size %d status %4.4x.\n",
pkt_len, rx_status); pkt_len, rx_status);
...@@ -1078,6 +1077,7 @@ el3_rx(struct net_device *dev) ...@@ -1078,6 +1077,7 @@ el3_rx(struct net_device *dev)
skb->protocol = eth_type_trans(skb,dev); skb->protocol = eth_type_trans(skb,dev);
netif_rx(skb); netif_rx(skb);
dev->last_rx = jiffies; dev->last_rx = jiffies;
dev->stats.rx_bytes += pkt_len;
dev->stats.rx_packets++; dev->stats.rx_packets++;
continue; continue;
} }
......
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