aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/cli.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-06-25 22:36:26 -0700
committerNeale Ranns <nranns@cisco.com>2019-06-26 07:51:54 +0000
commit4201e96cbc80525b2a42295b1ab43967f844160f (patch)
tree50b365290dd3864a65173e36e0cbaf2b6c452abc /src/plugins/vmxnet3/cli.c
parentf6a9ec5cfccb26553e8fefddd355fe2e400ad396 (diff)
vmxnet3: custom dump and debug cli fix
Add missing custom dump for vmxnet3_create, vmxnet3_delete, and vmxnet3_dump. Fix vmxnet3_create debug cli which may not parse all parameters correctly due to passing address of u16 to unformat(). The fix is to use a u32 local variable to receive the correct value from unformat(). Type: fix Change-Id: I04251c9ed0ab397ed4b1b5843a73880aec98b9f6 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/cli.c')
-rw-r--r--src/plugins/vmxnet3/cli.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/vmxnet3/cli.c b/src/plugins/vmxnet3/cli.c
index 776901e8ac2..76db1cab7ed 100644
--- a/src/plugins/vmxnet3/cli.c
+++ b/src/plugins/vmxnet3/cli.c
@@ -32,6 +32,7 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
{
unformat_input_t _line_input, *line_input = &_line_input;
vmxnet3_create_if_args_t args;
+ u32 size;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
@@ -46,14 +47,14 @@ vmxnet3_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
args.enable_elog = 1;
else if (unformat (line_input, "bind"))
args.bind = 1;
- else if (unformat (line_input, "rx-queue-size %u", &args.rxq_size))
- ;
- else if (unformat (line_input, "tx-queue-size %u", &args.txq_size))
- ;
- else if (unformat (line_input, "num-tx-queues %u", &args.txq_num))
- ;
- else if (unformat (line_input, "num-rx-queues %u", &args.rxq_num))
- ;
+ else if (unformat (line_input, "rx-queue-size %u", &size))
+ args.rxq_size = size;
+ else if (unformat (line_input, "tx-queue-size %u", &size))
+ args.txq_size = size;
+ else if (unformat (line_input, "num-tx-queues %u", &size))
+ args.txq_num = size;
+ else if (unformat (line_input, "num-rx-queues %u", &size))
+ args.rxq_num = size;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);