diff options
-rw-r--r-- | vnet/vnet/devices/feature.c | 12 | ||||
-rw-r--r-- | vnet/vnet/unix/tapcli.c | 28 |
2 files changed, 16 insertions, 24 deletions
diff --git a/vnet/vnet/devices/feature.c b/vnet/vnet/devices/feature.c index a532a9a2..5a31cd64 100644 --- a/vnet/vnet/devices/feature.c +++ b/vnet/vnet/devices/feature.c @@ -16,14 +16,16 @@ #include <vnet/feature/feature.h> /* *INDENT-OFF* */ -VNET_FEATURE_ARC_INIT (device_input, static) = { +VNET_FEATURE_ARC_INIT (device_input, static) = +{ .arc_name = "device-input", - .start_nodes = VNET_FEATURES ( + .start_nodes = + VNET_FEATURES ( #if DPDK > 0 - "dpdk-input", + "dpdk-input", #endif - "vhost-user-input", "af-packet-input", "netmap-input", - "tuntap-rx", "pg-input"), + "vhost-user-input", "af-packet-input", "netmap-input", + "tuntap-rx", "tapcli-rx", "pg-input"), }; VNET_FEATURE_INIT (l2_patch, static) = { diff --git a/vnet/vnet/unix/tapcli.c b/vnet/vnet/unix/tapcli.c index 8a5d47dd..a255e650 100644 --- a/vnet/vnet/unix/tapcli.c +++ b/vnet/vnet/unix/tapcli.c @@ -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); @@ -459,13 +454,8 @@ VLIB_REGISTER_NODE (tapcli_rx_node, static) = { .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", - }, + .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES, + .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES, }; |