diff options
author | Steven Luong <sluong@cisco.com> | 2019-06-25 22:36:26 -0700 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-06-26 07:51:54 +0000 |
commit | 4201e96cbc80525b2a42295b1ab43967f844160f (patch) | |
tree | 50b365290dd3864a65173e36e0cbaf2b6c452abc /src/plugins/vmxnet3/vmxnet3_test.c | |
parent | f6a9ec5cfccb26553e8fefddd355fe2e400ad396 (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/vmxnet3_test.c')
-rw-r--r-- | src/plugins/vmxnet3/vmxnet3_test.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/plugins/vmxnet3/vmxnet3_test.c b/src/plugins/vmxnet3/vmxnet3_test.c index fe491b2a41d..d32bceefe5b 100644 --- a/src/plugins/vmxnet3/vmxnet3_test.c +++ b/src/plugins/vmxnet3/vmxnet3_test.c @@ -102,31 +102,26 @@ api_vmxnet3_create (vat_main_t * vam) vl_api_vmxnet3_create_t *mp; vmxnet3_create_if_args_t args; int ret; - u32 x[4]; + u32 size; clib_memset (&args, 0, sizeof (vmxnet3_create_if_args_t)); while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) { - if (unformat (i, "%x:%x:%x.%x", &x[0], &x[1], &x[2], &x[3])) - { - args.addr.domain = x[0]; - args.addr.bus = x[1]; - args.addr.slot = x[2]; - args.addr.function = x[3]; - } + if (unformat (i, "%U", unformat_vlib_pci_addr, &args.addr)) + ; else if (unformat (i, "elog")) args.enable_elog = 1; else if (unformat (i, "bind")) args.bind = 1; - else if (unformat (i, "rx-queue-size %u", &args.rxq_size)) - ; - else if (unformat (i, "tx-queue-size %u", &args.txq_size)) - ; - else if (unformat (i, "num-tx-queues %u", &args.txq_num)) - ; - else if (unformat (i, "num-rx-queues %u", &args.rxq_num)) - ; + else if (unformat (i, "rx-queue-size %u", &size)) + args.rxq_size = size; + else if (unformat (i, "tx-queue-size %u", &size)) + args.txq_size = size; + else if (unformat (i, "num-tx-queues %u", &size)) + args.txq_num = size; + else if (unformat (i, "num-rx-queues %u", &size)) + args.rxq_num = size; else { clib_warning ("unknown input '%U'", format_unformat_error, i); |