net: add a limit parameter to sk_add_backlog()
sk_add_backlog() & sk_rcvqueues_full() hard coded sk_rcvbuf as the memory limit. We need to make this limit a parameter for TCP use. No functional change expected in this patch, all callers still using the old sk_rcvbuf limit. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Maciej Żenczykowski <maze@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Cc: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b98985073b
commit
f545a38f74
10 changed files with 21 additions and 19 deletions
|
@ -389,7 +389,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
|
|||
|
||||
skb->dev = NULL;
|
||||
|
||||
if (sk_rcvqueues_full(sk, skb)) {
|
||||
if (sk_rcvqueues_full(sk, skb, sk->sk_rcvbuf)) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
goto discard_and_relse;
|
||||
}
|
||||
|
@ -406,7 +406,7 @@ int sk_receive_skb(struct sock *sk, struct sk_buff *skb, const int nested)
|
|||
rc = sk_backlog_rcv(sk, skb);
|
||||
|
||||
mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
|
||||
} else if (sk_add_backlog(sk, skb)) {
|
||||
} else if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) {
|
||||
bh_unlock_sock(sk);
|
||||
atomic_inc(&sk->sk_drops);
|
||||
goto discard_and_relse;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue