tap: add num_tx_queues API
[vpp.git] / src / plugins / linux-cp / lcp_interface.c
index aeff9a1..d044635 100644 (file)
@@ -421,7 +421,7 @@ lcp_itf_pair_del (u32 phy_sw_if_index)
 
   lip = lcp_itf_pair_get (lipi);
 
-  LCP_ITF_PAIR_INFO ("pair delete: {%U, %U, %s}", format_vnet_sw_if_index_name,
+  LCP_ITF_PAIR_INFO ("pair delete: {%U, %U, %v}", format_vnet_sw_if_index_name,
                     vnet_get_main (), lip->lip_phy_sw_if_index,
                     format_vnet_sw_if_index_name, vnet_get_main (),
                     lip->lip_host_sw_if_index, lip->lip_host_name);
@@ -510,6 +510,23 @@ lcp_itf_pair_delete (u32 phy_sw_if_index)
   return 0;
 }
 
+/**
+ * lcp_itf_interface_add_del
+ *
+ * Registered to receive interface Add and delete notifications
+ */
+static clib_error_t *
+lcp_itf_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
+{
+  if (!is_add)
+    /* remove any interface pair we have for this interface */
+    lcp_itf_pair_delete (sw_if_index);
+
+  return (NULL);
+}
+
+VNET_SW_INTERFACE_ADD_DEL_FUNCTION (lcp_itf_interface_add_del);
+
 void
 lcp_itf_pair_walk (lcp_itf_pair_walk_cb_t cb, void *ctx)
 {
@@ -925,6 +942,7 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
     {
       tap_create_if_args_t args = {
        .num_rx_queues = clib_max (1, vlib_num_workers ()),
+       .num_tx_queues = 1,
        .id = hw->hw_if_index,
        .sw_if_index = ~0,
        .rx_ring_sz = 256,