From: Wang Chen <wangchen@cn.fujitsu.com>
To: becker@scyld.com, "David S. Miller" <davem@davemloft.net>,
Jeff Garzik <jgarzik@pobox.com>, NETDEV <netdev@vger.kernel.org>
Subject: [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed
Date: Tue, 20 May 2008 17:13:52 +0800 [thread overview]
Message-ID: <48329650.60809@cn.fujitsu.com> (raw)
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
next reply other threads:[~2008-05-20 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-20 9:13 Wang Chen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48329650.60809@cn.fujitsu.com \
--to=wangchen@cn.fujitsu.com \
--cc=becker@scyld.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).