aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-02-16 08:31:13 +0100
committerStefano Brivio <sbrivio@redhat.com>2025-02-17 08:28:45 +0100
commit01b6a164d94f26be7ad500f71210bdb888f416aa (patch)
tree257134bfb80d452f312c271a72ed035c4e4031f1
parent667caa09c6d46d937b3076254176eded262b3eca (diff)
downloadpasst-01b6a164d94f26be7ad500f71210bdb888f416aa.tar
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.tar.gz
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.tar.bz2
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.tar.lz
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.tar.xz
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.tar.zst
passt-01b6a164d94f26be7ad500f71210bdb888f416aa.zip
tcp_splice: A typo three years ago and SO_RCVLOWAT is gone
In commit e5eefe77435a ("tcp: Refactor to use events instead of states, split out spliced implementation"), this: if (!bitmap_isset(rcvlowat_set, conn - ts) && readlen > (long)c->tcp.pipe_size / 10) { (note the !) became: if (conn->flags & lowat_set_flag && readlen > (long)c->tcp.pipe_size / 10) { in the new tcp_splice_sock_handler(). We want to check, there, if we should set SO_RCVLOWAT, only if we haven't set it already. But, instead, we're checking if it's already set before we set it, so we'll never set it, of course. Fix the check and re-enable the functionality, which should give us improved CPU utilisation in non-interactive cases where we are not transferring at full pipe capacity. Fixes: e5eefe77435a ("tcp: Refactor to use events instead of states, split out spliced implementation") Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp_splice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index 8a39a6f..5d845c9 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -556,7 +556,7 @@ eintr:
if (readlen >= (long)c->tcp.pipe_size * 10 / 100)
continue;
- if (conn->flags & lowat_set_flag &&
+ if (!(conn->flags & lowat_set_flag) &&
readlen > (long)c->tcp.pipe_size / 10) {
int lowat = c->tcp.pipe_size / 4;