X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Fcli.c;h=a85fcbff25c44709ed69fd695c9c01e09d4afef2;hb=5de4fb707;hp=084fb908dc928c3372c73d8fa41a825ec3f3b419;hpb=6a7cff7ec234af8529ff72a530076e191cc8d759;p=vpp.git diff --git a/src/vnet/devices/tap/cli.c b/src/vnet/devices/tap/cli.c index 084fb908dc9..a85fcbff25c 100644 --- a/src/vnet/devices/tap/cli.c +++ b/src/vnet/devices/tap/cli.c @@ -37,9 +37,12 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, unformat_input_t _line_input, *line_input = &_line_input; tap_create_if_args_t args = { 0 }; int ip_addr_set = 0; + u32 tmp; args.id = ~0; args.tap_flags = 0; + args.rv = -1; + args.num_rx_queues = 1; /* Get a line of input. */ if (unformat_user (input, unformat_line_input, line_input)) @@ -72,16 +75,22 @@ tap_create_command_fn (vlib_main_t * vm, unformat_input_t * input, else if (unformat (line_input, "host-ip6-gw %U", unformat_ip6_address, &args.host_ip6_gw)) args.host_ip6_gw_set = 1; - else if (unformat (line_input, "rx-ring-size %d", &args.rx_ring_sz)) - ; - else if (unformat (line_input, "tx-ring-size %d", &args.tx_ring_sz)) - ; + else if (unformat (line_input, "num-rx-queues %d", &tmp)) + args.num_rx_queues = tmp; + else if (unformat (line_input, "rx-ring-size %d", &tmp)) + args.rx_ring_sz = tmp; + else if (unformat (line_input, "tx-ring-size %d", &tmp)) + args.tx_ring_sz = tmp; + 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")) args.tap_flags |= TAP_FLAG_GSO; else if (unformat (line_input, "hw-addr %U", - unformat_ethernet_address, args.mac_addr)) + unformat_ethernet_address, args.mac_addr.bytes)) args.mac_addr_set = 1; else { @@ -99,6 +108,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 +127,8 @@ VLIB_CLI_COMMAND (tap_create_command, static) = { "[rx-ring-size ] [tx-ring-size ] [host-ns ] " "[host-bridge ] [host-ip4-addr ] " "[host-ip6-addr ] [host-ip4-gw ] " - "[host-ip6-gw ] [host-if-name ] [no-gso|gso]", + "[host-ip6-gw ] [host-mac-addr ] " + "[host-if-name ] [host-mtu-size ] [no-gso|gso]", .function = tap_create_command_fn, }; /* *INDENT-ON* */