Fixup Path weights of 0
[vpp.git] / vnet / vnet / unix / tapcli.c
index 0be68a9..d23e6fe 100644 (file)
@@ -43,6 +43,8 @@
 #include <vnet/devices/dpdk/dpdk.h>
 #endif
 
+#include <vnet/feature/feature.h>
+#include <vnet/devices/devices.h>
 #include <vnet/unix/tapcli.h>
 
 static vnet_device_class_t tapcli_dev_class;
@@ -239,16 +241,6 @@ VLIB_REGISTER_NODE (tapcli_tx_node,static) = {
   .vector_size = 4,
 };
 
-enum {
-  TAPCLI_RX_NEXT_IP4_INPUT,
-  TAPCLI_RX_NEXT_IP6_INPUT,
-  TAPCLI_RX_NEXT_ETHERNET_INPUT,
-  TAPCLI_RX_NEXT_DROP,
-  TAPCLI_RX_N_NEXT,
-};
-
-
-
 /**
  * @brief Dispatch tapcli RX node function for node tap_cli_rx
  *
@@ -360,15 +352,18 @@ static uword tapcli_rx_iface(vlib_main_t * vm,
     vnet_buffer (b_first)->sw_if_index[VLIB_TX] = (u32)~0;
 
     b_first->error = node->errors[TAPCLI_ERROR_NONE];
-    next_index = TAPCLI_RX_NEXT_ETHERNET_INPUT;
+    next_index = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
     next_index = (ti->per_interface_next_index != ~0) ?
         ti->per_interface_next_index : next_index;
-    next_index = admin_down ? TAPCLI_RX_NEXT_DROP : next_index;
+    next_index = admin_down ? VNET_DEVICE_INPUT_NEXT_DROP : next_index;
 
     to_next[0] = bi_first;
     to_next++;
     n_left_to_next--;
 
+    vnet_feature_start_device_input_x1 (ti->sw_if_index, &next_index, 
+                                        b_first, 0);
+
     vlib_validate_buffer_enqueue_x1 (vm, node, next,
                                      to_next, n_left_to_next,
                                      bi_first, next_index);
@@ -452,20 +447,13 @@ static char * tapcli_rx_error_strings[] = {
 VLIB_REGISTER_NODE (tapcli_rx_node, static) = {
   .function = tapcli_rx,
   .name = "tapcli-rx",
+  .sibling_of = "device-input",
   .type = VLIB_NODE_TYPE_INPUT,
   .state = VLIB_NODE_STATE_INTERRUPT,
   .vector_size = 4,
   .n_errors = TAPCLI_N_ERROR,
   .error_strings = tapcli_rx_error_strings,
   .format_trace = format_tapcli_rx_trace,
-
-  .n_next_nodes = TAPCLI_RX_N_NEXT,
-  .next_nodes = {
-    [TAPCLI_RX_NEXT_IP4_INPUT] = "ip4-input-no-checksum",
-    [TAPCLI_RX_NEXT_IP6_INPUT] = "ip6-input",
-    [TAPCLI_RX_NEXT_DROP] = "error-drop",
-    [TAPCLI_RX_NEXT_ETHERNET_INPUT] = "ethernet-input",
-  },
 };
 
 
@@ -585,6 +573,7 @@ tapcli_nopunt_frame (vlib_main_t * vm,
 
 VNET_HW_INTERFACE_CLASS (tapcli_interface_class,static) = {
   .name = "tapcli",
+  .flags = VNET_HW_INTERFACE_CLASS_FLAG_P2P,
 };
 
 /**