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/2026…%40bairaktaris.de