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=1796447203; b=PtQ6NyaUNFv8qExQcx26+yfquwHf9dj3HJSuiPjWIT0E+Ox648NEShDawsQXe+KZKUfj HlHZVcb5RQjSsRbWWhkzPfLT9ScKgAAGNYW8KWhtmmeIHt5kmvvGiXPyu8Q3j3/aK2GXN dvFCLKhLnFmT2tiKS2RH5tUblscE22JjfpfLUNVqJM3zepRmh6pj45ljo3ppx7ViSFCN2 XQy5FH1DlJ5RmVDNK9OdjZPNyTSfxq5v/U5MA3CbU8WsATW400i2lqkBPxYNnJbqAxWkL by1NZD7Nmg9WLiCCfH8CkMv6abcxbmnsEFafsuraiP2VR+QEtYS99+Xgm0Uk5V24hGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796447203; 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=Cw0OZZYXwhesTY69zpNO91QzTA/4KN0NVfoze5OB4WM=; b=2GK35WQW7yZDlBspItJc3fjGSXebotAxyIHyNbv7LRIaxBGNSaLB8j8etxp3PE8vE1ko bADO+u7WJmOGBUO5uzENpa2Zy3qjYjXDFzthfp8rhLZdZougAxBdwLM8oFKODRrIZxXEk uVxNprsAEW0kdKNHEosvACmH7vXtclkTohZitc58Bl12ycE9t40QMXav144QktEYmtxgo VLHc3oHqcT9b6iJ5NnKq2QEYWwu4+LOztorBJSR/eWJkfud0RdvXrulB+kLCiGJe+2mY3 BDSUVFe2X9ZVm8mE47hVVsPINAWqPWxJJg/LTurAHy/hoiwWj4LLhtZMGfYGgXQoaXQ== 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=iBN38ISF; 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 AC95B606A322 for ; Sat, 5 Dec 2026 05:06:43 +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=iBN38ISF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 560F21F0092B; Sat, 5 Dec 2026 05:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796447203; bh=Cw0OZZYXwhesTY69zpNO91QzTA/4KN0NVfoze5OB4WM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iBN38ISF1Lw01YH7Vf3C8ZWKLM8rxIboKLbdlq6QTSYTjj5hTix8I+Rpl1G7JqdAm Ok6U79L3aEUn5PTEyNR4ovlcx80YG3VmSiA/csyr4z4V+kPwF7Bv0CmmtZcdPLfBYd 0jwl8ZsDBxa7YKyGhpklbuu5XtDJ+hDz3Qfz3az1dORAO1XfdTJcSjnAEbvgKLZ+Z9 GZbh9w6tq+LfAmQHwvpyoOXcXHSuSU8JcT6jdUWOFkTy7EDHm3TjICnJCsKB036qGZ x0yuBzpp0R/JpnCsNA1ysmcg6IfTrRzDhfX43f32IWkKiiAjQO8PIDi7sXaRHRMkfK 0o8Gk3sahhKRA== Subject: Re: [PATCH mptcp-next 2/2] selftests: mptcp: check the aggregate pacing rate across two paths From: netdev-bot+sashiko@kernel.org To: zibuyu423@gmail.com Cc: mptcp@lists.linux.dev, kuba@kernel.org Date: Sat, 05 Dec 2026 05:06:42 +0000 Message-ID: <179644720293.3143.8909258729569426518@kernel.org> In-Reply-To: <179630953226.20.8856777451271939865.mptcp-578-0002@gmail.com> References: <179630953226.20.8856777451271939865.mptcp-578-0002@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: mptcp@lists.linux.dev 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 5 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 4 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] selftests: mptcp: mid-script mptcp_lib_kallsyms_has() aborts simult_flows.sh - [Low] The new 'aggregate pacing rate' subtest in simult_flows.sh only checks that the rate is not exceeded. - [Low] The 10% tolerance in the new pacing lower bound does not match its comment, and it leaves only a narrow margin over the script's own… - [Low] The new -a option in mptcp_connect.c parses its argument with parse_int(). - [Low] selftests: mptcp: unconditional pacing checks overwrite retc in do_transfer() -- selftests: mptcp: check the aggregate pacing rate across two paths This commit adds a -a option to mptcp_connect, which sets SO_MAX_PACING_RATE on the connecting socket. It also adds an "aggregate pacing rate" subtest to simult_flows.sh. The subtest runs a transfer over two 10 Mbit/s links with a 14 Mbit/s cap, then checks a minimum transfer duration and that both egress interfaces sent at least 64 KiB. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/578 > diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c > index 8c788977e5947..9a601fe4493a4 100644 > --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c > +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c [ ... ] > @@ -1588,6 +1595,9 @@ static void parse_opts(int argc, char **argv) > case 'm': > cfg_mode = parse_mode(optarg); > break; > + case 'a': > + cfg_pacing_rate = parse_int(optarg); > + break; [Severity: Low] This isn't a bug, but parse_int() reports every failure as a sndbuf problem: tools/testing/selftests/net/mptcp/mptcp_connect.c:parse_int() { ... if (s > INT_MAX) { fprintf(stderr, "Invalid sndbuf size %s (%s)\n", size, strerror(ERANGE)); die_usage(); } ... } The errno path prints the same text. As a result, something like "-a 3000000000" is reported as an invalid sndbuf size, while die_usage() describes -a as setting SO_MAX_PACING_RATE. The -R option already has this mismatch, and the new option adds another caller with it. Could the message be made generic, or name the option being parsed? > case 'S': > cfg_sndbuf = parse_int(optarg); > break; > diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh > index 3ea3d1efe32e1..d4a6bda0e3a24 100755 > --- a/tools/testing/selftests/net/mptcp/simult_flows.sh > +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh [ ... ] > @@ -184,6 +198,23 @@ do_transfer() > wait $spid > local rets=$? > > + if ((rate)); then > + end=$(date +%s%N) > + elapsed=$(((end - start) / 1000000)) > + # Allow one GSO burst and timer jitter at the endpoints. > + min_time=$((size * 1000 / rate * 90 / 100)) [Severity: Low] Should these checks only run when both mptcp_connect instances succeeded? The block runs right after the two wait calls, whatever the values of retc and rets. The client can fail early, for example when connect() fails, the poll timeout fires, or the timeout job kills it. In that case elapsed is below min_time and tx1/tx2 are under 64 KiB. The test then prints "pacing: ..." and "path byte counts too low: ..." on top of the real failure, and overwrites retc with 1. The existing failure report in do_transfer() then shows the wrong value: mptcp_lib_pr_fail "client exit code $retc, server $rets" It prints 1 instead of the exit code mptcp_connect returned. That exit code is the first thing someone debugging the failure needs. If both processes exited 0 and only the pacing or byte-count check failed, the same message reports "client exit code 1, server 0". That points at mptcp_connect instead of the pacing check. The subtest still fails in both cases, so no regression is hidden. The output is just harder to interpret. Could the checks be guarded on retc and rets both being 0? Could the pacing failure also be tracked in a separate variable rather than by reusing retc? [Severity: Low] Does this comment match the tolerance being applied? With the 16 MiB payload and a rate of 1750000, min_time is 8627 ms. The 10% slack is about 960 ms, which is roughly 1.68 MB at 1.75 MB/s. On the kernel side, mptcp_pacing_account() allows idle credit of only about one tick or one MPTCP_SEND_BURST_SIZE burst: net/mptcp/protocol.c:mptcp_pacing_account() { ... credit = min_t(s64, hrtimer_resolution, div64_ul((u64)MPTCP_SEND_BURST_SIZE * NSEC_PER_SEC, rate)); credit = max(credit, interval / 2); ... } At this rate that is around 37 ms, so the slack covers about 25 bursts, not one. The elapsed window is also wider than the transfer itself. It starts before ip netns exec launches the client and ends after wait $spid. It also includes the 200 ms -j sleep on each side. Together this accepts a sustained rate of roughly 16 Mbit/s rather than 14. Is the margin over the per-path cap case wide enough? run_test() budgets an unpaced 2x10 Mbit/s transfer as: local time=$((1000 * size * 8 * 10 / ((rate1 + rate2) * 1000 * 1000 * 9) )) time=$((time + 400 + slack)) That comes to 7906 ms, or 8456 ms with the debug kernel slack, which is only about 170 ms below the 8627 ms threshold. On a slow or debug CI kernel, could a per-subflow cap implementation take more than 8627 ms of shell wall time and still pass? Could the comment be fixed? Could the threshold also be tightened, or be based on a measured unpaced baseline? > + if ((elapsed < min_time)); then > + mptcp_lib_print_err "pacing: ${elapsed}ms, minimum ${min_time}ms" > + retc=1 > + fi [ ... ] > @@ -309,6 +340,23 @@ done > setup > mptcp_lib_subtests_last_ts_reset > run_test 10 10 0 0 20 20 "balanced bwidth" > + > +# Keep the two 10-Mbit/s paths from the previous test. A 14-Mbit/s > +# connection cap leaves room to use both while exposing independent caps. > +msg="aggregate pacing rate" > +mptcp_lib_print_title "$msg" > +if mptcp_lib_kallsyms_has 'mptcp_pacing_account$'; then > + do_transfer "$large" "$small" "$((timeout_poll * 1000))" 1750000 [Severity: Medium] Can this abort the rest of simult_flows.sh on a kernel built without CONFIG_KALLSYMS? mptcp_lib_kallsyms_has() goes through __mptcp_lib_kallsyms_has(), which calls mptcp_lib_check_kallsyms() in mptcp_lib.sh: mptcp_lib_check_kallsyms() { if ! mptcp_lib_has_file "/proc/kallsyms"; then mptcp_lib_pr_skip "CONFIG_KALLSYMS is missing" exit ${KSFT_SKIP} fi } mptcp_connect.sh, mptcp_join.sh, mptcp_sockopt.sh and userspace_pm.sh all call mptcp_lib_check_kallsyms() at startup. simult_flows.sh only calls mptcp_lib_check_mptcp() and mptcp_lib_check_tools(). Until now it ran to completion without /proc/kallsyms, because the grep in setup() is not fatal. With this patch, the script exits with KSFT_SKIP in the middle of the run, right after the "balanced bwidth" subtests. This has three effects: - The four remaining run_test() calls never run. - mptcp_lib_result_print_all_tap() is never reached. - A failure already recorded in ret by the first subtests is reported as a skip. The config fragment in this directory sets CONFIG_KALLSYMS=y, so default selftest builds are fine. Other CI configurations may not enable it, though. Should the script call mptcp_lib_check_kallsyms() at startup like its siblings do? That would skip the whole script on such kernels. Alternatively, the test could check for /proc/kallsyms before calling mptcp_lib_kallsyms_has(), so only the new subtest is skipped. Which behaviour do you prefer here? [Severity: Low] Can this subtest catch a pacer that throttles too much? do_transfer() checks only a lower bound on elapsed time and a 64 KiB floor per egress interface: if ((tx1 < 65536 || tx2 < 65536)); then That floor is under 0.4% of the 16 MiB payload. The only upper bound is the max_time passed here, timeout_poll * 1000 = 30000 ms, which mptcp_connect enforces through -T. That works out to about 4.5 Mbit/s of goodput, which is below a single 10 Mbit/s link. These pacer regressions would still pass: - Charging the shared msk deadline twice per send halves the rate to about 7 Mbit/s, so the transfer takes about 19 s. - Starving one subflow, so nearly all data goes over one 10 Mbit/s path, takes about 14-15 s. A little traffic on the second subflow still clears the 64 KiB floor. The kernel change "mptcp: support a connection-wide SO_MAX_PACING_RATE" says a fixed split "would waste bandwidth when a path is idle". The comment above also says the 14 Mbit/s cap "leaves room to use both" paths. The test does catch independent per-path caps near 20 Mbit/s, which is the case the commit message names. However, the subject says it checks "the aggregate pacing rate across two paths". Could an upper bound be added? One option is size / rate plus the 400 ms of join sleeps plus slack, as run_test() does. Another is to require elapsed to stay below the single-link transfer time. If neither fits, should the commit message say that only a minimum duration is enforced? > + rc=$? > + mptcp_lib_result_code "$rc" "$msg" [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179630953225.20.4977913523988952504.mptcp-578-0000%40gmail.com