Loading include/net/sock.h +3 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ #include <net/dst.h> #include <net/checksum.h> #define TCP_BACKLOG_SCALE 4 struct cgroup; struct cgroup_subsys; #ifdef CONFIG_NET Loading Loading @@ -779,7 +781,7 @@ static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, unsigned int limit) { if (sk_rcvqueues_full(sk, skb, limit)) if (sk_rcvqueues_full(sk, skb, limit * TCP_BACKLOG_SCALE)) return -ENOBUFS; __sk_add_backlog(sk, skb); Loading net/ipv4/tcp_input.c +2 −1 Original line number Diff line number Diff line Loading @@ -4094,7 +4094,8 @@ static int tcp_prune_queue(struct sock *sk); static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) { if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || if (atomic_read(&sk->sk_rmem_alloc) > ((sk->sk_rcvbuf + sk->sk_sndbuf) * 4) || !sk_rmem_schedule(sk, skb, size)) { if (tcp_prune_queue(sk) < 0) Loading Loading
include/net/sock.h +3 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ #include <net/dst.h> #include <net/checksum.h> #define TCP_BACKLOG_SCALE 4 struct cgroup; struct cgroup_subsys; #ifdef CONFIG_NET Loading Loading @@ -779,7 +781,7 @@ static inline bool sk_rcvqueues_full(const struct sock *sk, const struct sk_buff static inline __must_check int sk_add_backlog(struct sock *sk, struct sk_buff *skb, unsigned int limit) { if (sk_rcvqueues_full(sk, skb, limit)) if (sk_rcvqueues_full(sk, skb, limit * TCP_BACKLOG_SCALE)) return -ENOBUFS; __sk_add_backlog(sk, skb); Loading
net/ipv4/tcp_input.c +2 −1 Original line number Diff line number Diff line Loading @@ -4094,7 +4094,8 @@ static int tcp_prune_queue(struct sock *sk); static int tcp_try_rmem_schedule(struct sock *sk, struct sk_buff *skb, unsigned int size) { if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || if (atomic_read(&sk->sk_rmem_alloc) > ((sk->sk_rcvbuf + sk->sk_sndbuf) * 4) || !sk_rmem_schedule(sk, skb, size)) { if (tcp_prune_queue(sk) < 0) Loading