AF_XDP-interaction: Add --spin-mode that disables --wakeup-mode

And default that AF_XDP userspace prog to use wakeup-mode

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
Jesper Dangaard Brouer
2021-11-12 11:47:48 +01:00
parent b950ab63f0
commit 396854e2e1
2 changed files with 8 additions and 1 deletions

View File

@ -198,6 +198,9 @@ static const struct option_wrapper long_options[] = {
{{"wakeup-mode", no_argument, NULL, 'w' },
"Use poll() API waiting for packets to arrive via wakeup from kernel"},
{{"spin-mode", no_argument, NULL, 's' },
"Let userspace process spin checking for packets (disable --wakeup-mode)"},
{{"unload", no_argument, NULL, 'U' },
"Unload XDP program instead of loading"},
@ -772,7 +775,8 @@ int main(int argc, char **argv)
.ifindex = -1,
.do_unload = false,
.filename = "af_xdp_kern.o",
.progsec = "xdp_sock"
.progsec = "xdp_sock",
.xsk_wakeup_mode = true, /* Default, change via --spin */
};
struct xsk_umem_info *umem;
struct xsk_socket_info *xsk_socket;

View File

@ -157,6 +157,9 @@ void parse_cmdline_args(int argc, char **argv,
case 'w':
cfg->xsk_wakeup_mode = true;
break;
case 's':
cfg->xsk_wakeup_mode = false;
break;
case 'q':
verbose = false;
break;