Skip to contentSkip to conversation

samples/bpf: Remove duplicate option from xdpsock

PATCH In review Andre Guedes 2 participants 3 messages Nov 14, 2019 – Nov 15, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 samples/bpf: Remove duplicate option from xdpsock

The '-f' option is shown twice in the usage(). This patch removes the outdated version.

---
 samples/bpf/xdpsock_user.c | 1 -
 1 file changed, 1 deletion(-)
samples/bpf/xdpsock_user.c +0 -1
index a1f96e55e43a..c5d0a006cafc 100644
@@ -393,7 +393,6 @@ static void usage(const char *prog)
 		"  -n, --interval=n	Specify statistics update interval (default 1 sec).\n"
 		"  -z, --zero-copy      Force zero-copy mode.\n"
 		"  -c, --copy           Force copy mode.\n"
-		"  -f, --frame-size=n   Set the frame size (must be a power of two, default is %d).\n"
 		"  -m, --no-need-wakeup Turn off use of driver need wakeup flag.\n"
 		"  -f, --frame-size=n   Set the frame size (must be a power of two in aligned mode, default is %d).\n"
 		"  -u, --unaligned	Enable unaligned chunk placement\n"
Signature · 1 line
2.24.0
#1 lore raw

PATCH 2/2 samples/bpf: Add missing option to xdpsock usage

Commit 743e568c1586 (samples/bpf: Add a "force" flag to XDP samples) introduced the '-F' option but missed adding it to the usage() and the 'long_option' array.

---
 samples/bpf/xdpsock_user.c | 2 ++
 1 file changed, 2 insertions(+)
samples/bpf/xdpsock_user.c +2 -0
index c5d0a006cafc..a15480010828 100644
@@ -374,6 +374,7 @@ static struct option long_options[] = {
 	{"no-need-wakeup", no_argument, 0, 'm'},
 	{"unaligned", no_argument, 0, 'u'},
 	{"shared-umem", no_argument, 0, 'M'},
+	{"force", no_argument, 0, 'F'},
 	{0, 0, 0, 0}
 };
 
@@ -397,6 +398,7 @@ static void usage(const char *prog)
 		"  -f, --frame-size=n   Set the frame size (must be a power of two in aligned mode, default is %d).\n"
 		"  -u, --unaligned	Enable unaligned chunk placement\n"
 		"  -M, --shared-umem	Enable XDP_SHARED_UMEM\n"
+		"  -F, --force		Force loading the XDP prog\n"
 		"\n";
 	fprintf(stderr, str, prog, XSK_UMEM__DEFAULT_FRAME_SIZE);
 	exit(EXIT_FAILURE);
Signature · 1 line
2.24.0