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=1796053601; b=U3ivsDAfdQuO90LGft1D10k9JdWFaarlCyed843XJEfT/p2T6L928vF33rRZZXPzDNxR ygonRk79uK9Ziux53s/+i75VSC3BSe4DF0wmNwEayHJgw2GFiumJI/JuAnYBavzgH41VO YGnlkpLUCAkOpYwj7XvXUJkP5mEHpD9hJxKTf6h83oBzz7vILQxyAsAJKj+hAlIBMY7H0 yz95Dd81H2gdGmR0GgnuLEhd1o2/w6n95RRBihp4ebHWIrN5/9H5P/pc4a52e/EoWwB5N EkHGLn97eK0eCOhhajZxDu1A4XWH5f6TjfhRawnEbgh2xcS13bDxbyXAHM+v/FFLoMA== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 756231F00925; Mon, 30 Nov 2026 15:46:40 +0000 (UTC) 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== Subject: Re: [PATCH net-next 3/3] selftests: net: ppp: send on PPPoE from every CPU at once From: netdev-bot+sashiko@kernel.org To: julius@bairaktaris.de 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 Date: Mon, 30 Nov 2026 15:46:40 +0000 Message-ID: <179605360002.3146.17617141315214171279@kernel.org> In-Reply-To: <20261129144319.1489366-4-julius@bairaktaris.de> References: <20261129144319.1489366-4-julius@bairaktaris.de> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@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 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