selftests: mptcp: pm_nl_ctl: print sizeof() with %zu
Subsystems (4)
PATCH 1/1 selftests: mptcp: pm_nl_ctl: print sizeof() with %zu
On 32-bit architectures size_t is an unsigned int, and printing sizeof(struct nlmsgerr) with %ld warns:
pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
Use %zu.
---
Found with a 32-bit build of the selftests with a 64-bit time_t (gcc 16 and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64); KernelCI's 32-bit arm builds show the same warnings. The changed files build without format warnings there now, and the x86_64 builds don't change. The other selftests get the same kind of fix in separate patches.
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c +1 -1
@@ -70,7 +70,7 @@ static int nl_error(struct nlmsghdr *nh)uint32_t off;if (len <sizeof (struct nlmsgerr )) { -error (1 ,0 ,"netlink error message truncated %d min %ld" , len, +error (1 ,0 ,"netlink error message truncated %d min %zu" , len,sizeof (struct nlmsgerr ));return -1 ; }
Signature · 1 line
2.53.0
Hi Sasha,
Quoted 6 lines · Sasha Levin
On 32-bit architectures
size_tis an unsigned int, and printing sizeof(struct nlmsgerr) with %ld warns:pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
Use %zu.
Thank you for the fix, it looks good to me:
@Net maintainers: please apply this patch to net-next directly.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Hi Sasha,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Perf: Unstable: 9 failed test(s): error:mptcp-perf error:sched-baseline(18) error:sched-bbr(14) error:sched-clientlim(12) error:sched-cpu-preempt(2) error:sched-mem-pressure(9) error:sched-rmem(16) error:sched-serverlim(28) error:sched-weak-secondary(12) - Critical: mptcp-perf/01-Test_1/client.log: Global Timeout - Critical: sched-baseline/01-slow_primary/client.log: Global Timeout - Critical: sched-baseline/02-tiny_primary/client.log: Global Timeout - Critical: sched-baseline/03-fast_both/client.log: Global Timeout - Critical: sched-baseline/04-balanced/client.log: Global Timeout - Critical: sched-baseline/05-slow_near_primary/client.log: Global Timeout - Critical: sched-baseline/06-slow_secondary/client.log: Global Timeout - Critical: sched-baseline/07-very_fast/client.log: Global Timeout - Critical: sched-baseline/08-shallow_primary/client.log: Global Timeout - Critical: sched-baseline/09-high_lat_primary/client.log: Global Timeout - Critical: sched-baseline/10-huge_lat_primary/client.log: Global Timeout - Critical: sched-baseline/11-high_lat_secondary/client.log: Global Timeout - Critical: sched-baseline/12-huge_lat_secondary/client.log: Global Timeout - Critical: sched-baseline/13-bloated_primary/client.log: Global Timeout - Critical: sched-baseline/14-bloated_secondary/client.log: Global Timeout - Critical: sched-baseline/15-slow_primary_upload/client.log: Global Timeout - Critical: sched-baseline/16-balanced_upload/client.log: Global Timeout - Critical: sched-baseline/17-slow_primary_parallel_4/client.log: Global Timeout - Critical: sched-baseline/18-balanced_parallel_4/client.log: Global Timeout - Critical: sched-bbr/01-slow_primary_bbr/client.log: Global Timeout - Critical: sched-bbr/02-balanced_bbr/client.log: Global Timeout - Critical: sched-bbr/03-slow_near_primary_bbr/client.log: Global Timeout - Critical: sched-bbr/04-high_lat_primary_bbr/client.log: Global Timeout - Critical: sched-bbr/05-huge_lat_primary_bbr/client.log: Global Timeout - Critical: sched-bbr/06-high_lat_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/07-huge_lat_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/08-slow_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/09-very_fast_bbr/client.log: Global Timeout - Critical: sched-bbr/10-bloated_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/11-bloated_slow_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/12-very_bloated_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/13-bad_secondary_bbr/client.log: Global Timeout - Critical: sched-bbr/14-far_secondary_bbr/client.log: Global Timeout - Critical: sched-clientlim/01-slow_primary_bw_5/client.log: Global Timeout - Critical: sched-clientlim/02-balanced_bw_5/client.log: Global Timeout - Critical: sched-clientlim/03-huge_lat_primary_bw_5/client.log: Global Timeout - Critical: sched-clientlim/04-slow_secondary_bw_5/client.log: Global Timeout - Critical: sched-clientlim/05-slow_primary_bw_10/client.log: Global Timeout - Critical: sched-clientlim/06-balanced_bw_10/client.log: Global Timeout - Critical: sched-clientlim/07-huge_lat_primary_bw_10/client.log: Global Timeout - Critical: sched-clientlim/08-slow_secondary_bw_10/client.log: Global Timeout - Critical: sched-clientlim/09-slow_primary_bw_50/client.log: Global Timeout - Critical: sched-clientlim/10-balanced_bw_50/client.log: Global Timeout - Critical: sched-clientlim/11-huge_lat_primary_bw_50/client.log: Global Timeout - Critical: sched-clientlim/12-slow_secondary_bw_50/client.log: Global Timeout - Critical: sched-cpu-preempt/01-shallow_primary/client.log: Global Timeout - Critical: sched-cpu-preempt/02-shallow_primary_cpu_hog/client.log: Global Timeout - Critical: sched-mem-pressure/01-bloated_slow_secondary_receiver_tcp_mem_parallel_1/client.log: Global Timeout - Critical: sched-mem-pressure/02-bloated_slow_secondary_receiver_tcp_mem_parallel_16/client.log: Global Timeout - Critical: sched-mem-pressure/03-bloated_slow_secondary_receiver_tcp_mem_parallel_99/client.log: Global Timeout - Critical: sched-mem-pressure/04-very_bloated_primary_both_tcp_mem_parallel_1/client.log: Global Timeout - Critical: sched-mem-pressure/05-slow_primary_both_tcp_mem_parallel_1/client.log: Global Timeout - Critical: sched-mem-pressure/06-balanced_both_tcp_mem_parallel_1/client.log: Global Timeout - Critical: sched-mem-pressure/07-very_bloated_primary_both_tcp_mem_parallel_10/client.log: Global Timeout - Critical: sched-mem-pressure/08-slow_primary_both_tcp_mem_parallel_10/client.log: Global Timeout - Critical: sched-mem-pressure/09-balanced_both_tcp_mem_parallel_10/client.log: Global Timeout - Critical: sched-rmem/01-slow_primary_rmem_200/client.log: Global Timeout - Critical: sched-rmem/02-balanced_rmem_200/client.log: Global Timeout - Critical: sched-rmem/03-huge_lat_primary_rmem_200/client.log: Global Timeout - Critical: sched-rmem/04-bloated_primary_rmem_200/client.log: Global Timeout - Critical: sched-rmem/05-slow_primary_rmem_800/client.log: Global Timeout - Critical: sched-rmem/06-balanced_rmem_800/client.log: Global Timeout - Critical: sched-rmem/07-huge_lat_primary_rmem_800/client.log: Global Timeout - Critical: sched-rmem/08-bloated_primary_rmem_800/client.log: Global Timeout - Critical: sched-rmem/09-slow_primary_rmem_2000/client.log: Global Timeout - Critical: sched-rmem/10-balanced_rmem_2000/client.log: Global Timeout - Critical: sched-rmem/11-huge_lat_primary_rmem_2000/client.log: Global Timeout - Critical: sched-rmem/12-bloated_primary_rmem_2000/client.log: Global Timeout - Critical: sched-rmem/13-slow_primary_rmem_6000/client.log: Global Timeout - Critical: sched-rmem/14-balanced_rmem_6000/client.log: Global Timeout - Critical: sched-rmem/15-huge_lat_primary_rmem_6000/client.log: Global Timeout - Critical: sched-rmem/16-bloated_primary_rmem_6000/client.log: Global Timeout - Critical: sched-serverlim/01-slow_primary_bw_5_burst_10/client.log: Global Timeout - Critical: sched-serverlim/02-balanced_bw_5_burst_10/client.log: Global Timeout - Critical: sched-serverlim/03-huge_lat_primary_bw_5_burst_10/client.log: Global Timeout - Critical: sched-serverlim/04-slow_secondary_bw_5_burst_10/client.log: Global Timeout - Critical: sched-serverlim/05-slow_primary_bw_5_burst_250/client.log: Global Timeout - Critical: sched-serverlim/06-balanced_bw_5_burst_250/client.log: Global Timeout - Critical: sched-serverlim/07-huge_lat_primary_bw_5_burst_250/client.log: Global Timeout - Critical: sched-serverlim/08-slow_secondary_bw_5_burst_250/client.log: Global Timeout - Critical: sched-serverlim/09-slow_primary_bw_10_burst_10/client.log: Global Timeout - Critical: sched-serverlim/10-balanced_bw_10_burst_10/client.log: Global Timeout - Critical: sched-serverlim/11-huge_lat_primary_bw_10_burst_10/client.log: Global Timeout - Critical: sched-serverlim/12-slow_secondary_bw_10_burst_10/client.log: Global Timeout - Critical: sched-serverlim/13-slow_primary_bw_10_burst_250/client.log: Global Timeout - Critical: sched-serverlim/14-balanced_bw_10_burst_250/client.log: Global Timeout - Critical: sched-serverlim/15-huge_lat_primary_bw_10_burst_250/client.log: Global Timeout - Critical: sched-serverlim/16-slow_secondary_bw_10_burst_250/client.log: Global Timeout - Critical: sched-serverlim/17-slow_primary_bw_50_burst_10/client.log: Global Timeout - Critical: sched-serverlim/18-balanced_bw_50_burst_10/client.log: Global Timeout - Critical: sched-serverlim/19-huge_lat_primary_bw_50_burst_10/client.log: Global Timeout - Critical: sched-serverlim/20-slow_secondary_bw_50_burst_10/client.log: Global Timeout - Critical: sched-serverlim/21-slow_primary_bw_50_burst_250/client.log: Global Timeout - Critical: sched-serverlim/22-balanced_bw_50_burst_250/client.log: Global Timeout - Critical: sched-serverlim/23-huge_lat_primary_bw_50_burst_250/client.log: Global Timeout - Critical: sched-serverlim/24-slow_secondary_bw_50_burst_250/client.log: Global Timeout - Critical: sched-serverlim/25-slow_primary_bw_10_burst_10_wmem_6000/client.log: Global Timeout - Critical: sched-serverlim/26-balanced_bw_10_burst_10_wmem_6000/client.log: Global Timeout - Critical: sched-serverlim/27-slow_primary_bw_50_burst_10_wmem_6000/client.log: Global Timeout - Critical: sched-serverlim/28-balanced_bw_50_burst_10_wmem_6000/client.log: Global Timeout - Critical: sched-weak-secondary/01-weak_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/02-bad_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/03-far_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/04-bloated_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/05-bloated_slow_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/06-very_bloated_secondary/client.log: Global Timeout - Critical: sched-weak-secondary/07-weak_secondary_backup/client.log: Global Timeout - Critical: sched-weak-secondary/08-bad_secondary_backup/client.log: Global Timeout - Critical: sched-weak-secondary/09-far_secondary_backup/client.log: Global Timeout - Critical: sched-weak-secondary/10-bloated_secondary_backup/client.log: Global Timeout - Critical: sched-weak-secondary/11-bloated_slow_secondary_backup/client.log: Global Timeout - Critical: sched-weak-secondary/12-very_bloated_secondary_backup/client.log: Global Timeout ❌
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/41676758646
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/e73b56681d5d
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1200578
If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normalFor more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
Matthieu Baerts
maintainerQuoted 9 lines · MPTCP CI
Our CI did some validations and here is its report:
- KVM Validation: normal (except
selftest_mptcp_join): Success! ✅
- KVM Validation: normal (onlyselftest_mptcp_join): Success! ✅
- KVM Validation: debug (exceptselftest_mptcp_join): Success! ✅
- KVM Validation: debug (onlyselftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (onlybpftest_all): Success! ✅
- KVM Validation: btf-debug (onlybpftest_all): Success! ✅
- Perf: Unstable: 9 failed test(s): error:mptcp-perf error:sched-baseline(18) error:sched-bbr(14) error:sched-clientlim(12) (...)
GitHub Actions couldn't access github.com :)
Please ignore this, I'm going to send a fix for that.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Quoted 35 lines · Sasha Levin
On 32-bit architectures
size_tis an unsigned int, and printing sizeof(struct nlmsgerr) with %ld warns:pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
Use %zu.
Signed-off-by Sasha Levin <[email protected]>---
Found with a 32-bit build of the selftests with a 64-bittime_t(gcc 16 and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64); KernelCI's 32-bit arm builds show the same warnings. The changed files build without format warnings there now, and thex86_64builds don't change. The other selftests get the same kind of fix in separate patches.tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/net/mptcp/pm_nl_ctl.c +1
-1@@ -70,7 +70,7 @@ static int nl_error(struct nlmsghdr *nh)uint32_t off;if (len <sizeof (struct nlmsgerr )) { -error (1 ,0 ,"netlink error message truncated %d min %ld" , len, +error (1 ,0 ,"netlink error message truncated %d min %zu" , len,sizeof (struct nlmsgerr ));return -1 ; }Signature · 1 line
2.53.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Tue, 3 Nov 2026 10:55:06 -0500 you wrote:
On 32-bit architectures
size_tis an unsigned int, and printing sizeof(struct nlmsgerr) with %ld warns:pm_nl_ctl.c:73:71: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'unsigned int' [-Wformat=]
Use %zu.
[...]
Here is the summary with links:
- selftests: mptcp: pm_nl_ctl: print sizeof() with %zu
https://git.kernel.org/netdev/net-next/c/1146fbb8024b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html