tap: print the interface name on cli when created
[vpp.git] / src / vnet / devices / tap / cli.c
index 084fb90..5bf38a3 100644 (file)
@@ -40,6 +40,7 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   args.id = ~0;
   args.tap_flags = 0;
+  args.rv = -1;
 
   /* Get a line of input. */
   if (unformat_user (input, unformat_line_input, line_input))
@@ -76,6 +77,10 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
            ;
          else if (unformat (line_input, "tx-ring-size %d", &args.tx_ring_sz))
            ;
+         else
+           if (unformat
+               (line_input, "host-mtu-size %d", &args.host_mtu_size))
+           args.host_mtu_set = 1;
          else if (unformat (line_input, "no-gso"))
            args.tap_flags &= ~TAP_FLAG_GSO;
          else if (unformat (line_input, "gso"))
@@ -99,6 +104,10 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   tap_create_if (vm, &args);
 
+  if (!args.rv)
+    vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name,
+                    vnet_get_main (), args.sw_if_index);
+
   vec_free (args.host_if_name);
   vec_free (args.host_namespace);
   vec_free (args.host_bridge);
@@ -114,7 +123,8 @@ VLIB_CLI_COMMAND (tap_create_command, static) = {
     "[rx-ring-size <size>] [tx-ring-size <size>] [host-ns <netns>] "
     "[host-bridge <bridge-name>] [host-ip4-addr <ip4addr/mask>] "
     "[host-ip6-addr <ip6-addr>] [host-ip4-gw <ip4-addr>] "
-    "[host-ip6-gw <ip6-addr>] [host-if-name <name>] [no-gso|gso]",
+    "[host-ip6-gw <ip6-addr>] [host-mac-addr <host-mac-address>] "
+    "[host-if-name <name>] [host-mtu-size <size>] [no-gso|gso]",
   .function = tap_create_command_fn,
 };
 /* *INDENT-ON* */