public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox•com>
To: Wang Chen <wangchen@cn•fujitsu.com>
Cc: becker@scyld•com, "David S. Miller" <davem@davemloft•net>,
	NETDEV <netdev@vger•kernel.org>
Subject: Re: [PATCH 1/2] 3C509: rx_bytes should not be increased when alloc_skb failed
Date: Thu, 22 May 2008 14:02:53 -0400	[thread overview]
Message-ID: <4835B54D.6050600@pobox.com> (raw)
In-Reply-To: <48329650.60809@cn.fujitsu.com>

Wang Chen wrote:
> 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;

applied



      parent reply	other threads:[~2008-05-22 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Jeff Garzik [this message]

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=4835B54D.6050600@pobox.com \
    --to=jgarzik@pobox$(echo .)com \
    --cc=becker@scyld$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=wangchen@cn$(echo .)fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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