VPP-81: Print interface name after creating an interface with CLI
[vpp.git] / vnet / vnet / interface_cli.c
index 31fc9c3..d0d7515 100644 (file)
@@ -608,6 +608,7 @@ create_sub_interfaces (vlib_main_t * vm,
       if (error) goto done;
       hash_set (hi->sub_interface_sw_if_index_by_id, id, sw_if_index);
       hash_set_mem (im->sw_if_index_by_sup_and_sub, kp, sw_if_index);
+      vlib_cli_output(vm, "%U\n", format_vnet_sw_if_index_name, vnet_get_main(), sw_if_index);
     }
 
   if (error)
@@ -851,13 +852,14 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd)
       if (!eif)
         return clib_error_return (0, "not supported");
 
-      if (mtu < ETHERNET_MIN_PACKET_BYTES)
+      if (mtu < hi->min_supported_packet_bytes)
        return clib_error_return (0, "Invalid mtu (%d): "
                                  "must be >= min pkt bytes (%d)", mtu,
-                                 hi->min_packet_bytes);
+                                 hi->min_supported_packet_bytes);
 
-      if (mtu > ETHERNET_MAX_PACKET_BYTES)
-       return clib_error_return (0, "Invalid mtu (%d): must be <= 9216", mtu);
+      if (mtu > hi->max_supported_packet_bytes)
+       return clib_error_return (0, "Invalid mtu (%d): must be <= (%d)", mtu,
+                                  hi->max_supported_packet_bytes);
 
       if (hi->max_packet_bytes != mtu)
        {
@@ -873,7 +875,7 @@ mtu_cmd (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd)
 
 VLIB_CLI_COMMAND (set_interface_mtu_cmd, static) = {
   .path = "set interface mtu",
-  .short_help = "set interface mtu <64-9216> <intfc>",
+  .short_help = "set interface mtu <value> <intfc>",
   .function = mtu_cmd,
 };