diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2018-08-08 17:00:39 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-09 15:50:44 -0400 |
commit | 37d7ff25957e05860e068a986209fee128db574a (patch) | |
tree | 33c5db1b89a72b50902792c02810278c32393744 | |
parent | ad0ab027fc6da08cbd34070d816ff3b7986c64ae (diff) |
samples/bpf: xdp_redirect_cpu adjustment to reproduce teardown race easier
The teardown race in cpumap is really hard to reproduce. These changes
makes it easier to reproduce, for QA.
The --stress-mode now have a case of a very small queue size of 8, that helps
to trigger teardown flush to encounter a full queue, which results in calling
xdp_return_frame API, in a non-NAPI protect context.
Also increase MAX_CPUS, as my QA department have larger machines than me.
Tested-by: Jean-Tsung Hsiao <jhsiao@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r-- | samples/bpf/xdp_redirect_cpu_kern.c | 2 | ||||
-rw-r--r-- | samples/bpf/xdp_redirect_cpu_user.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/samples/bpf/xdp_redirect_cpu_kern.c b/samples/bpf/xdp_redirect_cpu_kern.c index 303e9e7161f3..4938dcbaecbf 100644 --- a/samples/bpf/xdp_redirect_cpu_kern.c +++ b/samples/bpf/xdp_redirect_cpu_kern.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <uapi/linux/bpf.h> | 14 | #include <uapi/linux/bpf.h> |
15 | #include "bpf_helpers.h" | 15 | #include "bpf_helpers.h" |
16 | 16 | ||
17 | #define MAX_CPUS 12 /* WARNING - sync with _user.c */ | 17 | #define MAX_CPUS 64 /* WARNING - sync with _user.c */ |
18 | 18 | ||
19 | /* Special map type that can XDP_REDIRECT frames to another CPU */ | 19 | /* Special map type that can XDP_REDIRECT frames to another CPU */ |
20 | struct bpf_map_def SEC("maps") cpu_map = { | 20 | struct bpf_map_def SEC("maps") cpu_map = { |
diff --git a/samples/bpf/xdp_redirect_cpu_user.c b/samples/bpf/xdp_redirect_cpu_user.c index f6efaefd485b..4b4d78fffe30 100644 --- a/samples/bpf/xdp_redirect_cpu_user.c +++ b/samples/bpf/xdp_redirect_cpu_user.c | |||
@@ -19,7 +19,7 @@ static const char *__doc__ = | |||
19 | #include <arpa/inet.h> | 19 | #include <arpa/inet.h> |
20 | #include <linux/if_link.h> | 20 | #include <linux/if_link.h> |
21 | 21 | ||
22 | #define MAX_CPUS 12 /* WARNING - sync with _kern.c */ | 22 | #define MAX_CPUS 64 /* WARNING - sync with _kern.c */ |
23 | 23 | ||
24 | /* How many xdp_progs are defined in _kern.c */ | 24 | /* How many xdp_progs are defined in _kern.c */ |
25 | #define MAX_PROG 5 | 25 | #define MAX_PROG 5 |
@@ -527,7 +527,7 @@ static void stress_cpumap(void) | |||
527 | * procedure. | 527 | * procedure. |
528 | */ | 528 | */ |
529 | create_cpu_entry(1, 1024, 0, false); | 529 | create_cpu_entry(1, 1024, 0, false); |
530 | create_cpu_entry(1, 128, 0, false); | 530 | create_cpu_entry(1, 8, 0, false); |
531 | create_cpu_entry(1, 16000, 0, false); | 531 | create_cpu_entry(1, 16000, 0, false); |
532 | } | 532 | } |
533 | 533 | ||