From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=c5Uav8Oy; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id D15D35A0271 for ; Thu, 28 May 2026 07:02:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1779944534; bh=hz8pmSgwfzCDOgbZt3eThW293kiwmBbz8T7g+5rMEBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5Uav8OyEffqvUR+sEHBbGTxJzxhdIZhWr/YXIOT5kXq60sUnDQBlLS4MM1onOIIq 7kuSs9xwXsnjS26RO5lZQrndVoZDd2rSdA8wSGJUx5D6W0hY6k5SjdpbU7XdSECiDt HbOuIzYCV2HKiiHjCxHazuVeny5DTTt4XBIFJpr+4WDJPew9ML0Zm6r8VjBBojCS0b pI236ETuqHhDb6zc+/fJCcVeEOV/bGIK6RdEcVL3DaRceQvnZdRYiBv9q3G27b52RC 2ERb7D2Ahc4ogVKVCiCLKgVeMZWAiLqP/KZ334cnoXAXgB8TbMmBwSxNiIVf+D1fHI /Y9qitCFWtqhg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gQvVZ6pBHz4wLl; Thu, 28 May 2026 15:02:14 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 1/8] tcp_splice: Remove never-invoked SO_RCVLOWAT logic Date: Thu, 28 May 2026 15:02:06 +1000 Message-ID: <20260528050213.679685-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528050213.679685-1-david@gibson.dropbear.id.au> References: <20260528050213.679685-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 6CNVVFYKQIDKJF6YINHKV3B6MTHE7L4Y X-Message-ID-Hash: 6CNVVFYKQIDKJF6YINHKV3B6MTHE7L4Y X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: tcp_splice_forward() contains some logic to use the SO_RCVLOWAT setsockopt(). This appears to be aimed at interrupt (epoll) mitigation, so that we're not always waking for a socket that's getting frequent small amounts of data. However, the logic is never invoked, and hasn't been since at least 2022_07_14.b86cd00: it's conditional on readlen > (long)c->tcp.pipe_size / 10 However, immediately before that we've invoked 'continue' if: readlen >= (long)c->tcp_pipe_size * 10 / 100 which is a strictly weaker condition. While it's possible we want to restore a working version of that interrupt mitigation at some point, for the time being this logic just confuses the picture and makes some other cleanups more awkward. We haven't had it for over 3 years, so it's clearly not vital. Signed-off-by: David Gibson --- tcp_splice.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/tcp_splice.c b/tcp_splice.c index 1f969a5c..c066d689 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -530,28 +530,8 @@ retry: written, c->tcp.pipe_size); /* Most common case: skip updating count of pending bytes */ - if (readlen > 0 && readlen == written) { - if (readlen >= (long)c->tcp.pipe_size * 10 / 100) - continue; - - if (!(conn->flags & lowat_set_flag) && - readlen > (long)c->tcp.pipe_size / 10) { - int lowat = c->tcp.pipe_size / 4; - - if (setsockopt(conn->s[fromsidei], SOL_SOCKET, - SO_RCVLOWAT, - &lowat, sizeof(lowat))) { - flow_trace(conn, - "Setting SO_RCVLOWAT %i: %s", - lowat, strerror_(errno)); - } else { - conn_flag(conn, lowat_set_flag); - conn_flag(conn, lowat_act_flag); - } - } - + if (readlen > 0 && readlen == written) continue; - } conn->pending[fromsidei] += readlen > 0 ? readlen : 0; conn->pending[fromsidei] -= written > 0 ? written : 0; -- 2.54.0