summaryrefslogtreecommitdiffstats
path: root/samples/bpf/xdp1_user.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2017-05-22 08:56:55 +0200
committerGreg Kroah-Hartman2017-05-22 08:56:55 +0200
commitb4a338d2b3cafa1be68d4e1903203c7e08a38ee5 (patch)
tree069f3753af1cda34c36a7627000ab46ef5c51c83 /samples/bpf/xdp1_user.c
parentmisc: sram-exec: Use aligned fncpy instead of memcpy (diff)
parentLinux 4.12-rc2 (diff)
downloadkernel-qcow2-linux-b4a338d2b3cafa1be68d4e1903203c7e08a38ee5.tar.gz
kernel-qcow2-linux-b4a338d2b3cafa1be68d4e1903203c7e08a38ee5.tar.xz
kernel-qcow2-linux-b4a338d2b3cafa1be68d4e1903203c7e08a38ee5.zip
Merge 4.12-rc2 into char-misc-next
We want the fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples/bpf/xdp1_user.c')
-rw-r--r--samples/bpf/xdp1_user.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/samples/bpf/xdp1_user.c b/samples/bpf/xdp1_user.c
index 378850c70eb8..2431c0321b71 100644
--- a/samples/bpf/xdp1_user.c
+++ b/samples/bpf/xdp1_user.c
@@ -62,13 +62,14 @@ static void usage(const char *prog)
fprintf(stderr,
"usage: %s [OPTS] IFINDEX\n\n"
"OPTS:\n"
- " -S use skb-mode\n",
+ " -S use skb-mode\n"
+ " -N enforce native mode\n",
prog);
}
int main(int argc, char **argv)
{
- const char *optstr = "S";
+ const char *optstr = "SN";
char filename[256];
int opt;
@@ -77,6 +78,9 @@ int main(int argc, char **argv)
case 'S':
xdp_flags |= XDP_FLAGS_SKB_MODE;
break;
+ case 'N':
+ xdp_flags |= XDP_FLAGS_DRV_MODE;
+ break;
default:
usage(basename(argv[0]));
return 1;
@@ -102,6 +106,7 @@ int main(int argc, char **argv)
}
signal(SIGINT, int_exit);
+ signal(SIGTERM, int_exit);
if (set_link_xdp_fd(ifindex, prog_fd[0], xdp_flags) < 0) {
printf("link set xdp fd failed\n");