Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a35c4d02 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: tcp: Scale the TCP backlog queue to absorb packet bursts"

parents c71dbdc3 cf5d51af
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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
@@ -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);
+2 −1
Original line number Diff line number Diff line
@@ -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)