From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796148631; b=vQa3dsp4+8z1VkIInKFQKchu/bzY+v7jRryaoD9wEcpPt3r9Jn7ry6wx1DryxE4i6K3y 1c/7ifVYKkckjus4uIAw45bGCi/O1fzrqc4tTghQw8UzCPbKH+mI/ZbFIkndU7cxxcVWV k8V8OSjmYqoiln14jGqztHh7S/maSG2CHZeDve1pL0zxiGvpUQaXWZtOkqM3JaJuwoUAk p/bHuiOgfb/86VZCvXVk5vO4cRkhDqaD3ola9sUULGKSwo0GJu0EZxuXCe+JLiN9bYzfC SiCGItVZATmw53tcays0Il84+MOgoEgVgmcPgOoYbcp3nl8iqvDmym3RXMvvbfea6aw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796148631; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=0MNyNtPaSVRMfD6bkPhOM2FuPmY8j2w/+NNWG7s99vo=; b=xfcWMV9J5S3UgESlfFQwRdbj7tUyaWULAXic/1/+gKadxuFojDkD40OwVxZNmLITjGyg ilsXRVjw33pdZfs6D3Ix6AIV0Lb/fDw19L27q+ijEfOlKQOK0NF4NoXSByD5lg00//U3c /RmkRfFCYXAV4H4nAIO/8LIt7I9MUfmuDWyeYodr+G8a9DH7Y1aG0/gFBFtStqcjh6SNa Vze/HeUozBfvQlvp8dY/ZblCwKCJY9uiMr69VI2drg5Rf2yaZOD3Gl9Z0AG4Iz8dv9c0y f7CU9ZqC9xyxd7ZgHrvAb4wi+GjJ0uQ7JQ9Cwd3vKM/4ayC0+p8rW6JgA/bopEZa+tw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L8ubjlaF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A575606A335; Tue, 1 Dec 2026 18:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L8ubjlaF Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF3E11F00926; Tue, 1 Dec 2026 18:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796148631; bh=0MNyNtPaSVRMfD6bkPhOM2FuPmY8j2w/+NNWG7s99vo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=L8ubjlaFg9e1T3Zh/XFLzNwCicVri8zutBsL5vXWPTQBZJOe8rVQi7mBeIdzD11sZ b8UaqqjKvY/VyYr4XtB4Axu7CnAMKX8sDKsNzhZWPj1kkLqn8b+5vzoTTo+a7stHqF EggFtHQWroua9afNnFO3XS95v4hI/J80QEkX+G5Jm3xDOdBwEopuuqtdK7esu9iaaw UNoFK7IhfiLA3Xp9eV/kkTa2hG+1Pb2dVWIFwMSm78KqGhd9JUGvNq9ika6UHZb/wk iRScAe/2zAsx2T7VZinm6MgIcss1kSkztlLMUIl/qZVwMi8s+cnjYUlzDJ8kcFoBZw RC8YHl3D7wxvQ== Subject: Re: [PATCH net-next v2 3/4] selftests: drv-net: add a kperf stream test From: netdev-bot+sashiko@kernel.org To: sdf.kernel@gmail.com Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch, edumazet@kernel.org, shuah@kernel.org, sdf@fomichev.me, bjorn@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Date: Tue, 01 Dec 2026 18:10:30 +0000 Message-ID: <179614863027.3146.1700516544609872670@kernel.org> In-Reply-To: <20261130174609.314114-4-sdf.kernel@gmail.com> References: <20261130174609.314114-4-sdf.kernel@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The "zerocopy" variant of tcp() in stream.py adds "--msg- zerocopy" and "--zerocopy-rx". - [Low] The commit message for stream.py says it measures one TCP connection "with the same settings as devmem.py otherwise". -- selftests: drv-net: add a kperf stream test This adds stream.py, a drv-net perf selftest that uses kperf to measure the throughput of a single TCP connection. It has two variants: plain copy, and MSG_ZEROCOPY on the sender with TCP_ZEROCOPY_RECEIVE on the receiver. > Add stream.py, which measures the throughput of one TCP connection with > kperf, with the same settings as devmem.py otherwise: once over copying > sockets, and once with MSG_ZEROCOPY on the sender and > TCP_ZEROCOPY_RECEIVE on the receiver. [Severity: Low] Is "with the same settings as devmem.py otherwise" accurate? The two tests share the kperf client options: --time 15, the 64 MiB read and write sizes, --pin-off 4 and --validate no. devmem.py's kperf() also sets up the device before it measures: tools/testing/selftests/drivers/net/perf/devmem.py:kperf() { ... _enable_hw_gro(cfg) ... "tcp-data-split": "enabled", ... config["hds-thresh"] = 0 defer(ethnl.rings_set, restore) ethnl.rings_set(config) ... "--num-rx-queues", "4", ... } stream.py's tcp() does none of this, so it runs with the driver's default GRO, HDS and RSS settings. The message only mentions the change from 4 connections to 1. Could the message say that the device-level setup also differs? Then the stream.py and devmem.py numbers wouldn't be read as directly comparable. > diff --git a/tools/testing/selftests/drivers/net/perf/stream.py b/tools/testing/selftests/drivers/net/perf/stream.py > new file mode 100755 > index 0000000000000..4ed9d64dfa320 > --- /dev/null > +++ b/tools/testing/selftests/drivers/net/perf/stream.py > @@ -0,0 +1,40 @@ [ ... ] > +@ksft_variants([ > + KsftNamedVariant("copy", []), > + KsftNamedVariant("zerocopy", ["--msg-zerocopy", "--zerocopy-rx"]), > +]) > +def tcp(cfg, mode_args) -> None: > + """Measure the throughput of one TCP connection.""" > + stream_args = [ [ ... ] > + with KperfRunner(cfg) as runner: > + result = runner.run(stream_args) > + > + ksft_metric("throughput", result.target_throughput, goal="higher") [Severity: Medium] Does the zerocopy variant actually exercise TCP_ZEROCOPY_RECEIVE on a device with default settings? The variant only adds kperf flags. On the kernel side, can_map_frag() only maps full-page frags at offset 0: net/ipv4/tcp.c:can_map_frag() { ... if (skb_frag_size(frag) != PAGE_SIZE || skb_frag_off(frag)) return false; ... } NICs normally produce frags like that only with header-data split and an MTU large enough for page-sized payloads. stream.py sets neither. devmem.py at least enables tcp-data-split. With no HDS and a 1500 MTU, every payload frag fails can_map_frag(). tcp_zerocopy_receive() then maps nothing, and the receiver copies the data instead. Nothing here checks whether zerocopy happened. KperfRunner.parse() in drivers/net/lib/py/kperf.py only extracts throughput, rate and latency: return KperfResult(sum(throughput["Source"]), sum(throughput["Target"]), **rr) tcp() then reports only the throughput metric. Can the "zerocopy" result come from the copy receive path and still be labelled zerocopy? If so, a loss of TCP_ZEROCOPY_RECEIVE, or a regression in it, would not show up in this sub-case. If kperf fails instead of falling back when nothing can be mapped, wouldn't this variant fail on most default setups? Would it make sense to enable HDS (and possibly raise the MTU) for this variant? Another option is to check that pages were actually mapped, or that SO_EE_CODE_ZEROCOPY_COPIED was not reported. [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130174609.314114-1-sdf.kernel%40gmail.com