aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-11-08 12:12:12 -0500
committerDave Barach <dave@barachs.net>2016-11-08 12:13:13 -0500
commit9f6186e055eeb7f25a6ff43834c4bcee56699b3c (patch)
tree2b676f83510609b37c7b37d91feab9b5ec669e2b /vnet
parent116ea4b2a157a2df81a4285006cdf4e37aa1b243 (diff)
Add the tap driver to the driver feature arc scheme
Change-Id: I5f5251ed6b2a39d5e83dd7c702079245ef5f32b0 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/feature.c12
-rw-r--r--vnet/vnet/unix/tapcli.c28
2 files changed, 16 insertions, 24 deletions
diff --git a/vnet/vnet/devices/feature.c b/vnet/vnet/devices/feature.c
index a532a9a269e..5a31cd64d61 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 8a5d47ddb96..a255e65032c 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,
};