Skip to content

Commit

Permalink
xdp-bench: Update long option for -p to match documentation
Browse files Browse the repository at this point in the history
The documentation for the -p option of xdp-bench (in the basic modes) was
updated in the documentation, but not the value actually being accepted by
the program. The --packet-operation option name is actually the better one,
so change the code to accept that, but keep accepting the old
--program-mode since that was in a release already.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
  • Loading branch information
tohojo committed Jun 8, 2023
1 parent 297d5ab commit ca0ba83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/util/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static void _print_options(const struct prog_option *poptions, bool required)
const struct prog_option *opt;

FOR_EACH_OPTION (poptions, opt) {
if (opt->required != required)
if (opt->required != required || opt->hidden)
continue;

if (opt->positional) {
Expand Down
1 change: 1 addition & 0 deletions lib/util/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct prog_option {
void *typearg;
bool required;
bool positional;
bool hidden;
unsigned int min_num;
unsigned int max_num;
unsigned int num_set;
Expand Down
7 changes: 5 additions & 2 deletions xdp-bench/xdp-bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ struct enum_val cpumap_program_modes[] = {


struct prog_option basic_options[] = {
DEFINE_OPTION("program-mode", OPT_ENUM, struct basic_opts, program_mode,
DEFINE_OPTION("packet-operation", OPT_ENUM, struct basic_opts, program_mode,
.short_opt = 'p',
.metavar = "<mode>",
.metavar = "<action>",
.typearg = basic_program_modes,
.help = "Action to take before dropping packet."),
DEFINE_OPTION("program-mode", OPT_ENUM, struct basic_opts, program_mode,
.typearg = basic_program_modes,
.hidden = true),
DEFINE_OPTION("rxq-stats", OPT_BOOL, struct basic_opts, rxq_stats,
.short_opt = 'r',
.help = "Collect per-RXQ drop statistics"),
Expand Down

0 comments on commit ca0ba83

Please sign in to comment.