[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210727131753.10924-18-magnus.karlsson@gmail.com>
Date: Tue, 27 Jul 2021 15:17:53 +0200
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: magnus.karlsson@...el.com, bjorn@...nel.org, ast@...nel.org,
daniel@...earbox.net, netdev@...r.kernel.org,
maciej.fijalkowski@...el.com
Cc: jonathan.lemon@...il.com, ciara.loftus@...el.com,
joamaki@...il.com, bpf@...r.kernel.org, yhs@...com,
andrii@...nel.org
Subject: [PATCH bpf-next 17/17] selftests: xsk: preface options with opt
From: Magnus Karlsson <magnus.karlsson@...el.com>
Preface all options with opt_ and make them booleans.
Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
---
tools/testing/selftests/bpf/xdpxceiver.c | 6 +++---
tools/testing/selftests/bpf/xdpxceiver.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c
index f0616200d5b5..d40c4d9c5061 100644
--- a/tools/testing/selftests/bpf/xdpxceiver.c
+++ b/tools/testing/selftests/bpf/xdpxceiver.c
@@ -400,10 +400,10 @@ static void parse_command_line(int argc, char **argv)
interface_index++;
break;
case 'D':
- debug_pkt_dump = 1;
+ opt_pkt_dump = true;
break;
case 'v':
- opt_verbose = 1;
+ opt_verbose = true;
break;
default:
usage(basename(argv[0]));
@@ -510,7 +510,7 @@ static bool pkt_validate(struct pkt *pkt, void *buffer, const struct xdp_desc *d
if (iphdr->version == IP_PKT_VER && iphdr->tos == IP_PKT_TOS) {
u32 seqnum = ntohl(*((u32 *)(data + PKT_HDR_SIZE)));
- if (debug_pkt_dump && test_type != TEST_TYPE_STATS)
+ if (opt_pkt_dump && test_type != TEST_TYPE_STATS)
pkt_dump(data, PKT_SIZE);
if (pkt->len != desc->len) {
diff --git a/tools/testing/selftests/bpf/xdpxceiver.h b/tools/testing/selftests/bpf/xdpxceiver.h
index 309a580fd1c5..664b74ac2233 100644
--- a/tools/testing/selftests/bpf/xdpxceiver.h
+++ b/tools/testing/selftests/bpf/xdpxceiver.h
@@ -68,12 +68,12 @@ enum stat_test_type {
};
static int configured_mode;
-static u8 debug_pkt_dump;
+static bool opt_pkt_dump;
static u32 num_frames = DEFAULT_PKT_CNT / 4;
static bool second_step;
static int test_type;
-static u8 opt_verbose;
+static bool opt_verbose;
static u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
static u32 xdp_bind_flags = XDP_USE_NEED_WAKEUP | XDP_COPY;
--
2.29.0
Powered by blists - more mailing lists