devices: add multi-queue support for af-packet
[vpp.git] / src / vnet / devices / af_packet / cli.c
index bae4f61..c90d525 100644 (file)
@@ -51,6 +51,13 @@ af_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   clib_memset (arg, 0, sizeof (*arg));
 
+  // Default mode
+  arg->mode = AF_PACKET_IF_MODE_ETHERNET;
+
+  // Default number of rx/tx queue(s)
+  arg->num_rxqs = 1;
+  arg->num_txqs = 1;
+
   /* Get a line of input. */
   if (!unformat_user (input, unformat_line_input, line_input))
     return 0;
@@ -69,6 +76,12 @@ af_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
       else if (unformat (line_input, "tx-per-block %u",
                         &arg->tx_frames_per_block))
        ;
+      else if (unformat (line_input, "num-rx-queues %u", &arg->num_rxqs))
+       ;
+      else if (unformat (line_input, "num-tx-queues %u", &arg->num_txqs))
+       ;
+      else if (unformat (line_input, "mode ip"))
+       arg->mode = AF_PACKET_IF_MODE_IP;
       else if (unformat (line_input, "hw-addr %U", unformat_ethernet_address,
                         hwaddr))
        arg->hw_addr = hwaddr;
@@ -140,7 +153,8 @@ done:
 ?*/
 VLIB_CLI_COMMAND (af_packet_create_command, static) = {
   .path = "create host-interface",
-  .short_help = "create host-interface name <ifname> [hw-addr <mac-addr>]",
+  .short_help = "create host-interface name <ifname> [num-rx-queues <n>] "
+               "[num-tx-queues <n>] [hw-addr <mac-addr>] [mode ip]",
   .function = af_packet_create_command_fn,
 };