Skip to content

Commit

Permalink
tcp: use limited socket backlog
Browse files Browse the repository at this point in the history
Make tcp adapt to the limited socket backlog change.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Zhu Yi authored and David S. Miller committed Mar 5, 2010
1 parent 8eae939 commit 6b03a53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,8 +1682,10 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb))
ret = tcp_v4_do_rcv(sk, skb);
}
} else
sk_add_backlog(sk, skb);
} else if (sk_add_backlog_limited(sk, skb)) {
bh_unlock_sock(sk);
goto discard_and_relse;
}
bh_unlock_sock(sk);

sock_put(sk);
Expand Down
6 changes: 4 additions & 2 deletions net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,8 +1740,10 @@ static int tcp_v6_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb))
ret = tcp_v6_do_rcv(sk, skb);
}
} else
sk_add_backlog(sk, skb);
} else if (sk_add_backlog_limited(sk, skb)) {
bh_unlock_sock(sk);
goto discard_and_relse;
}
bh_unlock_sock(sk);

sock_put(sk);
Expand Down

0 comments on commit 6b03a53

Please sign in to comment.