diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-11-14 18:45:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-11-14 18:45:21 -0500 |
commit | fb93134dfc2a6e6fbedc7c270a31da03fce88db9 (patch) | |
tree | 92c6d19049162f2f3eb9348a3159b5d0874a9daf /net/ipv4/tcp_input.c | |
parent | 18b2b7bd09811779309592a10080fe9ffb93144d (diff) |
[TCP]: Fix size calculation in sk_stream_alloc_pskb
We round up the header size in sk_stream_alloc_pskb so that
TSO packets get zero tail room. Unfortunately this rounding
up is not coordinated with the select_size() function used by
TCP to calculate the second parameter of sk_stream_alloc_pskb.
As a result, we may allocate more than a page of data in the
non-TSO case when exactly one page is desired.
In fact, rounding up the head room is detrimental in the non-TSO
case because it makes memory that would otherwise be available to
the payload head room. TSO doesn't need this either, all it wants
is the guarantee that there is no tail room.
So this patch fixes this by adjusting the skb_reserve call so that
exactly the requested amount (which all callers have calculated in
a precise way) is made available as tail room.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
0 files changed, 0 insertions, 0 deletions