summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2020-08-05 04:40:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-11 15:32:35 +0200
commit615214ab782aac760771dedf870366f38b27e902 (patch)
tree2cc7f25682759a007c33adb89535a054880b2e6e /tools/testing/selftests/net
parent719a92fae0434d11ee86d0f679663c14a2a13fc1 (diff)
downloadlinux-stable-615214ab782aac760771dedf870366f38b27e902.tar.gz
linux-stable-615214ab782aac760771dedf870366f38b27e902.tar.bz2
linux-stable-615214ab782aac760771dedf870366f38b27e902.zip
selftests/net: relax cpu affinity requirement in msg_zerocopy test
[ Upstream commit 16f6458f2478b55e2b628797bc81a4455045c74e ] 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: 07b65c5b31ce ("test: add msg_zerocopy test") Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/net')
-rw-r--r--tools/testing/selftests/net/msg_zerocopy.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c
index 406cc70c571d..c539591937a1 100644
--- a/tools/testing/selftests/net/msg_zerocopy.c
+++ b/tools/testing/selftests/net/msg_zerocopy.c
@@ -125,9 +125,8 @@ static int do_setcpu(int cpu)
CPU_ZERO(&mask);
CPU_SET(cpu, &mask);
if (sched_setaffinity(0, sizeof(mask), &mask))
- error(1, 0, "setaffinity %d", cpu);
-
- if (cfg_verbose)
+ fprintf(stderr, "cpu: unable to pin, may increase variance.\n");
+ else if (cfg_verbose)
fprintf(stderr, "cpu: %u\n", cpu);
return 0;