aboutgitcodebugslistschat
path: root/tcp.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-04 22:08:24 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-04 22:20:43 +0200
commit683043e2001e71e0b7d0b132da4756d329f22f27 (patch)
treeb8161da947c2d927d63066559fe667ca345cbce3 /tcp.h
parente1a2e2780c91eb83f4cf3dfc8bb8b8ad286f3389 (diff)
downloadpasst-683043e2001e71e0b7d0b132da4756d329f22f27.tar
passt-683043e2001e71e0b7d0b132da4756d329f22f27.tar.gz
passt-683043e2001e71e0b7d0b132da4756d329f22f27.tar.bz2
passt-683043e2001e71e0b7d0b132da4756d329f22f27.tar.lz
passt-683043e2001e71e0b7d0b132da4756d329f22f27.tar.xz
passt-683043e2001e71e0b7d0b132da4756d329f22f27.tar.zst
passt-683043e2001e71e0b7d0b132da4756d329f22f27.zip
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 <sbrivio@redhat.com>
Diffstat (limited to 'tcp.h')
-rw-r--r--tcp.h4
1 files changed, 4 insertions, 0 deletions
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 */