Article View: linux.kernel.netdev
Article #24670Re: [PATCH net-next 3/3] selftests: net: ppp: send on PPPoE from every CPU at once
From: netdev-bot+sashiko
Date: Mon, 30 Nov 2026 15:46
Date: Mon, 30 Nov 2026 15:46
193 lines
15128 bytes
15128 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 2
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] ppp_test_parallel() sets ncpus=$(nproc), which is a count of
the CPUs in the process's affinity mask, and then pins clients with…
- [Medium] In ppp_test_parallel(), the return codes of `tc qdisc add ...
clsact` and `tc filter add ... protocol ppp_ses flower ppp_proto ...…
- [Low] The comment above client_tx_stats() in
tools/testing/selftests/net/ppp/pppoe.sh says "PPP control frames go…
- [Low] The patch adds `RET=0` before ppp_test_parallel, after log_test
"PPPoE" has already used the connectivity result.
--
selftests: net: ppp: send on PPPoE from every CPU at once
This adds a PPPoE selftest that runs one iperf3 client per CPU, each
pinned with taskset. It compares ppp0's transmit counters against flower
filter counters for IPv4 and IPv6 session frames on the client veth,
re-reading them until two reads 100 ms apart agree.
> diff --git a/tools/testing/selftests/net/ppp/pppoe.sh b/tools/testing/selftests/net/ppp/pppoe.sh
> index f67b51df74907..93c8dbb58818b 100755
> --- a/tools/testing/selftests/net/ppp/pppoe.sh
> +++ b/tools/testing/selftests/net/ppp/pppoe.sh
[ ... ]
> @@ -34,6 +36,82 @@ ip link set "$VETH_CLIENT" netns "$NS_CLIENT"
> ip -netns "$NS_SERVER" link set "$VETH_SERVER" up
> ip -netns "$NS_CLIENT" link set "$VETH_CLIENT" up
>
> +# Print the client's ppp0 transmit counters, then those of the IPv4 and
> +# IPv6 PPPoE session frames leaving its veth. PPP control frames go to
> +# the channel directly and are counted by neither.
[Severity: Low]
Does this hold for NCP frames? LCP and authentication frames go out on
the channel fd. Frames written to the unit fd take the counted transmit
path:
drivers/net/ppp/ppp_generic.c:ppp_write() {
...
case INTERFACE:
ppp_xmit_process(PF_TO_PPP(pf), skb);
...
}
Frames with proto >= 0x8000 skip ppp_xmit_lockless() and reach
ppp_prepare_tx_skb(). That function counts every protocol on ppp0:
drivers/net/ppp/ppp_generic.c:ppp_prepare_tx_skb() {
...
dev_sw_netstats_tx_add(dev, 1, skb->len - PPP_PROTO_LEN);
...
}
pppd writes IPCP (0x8021), IPv6CP (0x8057) and CCP (0x80fd) frames to
the unit fd, so ppp0's tx_packets and tx_bytes include them. The flower
filters in ppp_test_parallel() only match ppp_proto 0x0021 and 0x0057.
Suppose an NCP frame is sent between the before and after snapshots, for
example during an NCP renegotiation or a late IPv6CP/CCP exchange. Would
d[0] then differ from d[2], so the test reports "PPP and Ethernet packet
counts differ" even though the kernel counted correctly?
This is unlikely in a steady-state session during the 3 second window.
Either way, the comment describes a counting model that doesn't fully
hold.
> +client_tx_stats() {
> + local stat
> +
> + for stat in tx_packets tx_bytes; do
> + ip netns exec "$NS_CLIENT" \
> + cat "/sys/class/net/ppp0/statistics/$stat"
> + done
> + tc -n "$NS_CLIENT" -s -j filter show dev "$VETH_CLIENT" egress |
> + jq '[.[].options.actions[0].stats // empty] |
> + (map(.packets) | add), (map(.bytes) | add)'
> +}
[ ... ]
> +ppp_test_parallel() {
> + local ncpus cpu i pids=() before after d=() proto
> +
> + # PPP protocol numbers of IPv4 and IPv6
> + tc -n "$NS_CLIENT" qdisc add dev "$VETH_CLIENT" clsact
> + for proto in 0x0021 0x0057; do
> + tc -n "$NS_CLIENT" filter add dev "$VETH_CLIENT" egress \
> + protocol ppp_ses flower ppp_proto "$proto" action pass
> + done
[Severity: Medium]
What happens if tc can't install these filters? The return codes of the
qdisc and filter add commands aren't checked.
Nothing checks that the installed iproute2 supports flower's ppp_proto
key, which is a recent addition. Nothing checks that cls_flower,
act_gact and sch_ingress are available either.
Without the filters, the jq expression in client_tx_stats() prints null.
If the filter show itself fails, it prints nothing. Bash arithmetic
treats both as 0 in:
d[i]=$((after[i] - before[i]))
d[2] and d[3] end up as 0, and the test fails with "PPP and Ethernet
packet counts differ" when it should skip for a missing feature.
Could the tc setup results be checked so that the test skips in this
case?
> +
> + ncpus=$(nproc)
> + [ "$ncpus" -gt 8 ] && ncpus=8
> + for ((cpu = 0; cpu < ncpus; cpu++)); do
> + ip netns exec "$NS_SERVER" iperf3 -s -1 -D -p $((5301 + cpu))
> + wait_local_port_listen "$NS_SERVER" $((5301 + cpu)) tcp
> + done
> +
> + mapfile -t before < <(client_tx_stats_settled)
> + for ((cpu = 0; cpu < ncpus; cpu++)); do
> + ip netns exec "$NS_CLIENT" taskset -c "$cpu" \
> + iperf3 -c "$IP_SERVER" -p $((5301 + cpu)) -Z -t 3 \
> + > /dev/null &
> + pids+=($!)
> + done
> + for i in "${pids[@]}"; do
> + wait "$i"
> + check_err $? "iperf3 client failed"
> + done
[Severity: Medium]
nproc returns how many CPUs are in the affinity mask, but these loops use
that count as CPU IDs 0..ncpus-1. Can taskset fail when the allowed CPUs
don't start at 0, or when there are gaps?
For example, under a cgroup cpuset of 4-7, nproc returns 4 and the loop
runs taskset -c 0 through 3. __sched_setaffinity() ANDs the requested
mask with cpuset_cpus_allowed(), which leaves an empty mask. The
affinity call fails with EINVAL and taskset exits non-zero.
wait then returns non-zero, and check_err records "iperf3 client
failed". The matching iperf3 -s -1 -D server is left listening. Offline
CPUs can cause the same thing.
The subject and commit message say "from every CPU" and "one iperf3
stream per CPU". The count is silently capped at 8, though.
With nproc == 1 there is only one stream and no concurrency, but
"PPPoE parallel transmit" still reports a pass. Should the test skip
when fewer than 2 CPUs are available?
[ ... ]
> @@ -53,6 +131,11 @@ ppp_test_connectivity
>
> log_test "PPPoE"
>
> +RET=0
> +ppp_test_parallel
> +
> +log_test "PPPoE parallel transmit"
> +
> # Dump syslog messages if the test failed
> if [ "$RET" -ne 0 ]; then
[Severity: Low]
Does resetting RET lose the syslog dump when the connectivity test
fails? log_test() in net/lib.sh merges RET into EXIT_STATUS and leaves
RET as it was. Before this change, this check reflected the result of
ppp_test_connectivity.
Now suppose ppp_test_connectivity fails and ppp_test_parallel passes.
The run still fails through EXIT_STATUS, but this check is false, so the
pppd/pppoe-server log is not printed.
pppol2tp.sh in the same directory has the same two-test structure and
keys its dump on EXIT_STATUS. Could this check use EXIT_STATUS too?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261129144319.1489366-1-julius%40bairaktaris.de
Technical Details
Message-ID:
<179605360002.3146.17617141315214171279@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374280-linux-kernel-netdev=dewy.ruReferences:
<20261129144319.1489366-4-julius@bairaktaris.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374280-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 3/3] selftests: net: ppp: send on PPPoE from every CPU at once Date: Mon, 30 Nov 2026 15:46:40 +0000 Organization: Usenet Network Message-ID: <179605360002.3146.17617141315214171279@kernel.org> References: <20261129144319.1489366-4-julius@bairaktaris.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1459816"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:bFe0RjjHAAEvIocTxPo+xbqQgiI= sha256:nD6i2KJrZxuUwa51ICUAQhiVVZdSGWPlT/mScrcFV7g= sha1:IlsxCp+k9GGAi8tvLbxJ2XKG2qw= sha256:k94KEWVna2el2lCaLviGx43LVXdzQ18OZszivwn/4mA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DEE6A125FF3; Mon, 30 Nov 2026 18:47:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5Rb5YJasb0Yh; Mon, 30 Nov 2026 18:47:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374280-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E23FA125FF2; Mon, 30 Nov 2026 18:47:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 8605F32E2C; Mon, 30 Nov 2026 15:46:53 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796053607; b=Kjc89nXjVSc5KWiA3/lYAKelEeHS58Ht4FxiIG7zQ1a772XFqbW+sY60SmcCqbEqb3i1 Cod3MD8J9IhbCW4TaCUoMQ3a8zUIoPdmeSCpz+n1YibmFR/cJNabODl1k2LRaVtb8IfoP 7WxS8N7ZW0qdzhO+NjwqXdaf670YfINq8oH7T91MUowbSi6s091YeaQpBHyGIXZJvi0E7 KsKtsSbngZLVSuNnNlzsK3mANDe6Yr9X4FB+aZRUDw8OGNDY7dBR5C4uFnFtk9P29QuaE UdubLn9dm7/twplgRm3VRxKUO0IA+/PX6eSmAHpMAAQJvvCh9N4Oe17BgWVWCFYBujA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796053607; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=tLHG0eZEuPkzhHm93XOPvVJN7Bh2EYuUN6e1YfEoRiU=; b=MgwDHwqvq5c2uTDCN1sXCEZToDrr3RD0WMQ4sBw+OSYtRethiwa23NwJyytBtf0+x8+w TyupUNZwfbl+5F85JcPUl5hxApUwWPLxOzp7XXl+XPDZF7s91VtgUyDER0TdGOF9z5rjz 25Zx+SJGnJDggoaYEpQKc9QAKOM9Fufi7t0uFIjRYhCuTgAfq4rAR3wDdzQu+eyWAETRX mIgrY94dHscV+SmvQZuKu/KUdKWLzEhT5D7Zv7LUzMGnvckWiBuZVFJtsNOpJ+X8/XitG wRto5BExKRtNvrCxPlTOyaRHA32472XT4bj27jBaqZHkAYwhWd3bbzBQplp/xDy9juA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=j2VS6Bcj; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 741B8606A68E; Mon, 30 Nov 2026 15:46:47 +0000 (UTC) X-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=j2VS6Bcj X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796053601; b=U3ivsDAfdQuO90LGft1D10k9JdWFaarlCyed843XJEfT/p2T6L928vF33rRZZXPzDNxR ygonRk79uK9Ziux53s/+i75VSC3BSe4DF0wmNwEayHJgw2GFiumJI/JuAnYBavzgH41VO YGnlkpLUCAkOpYwj7XvXUJkP5mEHpD9hJxKTf6h83oBzz7vILQxyAsAJKj+hAlIBMY7H0 yz95Dd81H2gdGmR0GgnuLEhd1o2/w6n95RRBihp4ebHWIrN5/9H5P/pc4a52e/EoWwB5N EkHGLn97eK0eCOhhajZxDu1A4XWH5f6TjfhRawnEbgh2xcS13bDxbyXAHM+v/FFLoMA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796053601; 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=tLHG0eZEuPkzhHm93XOPvVJN7Bh2EYuUN6e1YfEoRiU=; b=5hN+pSx2UgRMk8CaehW3rzaI9vdmvfGXsJx0GhB6d30RyhV8vp9sPP5TYR7Ltei3qRL4 RBaS/IxzDjS6w3v76JvUM4gO4kHO2ATKwg1oHbCnuDMs4isaZXa31lJM/JmiK93oaf5jb iHszlz2q2DXb8rAmMPJ1zxmdKvvr9EbVrAFlsY1/7PYoduxXvDB8olbGQFIYxy9c+Qe5a PfZY8tqxkLqIOYMhmvCZGaUYD5QjNFnUkaUnQvXk3dBJO5gKOW2143FvzaYrHdAVuTorO iA3A5D/ll5c2RQJ3e4/oiqZUMDIxUqvd4tXzeePsRKwlj0B8dADhoQQbFlrr6S8ZiqA== X-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=j2VS6Bcj; arc=none smtp.remote-ip=100.103.45.18 X-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 958F2606A333; Mon, 30 Nov 2026 15:46:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 756231F00925; Mon, 30 Nov 2026 15:46:40 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796053601; bh=tLHG0eZEuPkzhHm93XOPvVJN7Bh2EYuUN6e1YfEoRiU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=j2VS6BcjHV1XQbwlqtg94wRn+GqxbCl4udr375YIBa9WQDWVF1Zes4IfqXAYCzpsD sCDzERn9vgHff/ThoHw51RZpJMCO0RQ4jHfID1Zg1Z9rXVEqNqAqYaqNzxEow8FyVf NYl5ktgiURL7czci6knsyGUS1VSyCtLWiRbZZCRBovqYQ/WTZfv02tVzppLlfiG4eY 63bdYtt7p7w14HPZHPOZmqxOZ+f1rSwGv3DvQ5xx42CEPfLIMYdM0X+zP5RuAC765l 5/yunPeoznepqb7P1ihRTq31CZGK5Fga1zO5cx1AspZQmVfsHwv11s3H/IxdZ4j0or jURtWUUhJ72xA== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, shuah@kernel.org, qingfang.deng@linux.dev, gnault@redhat.com, bigeasy@linutronix.de, 26031212468@stu.xidian.edu.cn, linux-ppp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org X-In-Reply-To: <20261129144319.1489366-4-julius@bairaktaris.de> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list