aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vmxnet3/vmxnet3.c
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2018-09-18 12:34:59 -0700
committerDamjan Marion <dmarion@me.com>2018-09-18 22:50:21 +0000
commit33e6583e541ab411ff91dc6e991e1b852e39b520 (patch)
tree85ce37466fad0f3045e5986d0be3046e7e43d595 /src/plugins/vmxnet3/vmxnet3.c
parent45e1cd92cadf15dd3ce84ff28feb8f70aff0a1e0 (diff)
vmxnet3: add support for "non-default" next node
Support feature arc Support set interface next node Enqueue packet to either ip4, ip6, or ethernet_input based on packet type Change-Id: I11fb6bba98ee0bfa1d057474fc6cf3be48ef1c48 Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/plugins/vmxnet3/vmxnet3.c')
-rw-r--r--src/plugins/vmxnet3/vmxnet3.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/vmxnet3/vmxnet3.c b/src/plugins/vmxnet3/vmxnet3.c
index 74ef12619d2..74e600304a7 100644
--- a/src/plugins/vmxnet3/vmxnet3.c
+++ b/src/plugins/vmxnet3/vmxnet3.c
@@ -77,6 +77,26 @@ vmxnet3_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
return 0;
}
+static void
+vmxnet3_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index,
+ u32 node_index)
+{
+ vmxnet3_main_t *vmxm = &vmxnet3_main;
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
+ vmxnet3_device_t *vd = pool_elt_at_index (vmxm->devices, hw->dev_instance);
+
+ /* Shut off redirection */
+ if (node_index == ~0)
+ {
+ vd->per_interface_next_index = node_index;
+ return;
+ }
+
+ vd->per_interface_next_index =
+ vlib_node_add_next (vlib_get_main (), vmxnet3_input_node.index,
+ node_index);
+}
+
static char *vmxnet3_tx_func_error_strings[] = {
#define _(n,s) s,
foreach_vmxnet3_tx_func_error
@@ -91,6 +111,7 @@ VNET_DEVICE_CLASS (vmxnet3_device_class,) =
.format_device_name = format_vmxnet3_device_name,
.admin_up_down_function = vmxnet3_interface_admin_up_down,
.rx_mode_change_function = vmxnet3_interface_rx_mode_change,
+ .rx_redirect_to_node = vmxnet3_set_interface_next_node,
.tx_function_n_errors = VMXNET3_TX_N_ERROR,
.tx_function_error_strings = vmxnet3_tx_func_error_strings,
};