Skip to content

Commit

Permalink
net: update SOCK_MIN_RCVBUF
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 27, 2010
1 parent 807540b commit 7a91b43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 7a91b43

Please sign in to comment.