summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/vxlan-gpe/vxlan_gpe.c37
-rw-r--r--vnet/vnet/vxlan-gpe/vxlan_gpe.h4
2 files changed, 10 insertions, 31 deletions
diff --git a/vnet/vnet/vxlan-gpe/vxlan_gpe.c b/vnet/vnet/vxlan-gpe/vxlan_gpe.c
index bf1623af372..e6565f4379b 100644
--- a/vnet/vnet/vxlan-gpe/vxlan_gpe.c
+++ b/vnet/vnet/vxlan-gpe/vxlan_gpe.c
@@ -56,30 +56,10 @@ u8 * format_vxlan_gpe_tunnel (u8 * s, va_list * args)
static u8 * format_vxlan_gpe_name (u8 * s, va_list * args)
{
- vxlan_gpe_main_t * gm = &vxlan_gpe_main;
- u32 i = va_arg (*args, u32);
- u32 show_dev_instance = ~0;
-
- if (i < vec_len (gm->dev_inst_by_real))
- show_dev_instance = gm->dev_inst_by_real[i];
-
- if (show_dev_instance != ~0)
- i = show_dev_instance;
-
- return format (s, "vxlan_gpe_tunnel%d", i);
+ u32 dev_instance = va_arg (*args, u32);
+ return format (s, "vxlan_gpe_tunnel%d", dev_instance);
}
-static int vxlan_gpe_name_renumber (vnet_hw_interface_t * hi,
- u32 new_dev_instance)
-{
- vxlan_gpe_main_t * gm = &vxlan_gpe_main;
-
- vec_validate_init_empty (gm->dev_inst_by_real, hi->dev_instance, ~0);
-
- gm->dev_inst_by_real [hi->dev_instance] = new_dev_instance;
-
- return 0;
-}
static uword dummy_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node,
@@ -88,6 +68,12 @@ static uword dummy_interface_tx (vlib_main_t * vm,
clib_warning ("you shouldn't be here, leaking buffers...");
return frame->n_vectors;
}
+VNET_DEVICE_CLASS (vxlan_gpe_device_class,static) = {
+ .name = "VXLAN_GPE",
+ .format_device_name = format_vxlan_gpe_name,
+ .format_tx_trace = format_vxlan_gpe_encap_trace,
+ .tx_function = dummy_interface_tx,
+};
static uword dummy_set_rewrite (vnet_main_t * vnm,
u32 sw_if_index,
@@ -99,13 +85,6 @@ static uword dummy_set_rewrite (vnet_main_t * vnm,
return 0;
}
-VNET_DEVICE_CLASS (vxlan_gpe_device_class,static) = {
- .name = "VXLAN_GPE",
- .format_device_name = format_vxlan_gpe_name,
- .format_tx_trace = format_vxlan_gpe_encap_trace,
- .tx_function = dummy_interface_tx,
- .name_renumber = vxlan_gpe_name_renumber,
-};
static u8 * format_vxlan_gpe_header_with_length (u8 * s, va_list * args)
{
diff --git a/vnet/vnet/vxlan-gpe/vxlan_gpe.h b/vnet/vnet/vxlan-gpe/vxlan_gpe.h
index 730abe70253..be420b54f6d 100644
--- a/vnet/vnet/vxlan-gpe/vxlan_gpe.h
+++ b/vnet/vnet/vxlan-gpe/vxlan_gpe.h
@@ -133,8 +133,8 @@ typedef struct {
/* Free vlib hw_if_indices */
u32 * free_vxlan_gpe_tunnel_hw_if_indices;
- /* show device instance by real device instance */
- u32 * dev_inst_by_real;
+ /* Mapping from sw_if_index to tunnel index */
+ u32 * tunnel_index_by_sw_if_index;
/* convenience */
vlib_main_t * vlib_main;