########################################
libvnet_la_SOURCES += \
vnet/config.c \
+ vnet/devices/devices.c \
vnet/handoff.c \
vnet/interface.c \
vnet/interface_cli.c \
########################################
libvnet_la_SOURCES += \
- vnet/devices/feature.c \
vnet/feature/feature.c \
vnet/feature/registration.c
VLIB_REGISTER_NODE (af_packet_input_node) = {
.function = af_packet_input_fn,
.name = "af-packet-input",
+ .sibling_of = "device-input",
.format_trace = format_af_packet_input_trace,
.type = VLIB_NODE_TYPE_INPUT,
.state = VLIB_NODE_STATE_INTERRUPT,
.n_errors = AF_PACKET_INPUT_N_ERROR,
.error_strings = af_packet_input_error_strings,
-
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
VLIB_NODE_FUNCTION_MULTIARCH (af_packet_input_node, af_packet_input_fn)
* limitations under the License.
*/
+#include <vnet/devices/devices.h>
#include <vnet/feature/feature.h>
+static uword
+device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ return 0;
+}
+
/* *INDENT-OFF* */
+VLIB_REGISTER_NODE (device_input_node) = {
+ .function = device_input_fn,
+ .name = "device-input",
+ .type = VLIB_NODE_TYPE_INPUT,
+ .state = VLIB_NODE_STATE_DISABLED,
+ .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
+ .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
+};
+
VNET_FEATURE_ARC_INIT (device_input, static) =
{
.arc_name = "device-input",
- .start_nodes =
- VNET_FEATURES (
-#if DPDK > 0
- "dpdk-input",
-#endif
- "vhost-user-input", "af-packet-input", "netmap-input",
- "tuntap-rx", "tapcli-rx", "pg-input"),
+ .start_nodes = VNET_FEATURES ("device-input"),
};
VNET_FEATURE_INIT (l2_patch, static) = {
[VNET_DEVICE_INPUT_NEXT_MPLS_INPUT] = "mpls-input", \
}
+extern vlib_node_registration_t device_input_node;
+
#endif /* included_vnet_vnet_device_h */
/*
.function = dpdk_input,
.type = VLIB_NODE_TYPE_INPUT,
.name = "dpdk-input",
+ .sibling_of = "device-input",
/* Will be enabled if/when hardware is detected. */
.state = VLIB_NODE_STATE_DISABLED,
.n_errors = DPDK_N_ERROR,
.error_strings = dpdk_error_strings,
-
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
VLIB_REGISTER_NODE (netmap_input_node) = {
.function = netmap_input_fn,
.name = "netmap-input",
+ .sibling_of = "device-input",
.format_trace = format_netmap_input_trace,
.type = VLIB_NODE_TYPE_INPUT,
/* default state is INTERRUPT mode, switch to POLLING if worker threads are enabled */
.state = VLIB_NODE_STATE_INTERRUPT,
.n_errors = NETMAP_INPUT_N_ERROR,
.error_strings = netmap_input_error_strings,
-
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
VLIB_NODE_FUNCTION_MULTIARCH (netmap_input_node, netmap_input_fn)
.function = vhost_user_input,
.type = VLIB_NODE_TYPE_INPUT,
.name = "vhost-user-input",
+ .sibling_of = "device-input",
/* Will be enabled if/when hardware is detected. */
.state = VLIB_NODE_STATE_DISABLED,
.n_errors = VHOST_USER_INPUT_FUNC_N_ERROR,
.error_strings = vhost_user_input_func_error_strings,
-
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
VLIB_NODE_FUNCTION_MULTIARCH (vhost_user_input_node, vhost_user_input)
VLIB_REGISTER_NODE (pg_input_node) = {
.function = pg_input,
.name = "pg-input",
+ .sibling_of = "device-input",
.type = VLIB_NODE_TYPE_INPUT,
.format_trace = format_pg_input_trace,
/* Input node will be left disabled until a stream is active. */
.state = VLIB_NODE_STATE_DISABLED,
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
/* *INDENT-ON* */
#include <vnet/ethernet/ethernet.h>
#include <vnet/ip/ip.h>
#include <vnet/mpls/mpls.h>
+#include <vnet/devices/devices.h>
/* Mark stream active or inactive. */
void
}
/* Connect the graph. */
- s->next_index = vlib_node_add_next (vm, pg_input_node.index, s->node_index);
+ s->next_index = vlib_node_add_next (vm, device_input_node.index,
+ s->node_index);
}
void
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 = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
VLIB_REGISTER_NODE (tuntap_rx_node,static) = {
.function = tuntap_rx,
.name = "tuntap-rx",
+ .sibling_of = "device-input",
.type = VLIB_NODE_TYPE_INPUT,
.state = VLIB_NODE_STATE_INTERRUPT,
.vector_size = 4,
.n_errors = 1,
.error_strings = tuntap_rx_error_strings,
-
- .n_next_nodes = VNET_DEVICE_INPUT_N_NEXT_NODES,
- .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES,
};
/**