* [PATCH net-next-2.6] net: update SOCK_MIN_RCVBUF
@ 2010-09-24 16:19 Eric Dumazet
2010-09-27 1:53 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-09-24 16:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
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>
---
include/net/sock.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 8ae97c4..c33e62c 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)
{
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next-2.6] net: update SOCK_MIN_RCVBUF
2010-09-24 16:19 [PATCH net-next-2.6] net: update SOCK_MIN_RCVBUF Eric Dumazet
@ 2010-09-27 1:53 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-27 1:53 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 24 Sep 2010 18:19:37 +0200
> 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>
Fair enough, applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-27 1:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 16:19 [PATCH net-next-2.6] net: update SOCK_MIN_RCVBUF Eric Dumazet
2010-09-27 1:53 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).