api: binary api cleanup
[vpp.git] / src / plugins / avf / cli.c
index 3ccf45a..414163a 100644 (file)
@@ -34,7 +34,7 @@ avf_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
   avf_create_if_args_t args;
   u32 tmp;
 
-  memset (&args, 0, sizeof (avf_create_if_args_t));
+  clib_memset (&args, 0, sizeof (avf_create_if_args_t));
 
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
@@ -50,6 +50,10 @@ avf_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
        args.rxq_size = tmp;
       else if (unformat (line_input, "tx-queue-size %u", &tmp))
        args.txq_size = tmp;
+      else if (unformat (line_input, "num-rx-queues %u", &tmp))
+       args.rxq_num = tmp;
+      else if (unformat (line_input, "name %s", &args.name))
+       ;
       else
        return clib_error_return (0, "unknown input `%U'",
                                  format_unformat_error, input);
@@ -58,6 +62,8 @@ avf_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   avf_create_if (vm, &args);
 
+  vec_free (args.name);
+
   return args.error;
 }
 
@@ -65,7 +71,8 @@ avf_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
 VLIB_CLI_COMMAND (avf_create_command, static) = {
   .path = "create interface avf",
   .short_help = "create interface avf <pci-address> "
-               "[rx-queue-size <size>] [tx-queue-size <size>]",
+               "[rx-queue-size <size>] [tx-queue-size <size>] "
+               "[num-rx-queues <size>]",
   .function = avf_create_command_fn,
 };
 /* *INDENT-ON* */
@@ -102,9 +109,9 @@ avf_delete_command_fn (vlib_main_t * vm, unformat_input_t * input,
     return clib_error_return (0,
                              "please specify interface name or sw_if_index");
 
-  hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+  hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
   if (hw == NULL || avf_device_class.index != hw->dev_class_index)
-    return clib_error_return (0, "not a AVF interface");
+    return clib_error_return (0, "not an AVF interface");
 
   ad = pool_elt_at_index (am->devices, hw->dev_instance);
 
@@ -161,7 +168,7 @@ avf_test_command_fn (vlib_main_t * vm, unformat_input_t * input,
     return clib_error_return (0,
                              "please specify interface name or sw_if_index");
 
-  hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+  hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
   if (hw == NULL || avf_device_class.index != hw->dev_class_index)
     return clib_error_return (0, "not a AVF interface");