netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Timo Teräs" <timo.teras@iki.fi>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ip_gre: include route header_len in max_headroom calculation
Date: Sat, 20 Mar 2010 14:43:25 +0200	[thread overview]
Message-ID: <4BA4C2ED.9090701@iki.fi> (raw)
In-Reply-To: <20100320123736.GC1930@gondor.apana.org.au>

Herbert Xu wrote:
> On Sat, Mar 20, 2010 at 02:27:58PM +0200, Timo Teras wrote:
>> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
>> index f47c9f7..f78402d 100644
>> --- a/net/ipv4/ip_gre.c
>> +++ b/net/ipv4/ip_gre.c
>> @@ -810,11 +810,13 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
>>  			tunnel->err_count = 0;
>>  	}
>>  
>> -	max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen;
>> +	max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->u.dst.header_len;
>>  
>>  	if (skb_headroom(skb) < max_headroom || skb_shared(skb)||
>>  	    (skb_cloned(skb) && !skb_clone_writable(skb, 0))) {
>>  		struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom);
>> +		if (max_headroom > dev->needed_headroom)
>> +			dev->needed_headroom = max_headroom;
> 
> Are you sure about this? LL_RESERVED_SPACE already includes
> dev->needed_headroom so won't this get bigger each time?

Whoops. Must've been after-midnight issue. And not noticed since the
max_headroom won't change many times.

dev->needed_headroom should be compared against gre_hlen+rt->u.dst.header_len.
I'll send a fixed patch in a jiffy.

- timo


  reply	other threads:[~2010-03-20 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20 12:27 [PATCH] ip_gre: include route header_len in max_headroom calculation Timo Teras
2010-03-20 12:37 ` Herbert Xu
2010-03-20 12:43   ` Timo Teräs [this message]
2010-03-20 14:47     ` Timo Teräs
2010-03-20 15:00       ` Herbert Xu
2010-03-22  4:26         ` David Miller

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=4BA4C2ED.9090701@iki.fi \
    --to=timo.teras@iki.fi \
    --cc=herbert@gondor.apana.org.au \
    --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).