Subject: Re: ip_gre headroom allocation

From: Timo Teräs <[email-masked]>
Date: Thu, 11 Jun 2009 14:51:26 +0300

Herbert Xu wrote:
> On Thu, Jun 11, 2009 at 02:29:46PM +0300, Timo Teräs wrote:
>> I guess this is easy for point-to-point tunnels. But how about the
>> multipoint gre tunnels? The needed_headroom can vary on destination
>> basis depending on if they are NATted or not, and on the cipher/hash
>> used.
> 
> I don't think we need to worry about NAT, well at least we don't
> worry about it on the normal path :)

It affects if ESP or UDP-over-ESP encapsulation is used. This can
vary on destination IP basis. This different needed_headroom size.
This the case only for multi-point tunnels. But yes, we don't need
to worry about it, it just one factor that can affect what the
actual needed_headroom can end up being.

>> Can we change the needed_headroom on-the-fly? Increase it when ever
>> we encounter a larger path? But this also means some packages would
>> get extra headroom allocated.
> 
> Just make it the maximum.  It's OK to have extra head space.
> If the head space is huge then you've got bigger problems than
> wasted memory :)

I guess so. The difference is not too many bytes. Is it ok to just
change the dev->needed_headroom from xmit routine?

- Timo