summaryrefslogtreecommitdiffstats
path: root/src/vnet/vxlan/vxlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/vxlan/vxlan.c')
-rw-r--r--src/vnet/vxlan/vxlan.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/vnet/vxlan/vxlan.c b/src/vnet/vxlan/vxlan.c
index edd8733741b..b0a186e2c05 100644
--- a/src/vnet/vxlan/vxlan.c
+++ b/src/vnet/vxlan/vxlan.c
@@ -79,14 +79,6 @@ static u8 * format_vxlan_name (u8 * s, va_list * args)
return format (s, "vxlan_tunnel%d", dev_instance);
}
-static uword dummy_interface_tx (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * frame)
-{
- clib_warning ("you shouldn't be here, leaking buffers...");
- return frame->n_vectors;
-}
-
static clib_error_t *
vxlan_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
{
@@ -101,7 +93,6 @@ VNET_DEVICE_CLASS (vxlan_device_class,static) = {
.name = "VXLAN",
.format_device_name = format_vxlan_name,
.format_tx_trace = format_vxlan_encap_trace,
- .tx_function = dummy_interface_tx,
.admin_up_down_function = vxlan_interface_admin_up_down,
};
@@ -423,17 +414,22 @@ int vnet_vxlan_add_del_tunnel
(&im->sw_if_counters[VNET_INTERFACE_COUNTER_DROP], sw_if_index);
vnet_interface_counter_unlock(im);
}
- else
+ else
{
hw_if_index = vnet_register_interface
(vnm, vxlan_device_class.index, t - vxm->tunnels,
vxlan_hw_class.index, t - vxm->tunnels);
hi = vnet_get_hw_interface (vnm, hw_if_index);
}
-
+
+ /* Set vxlan tunnel output node */
+ u32 encap_index = !is_ip6 ?
+ vxlan4_encap_node.index : vxlan6_encap_node.index;
+ vnet_set_interface_output_node (vnm, hw_if_index, encap_index);
+
t->hw_if_index = hw_if_index;
t->sw_if_index = sw_if_index = hi->sw_if_index;
-
+
vec_validate_init_empty (vxm->tunnel_index_by_sw_if_index, sw_if_index, ~0);
vxm->tunnel_index_by_sw_if_index[sw_if_index] = t - vxm->tunnels;
@@ -441,16 +437,14 @@ int vnet_vxlan_add_del_tunnel
vec_validate (l2im->configs, sw_if_index);
l2im->configs[sw_if_index].feature_bitmap = L2INPUT_FEAT_DROP;
l2im->configs[sw_if_index].bd_index = 0;
-
+
vnet_sw_interface_t * si = vnet_get_sw_interface (vnm, sw_if_index);
si->flags &= ~VNET_SW_INTERFACE_FLAG_HIDDEN;
- vnet_sw_interface_set_flags (vnm, sw_if_index,
+ vnet_sw_interface_set_flags (vnm, sw_if_index,
VNET_SW_INTERFACE_FLAG_ADMIN_UP);
fib_node_init(&t->node, FIB_NODE_TYPE_VXLAN_TUNNEL);
fib_prefix_t tun_dst_pfx;
- u32 encap_index = !is_ip6 ?
- vxlan4_encap_node.index : vxlan6_encap_node.index;
vnet_flood_class_t flood_class = VNET_FLOOD_CLASS_TUNNEL_NORMAL;
fib_prefix_from_ip46_addr(&t->dst, &tun_dst_pfx);
@@ -542,9 +536,6 @@ int vnet_vxlan_add_del_tunnel
flood_class = VNET_FLOOD_CLASS_TUNNEL_MASTER;
}
- /* Set vxlan tunnel output node */
- hi->output_node_index = encap_index;
-
vnet_get_sw_interface (vnet_get_main(), sw_if_index)->flood_class = flood_class;
}
else