All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed
@ 2008-05-20  9:13 Wang Chen
  2008-05-20  9:23 ` [PATCH 2/2] ibmveth: make sure skb is not null Wang Chen
  2008-05-22 18:02 ` [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Chen @ 2008-05-20  9:13 UTC (permalink / raw)
  To: becker, David S. Miller, Jeff Garzik, NETDEV

If alloc_skb failed, the recieved packet will be dropped. Do not increase
rx_bytes for dropped packet.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
---
 drivers/net/3c509.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index e6c545f..fe6d841 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -1063,7 +1063,6 @@ el3_rx(struct net_device *dev)
 			struct sk_buff *skb;
 
 			skb = dev_alloc_skb(pkt_len+5);
-			dev->stats.rx_bytes += pkt_len;
 			if (el3_debug > 4)
 				printk("Receiving packet size %d status %4.4x.\n",
 					   pkt_len, rx_status);
@@ -1078,6 +1077,7 @@ el3_rx(struct net_device *dev)
 				skb->protocol = eth_type_trans(skb,dev);
 				netif_rx(skb);
 				dev->last_rx = jiffies;
+				dev->stats.rx_bytes += pkt_len;
 				dev->stats.rx_packets++;
 				continue;
 			}
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-22 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-20  9:13 [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed Wang Chen
2008-05-20  9:23 ` [PATCH 2/2] ibmveth: make sure skb is not null Wang Chen
2008-05-22 18:02 ` [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.