diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2021-08-25 11:37:22 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-08-25 12:23:11 -0700 |
commit | 33a6bef8cf92017ff48e3bd597d7d60652f37b6d (patch) | |
tree | 7253c64dfaf769c9a52caf3da742eb475bca6f58 /tools | |
parent | 279bdf6b79d5f6a4decbf2699092b55c8c782eec (diff) | |
download | linux-33a6bef8cf92017ff48e3bd597d7d60652f37b6d.tar.bz2 |
selftests: xsk: Preface options with opt
Preface all options with opt_ and make them booleans.
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210825093722.10219-17-magnus.karlsson@gmail.com
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/xdpxceiver.c | 6 | ||||
-rw-r--r-- | 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 0c7b40d5f4b6..f53ce2683f8d 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -395,10 +395,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])); @@ -517,7 +517,7 @@ static bool is_pkt_valid(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 582af3505c15..7e49b9fbe25e 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.h +++ b/tools/testing/selftests/bpf/xdpxceiver.h @@ -69,12 +69,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; |