Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] chelsio: use netdev_alloc_skb
Date: Wed, 20 Mar 2013 11:42:32 -0700	[thread overview]
Message-ID: <1363804952.3333.29.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130320113024.00377b99@nehalam.linuxnetplumber.net>

On Wed, 2013-03-20 at 11:30 -0700, Stephen Hemminger wrote:
> This extends on Eric's patch. It uses netdev_alloc_skb which fixes a couple of
> other issues.
>   * driver was never setting skb->dev on the received buffer
>   * copybreak allocation wasn't padding buffer
>   * copybreak assumed that ip alignment padding was always 2 (it is platform dependent)
> 
> Compile tested only, don't have this hardware.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> 
> --- a/drivers/net/ethernet/chelsio/cxgb/sge.c	2013-03-20 11:13:47.950986878 -0700
> +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c	2013-03-20 11:24:26.942722757 -0700
> @@ -835,7 +835,7 @@ static void refill_free_list(struct sge
>  		struct sk_buff *skb;
>  		dma_addr_t mapping;
>  
> -		skb = dev_alloc_skb(q->rx_buffer_size);
> +		skb = netdev_alloc_skb(sge->netdev, q->rx_buffer_size);
>  		if (!skb)
>  			break;

Well, this (skb->dev = dev) is done in eth_type_trans()

Many drivers use dev_alloc_skb(), I am not sure we really want to change
them.

  reply	other threads:[~2013-03-20 18:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 16:33 [PATCH] chelsio: add headroom in RX path Eric Dumazet
2013-03-20 17:29 ` David Miller
2013-03-20 18:30 ` [PATCH] chelsio: use netdev_alloc_skb Stephen Hemminger
2013-03-20 18:42   ` Eric Dumazet [this message]
2013-03-20 19:02     ` [PATCH v2] chelsio: use netdev_alloc_skb_ip_align Stephen Hemminger
2013-03-20 19:25       ` David Miller
2013-03-20 18:44   ` [PATCH] chelsio: use netdev_alloc_skb Eric Dumazet

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=1363804952.3333.29.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.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