diff options
author | Eric Dumazet <[email protected]> | 2013-07-03 05:02:22 -0700 |
---|---|---|
committer | David S. Miller <[email protected]> | 2013-07-03 16:52:10 -0700 |
commit | 9eb5bf838d06aa6ddebe4aca6b5cedcf2eb53b86 (patch) | |
tree | 12c3aa5b3242194880829d5b04369c53f087bfc1 | |
parent | 9caf83c32be1dabf000ab7dc8430fba4f7d89e65 (diff) |
net: sock: fix TCP_SKB_MIN_TRUESIZE
commit eea86af6b1e18d ("net: sock: adapt SOCK_MIN_RCVBUF and
SOCK_MIN_SNDBUF") forgot the sk_buff alignment taken into account
in __alloc_skb() : skb->truesize = SKB_TRUESIZE(size);
While above commit fixed the sender issue, the receiver is still
dropping the second packet (on loopback device), because the receiver
socket can not really hold two skbs :
First packet truesize already is above sk_rcvbuf, so even TCP coalescing
cannot help.
On a typical 64bit build, each tcp skb truesize is 2304, instead of 2272
Signed-off-by: Eric Dumazet <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Neal Cardwell <[email protected]>
Acked-by: Neal Cardwell <[email protected]>
Tested-by: Neal Cardwell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | include/net/sock.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index ea6206ccc896..95a5a2c6925a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2052,7 +2052,7 @@ static inline void sk_wake_async(struct sock *sk, int how, int band) * Note: for send buffers, TCP works better if we can build two skbs at * minimum. */ -#define TCP_SKB_MIN_TRUESIZE (2048 + sizeof(struct sk_buff)) +#define TCP_SKB_MIN_TRUESIZE (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff))) #define SOCK_MIN_SNDBUF (TCP_SKB_MIN_TRUESIZE * 2) #define SOCK_MIN_RCVBUF TCP_SKB_MIN_TRUESIZE |