X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fvmxnet3%2Fvmxnet3_test.c;h=987026e38788426fbdd616cc49024acf3fef6261;hb=2985e0af6;hp=bb9f93e95cc95d7a14cd560d102a2c5b46b89fc3;hpb=854559d154288945e03af6b6b7ce91c383667180;p=vpp.git diff --git a/src/plugins/vmxnet3/vmxnet3_test.c b/src/plugins/vmxnet3/vmxnet3_test.c index bb9f93e95cc..987026e3878 100644 --- a/src/plugins/vmxnet3/vmxnet3_test.c +++ b/src/plugins/vmxnet3/vmxnet3_test.c @@ -102,27 +102,28 @@ 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, "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, "bind")) + args.bind = 1; + else if (unformat (i, "gso")) + args.enable_gso = 1; + 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); @@ -137,6 +138,9 @@ api_vmxnet3_create (vat_main_t * vam) mp->rxq_size = clib_host_to_net_u16 (args.rxq_size); mp->txq_size = clib_host_to_net_u16 (args.txq_size); mp->txq_num = clib_host_to_net_u16 (args.txq_num); + mp->rxq_num = clib_host_to_net_u16 (args.rxq_num); + mp->bind = args.bind; + mp->enable_gso = args.enable_gso; S (mp); W (ret); @@ -289,7 +293,8 @@ vl_api_vmxnet3_details_t_handler (vl_api_vmxnet3_details_t * mp) */ #define foreach_vpe_api_msg \ _(vmxnet3_create, " [rx-queue-size ] " \ - "[tx-queue-size ] [num-tx-queues ]") \ + "[tx-queue-size ] [num-tx-queues ]" \ + "[num-rx-queues ] [bind] [gso]") \ _(vmxnet3_delete, "sw_if_index ") \ _(vmxnet3_dump, "") @@ -328,6 +333,10 @@ vat_plugin_register (vat_main_t * vam) name = format (0, "vmxnet3_%08x%c", api_version, 0); vxm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name); + vec_free (name); + + if (vxm->msg_id_base == (u16) ~ 0) + return clib_error_return (0, "vmxnet3 plugin not loaded..."); /* Get the control ping ID */ #define _(id,n,crc) \ @@ -336,10 +345,7 @@ vat_plugin_register (vat_main_t * vam) #undef _ vxm->ping_id = vl_msg_api_get_msg_index ((u8 *) (VL_API_CONTROL_PING_CRC)); - if (vxm->msg_id_base != (u16) ~ 0) - vmxnet3_vat_api_hookup (vam); - - vec_free (name); + vmxnet3_vat_api_hookup (vam); return 0; }