Commit 6b03a53a authored by Zhu Yi's avatar Zhu Yi Committed by David S. Miller

tcp: use limited socket backlog

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: default avatarZhu Yi <yi.zhu@intel.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8eae939f
...@@ -1682,8 +1682,10 @@ int tcp_v4_rcv(struct sk_buff *skb) ...@@ -1682,8 +1682,10 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb)) if (!tcp_prequeue(sk, skb))
ret = tcp_v4_do_rcv(sk, skb); ret = tcp_v4_do_rcv(sk, skb);
} }
} else } else if (sk_add_backlog_limited(sk, skb)) {
sk_add_backlog(sk, skb); bh_unlock_sock(sk);
goto discard_and_relse;
}
bh_unlock_sock(sk); bh_unlock_sock(sk);
sock_put(sk); sock_put(sk);
......
...@@ -1740,8 +1740,10 @@ static int tcp_v6_rcv(struct sk_buff *skb) ...@@ -1740,8 +1740,10 @@ static int tcp_v6_rcv(struct sk_buff *skb)
if (!tcp_prequeue(sk, skb)) if (!tcp_prequeue(sk, skb))
ret = tcp_v6_do_rcv(sk, skb); ret = tcp_v6_do_rcv(sk, skb);
} }
} else } else if (sk_add_backlog_limited(sk, skb)) {
sk_add_backlog(sk, skb); bh_unlock_sock(sk);
goto discard_and_relse;
}
bh_unlock_sock(sk); bh_unlock_sock(sk);
sock_put(sk); sock_put(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment