Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d7ff25 authored by Jesper Dangaard Brouer's avatar Jesper Dangaard Brouer Committed by Daniel Borkmann
Browse files

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: default avatarJean-Tsung Hsiao <jhsiao@redhat.com>
Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent ad0ab027
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
#include <uapi/linux/bpf.h>
#include <uapi/linux/bpf.h>
#include "bpf_helpers.h"
#include "bpf_helpers.h"


#define MAX_CPUS 12 /* WARNING - sync with _user.c */
#define MAX_CPUS 64 /* WARNING - sync with _user.c */


/* Special map type that can XDP_REDIRECT frames to another CPU */
/* Special map type that can XDP_REDIRECT frames to another CPU */
struct bpf_map_def SEC("maps") cpu_map = {
struct bpf_map_def SEC("maps") cpu_map = {
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ static const char *__doc__ =
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <linux/if_link.h>
#include <linux/if_link.h>


#define MAX_CPUS 12 /* WARNING - sync with _kern.c */
#define MAX_CPUS 64 /* WARNING - sync with _kern.c */


/* How many xdp_progs are defined in _kern.c */
/* How many xdp_progs are defined in _kern.c */
#define MAX_PROG 5
#define MAX_PROG 5
@@ -527,7 +527,7 @@ static void stress_cpumap(void)
	 * procedure.
	 * procedure.
	 */
	 */
	create_cpu_entry(1,  1024, 0, false);
	create_cpu_entry(1,  1024, 0, false);
	create_cpu_entry(1,   128, 0, false);
	create_cpu_entry(1,     8, 0, false);
	create_cpu_entry(1, 16000, 0, false);
	create_cpu_entry(1, 16000, 0, false);
}
}