netdev
[Top] [All Lists]

Re: ip_build_xmit() skb_reserve() problem

To: Gleb Natapov <gleb@xxxxxxxxxxx>
Subject: Re: ip_build_xmit() skb_reserve() problem
From: Andi Kleen <ak@xxxxxx>
Date: Thu, 24 Aug 2000 14:25:39 +0200
Cc: kuznet@xxxxxxxxxxxxx, Neal Nuckolls <nn@xxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <39A4C189.2FB2B10E@nbase.co.il>; from gleb@nbase.co.il on Thu, Aug 24, 2000 at 08:40:55AM +0200
References: <200008231827.WAA00968@ms2.inr.ac.ru> <39A4C189.2FB2B10E@nbase.co.il>
Sender: owner-netdev@xxxxxxxxxxx
On Thu, Aug 24, 2000 at 08:40:55AM +0200, Gleb Natapov wrote:
> kuznet@xxxxxxxxxxxxx wrote:
> >
> [...]
> > 
> > I repeat: if device wants more memory, it must give hint in hard_header_len.
> > If it prefers conspiracy, let it to copy in secret. 8)
> 
> Unfortunately a 'dev' that you use when you reserve 
> (dev->hard_header_len + 15) & ~15) bytes in the skb may be not the same
> device that actually transmits packet (netfilter may reroute packet to
> another device for instance). Thus dev->hard_header() can't really
> assume that there is enough space for hardware header in the skb.
> hard_header() should always check that there is sufficient space in
> headroom if it doesn't do this it's a bug.

When you're doing NAT you just have to eat the skb_realloc_headroom().
NAT does not come for free. When you care about performance do not use it.

-Andi

-- 
This is like TV. I don't like TV.

<Prev in Thread] Current Thread [Next in Thread>