summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-27 01:53:07 (GMT)
committerDavid S. Miller <davem@davemloft.net>2010-09-27 01:53:07 (GMT)
commit7a91b434e2bad554b709265db7603b1aa52dd92e (patch)
tree00f51e051922fbaf2ca93e40d0059e5fbb86b2f1 /include/net
parent807540baae406c84dcb9c1c8ef07a56d2d2ae84a (diff)
downloadlinux-7a91b434e2bad554b709265db7603b1aa52dd92e.tar.xz
net: update SOCK_MIN_RCVBUF
SOCK_MIN_RCVBUF current value is 256 bytes It doesnt permit to receive the smallest possible frame, considering socket sk_rmem_alloc/sk_rcvbuf account skb truesizes. On 64bit arches, sizeof(struct sk_buff) is 240 bytes. Add the typical 64 bytes of headroom, and we go over the limit. With old kernels and 32bit arches, we were under the limit, if netdriver was doing copybreak. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sock.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 8ae97c4..73a4f97 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1558,7 +1558,11 @@ static inline void sk_wake_async(struct sock *sk, int how, int band)
}
#define SOCK_MIN_SNDBUF 2048
-#define SOCK_MIN_RCVBUF 256
+/*
+ * Since sk_rmem_alloc sums skb->truesize, even a small frame might need
+ * sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak
+ */
+#define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff))
static inline void sk_stream_moderate_sndbuf(struct sock *sk)
{