From 683043e2001e71e0b7d0b132da4756d329f22f27 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 4 Oct 2021 22:08:24 +0200 Subject: tcp: Probe net.core.{r,w}mem_max, don't set SO_{RCV,SND}BUF if low If net.core.rmem_max and net.core.wmem_max sysctls have low values, we can get bigger buffers by not trying to set them high -- the kernel would lock their values to what we get. Try, instead, to get bigger buffers by queueing as much as possible, and if maximum values in tcp_wmem and tcp_rmem are bigger than this, that will work. While at it, drop QUICKACK option for non-spliced sockets, I set that earlier by mistake. Signed-off-by: Stefano Brivio --- tcp.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tcp.h') diff --git a/tcp.h b/tcp.h index ef78b51..fd483a1 100644 --- a/tcp.h +++ b/tcp.h @@ -51,6 +51,8 @@ union tcp_epoll_ref { * @pipe_size: Size of pipes for spliced connections * @refill_ts: Time of last refill operation for pools of sockets/pipes * @port_detect_ts: Time of last TCP port detection/rebind, if enabled + * @low_wmem: Low probed net.core.wmem_max + * @low_rmem: Low probed net.core.rmem_max */ struct tcp_ctx { uint64_t hash_secret[2]; @@ -65,6 +67,8 @@ struct tcp_ctx { size_t pipe_size; struct timespec refill_ts; struct timespec port_detect_ts; + int low_wmem; + int low_rmem; }; #endif /* TCP_H */ -- cgit v1.2.3