Commit 16f6458f authored by Willem de Bruijn's avatar Willem de Bruijn Committed by David S. Miller

selftests/net: relax cpu affinity requirement in msg_zerocopy test

The msg_zerocopy test pins the sender and receiver threads to separate
cores to reduce variance between runs.

But it hardcodes the cores and skips core 0, so it fails on machines
with the selected cores offline, or simply fewer cores.

The test mainly gives code coverage in automated runs. The throughput
of zerocopy ('-z') and non-zerocopy runs is logged for manual
inspection.

Continue even when sched_setaffinity fails. Just log to warn anyone
interpreting the data.

Fixes: 07b65c5b ("test: add msg_zerocopy test")
Reported-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent adf73410
...@@ -125,9 +125,8 @@ static int do_setcpu(int cpu) ...@@ -125,9 +125,8 @@ static int do_setcpu(int cpu)
CPU_ZERO(&mask); CPU_ZERO(&mask);
CPU_SET(cpu, &mask); CPU_SET(cpu, &mask);
if (sched_setaffinity(0, sizeof(mask), &mask)) if (sched_setaffinity(0, sizeof(mask), &mask))
error(1, 0, "setaffinity %d", cpu); fprintf(stderr, "cpu: unable to pin, may increase variance.\n");
else if (cfg_verbose)
if (cfg_verbose)
fprintf(stderr, "cpu: %u\n", cpu); fprintf(stderr, "cpu: %u\n", cpu);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment