diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2015-12-17 21:04:30 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2015-12-17 21:47:54 -0500 |
commit | 60231f35fa860228f31f40753d94e129e8432988 (patch) | |
tree | c142ac60b47c2a1ab7e8426e16d8f094c960a30a /vnet | |
parent | a4105dead4d83fe2130feb50870c4b8ab3c3cbbe (diff) |
Add vpe-api message to get vxlan tunnel details.
Change-Id: I3bfb84dfcb08c6ff5cb473f3ce05b91b222182a1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/vxlan/vxlan.c | 5 | ||||
-rw-r--r-- | vnet/vnet/vxlan/vxlan.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/vnet/vnet/vxlan/vxlan.c b/vnet/vnet/vxlan/vxlan.c index 75cbc6c6499..316f8cb1907 100644 --- a/vnet/vnet/vxlan/vxlan.c +++ b/vnet/vnet/vxlan/vxlan.c @@ -218,6 +218,9 @@ int vnet_vxlan_add_del_tunnel 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; + if (a->decap_next_index == VXLAN_INPUT_NEXT_L2_INPUT) { l2input_main_t * l2im = &l2input_main; @@ -242,6 +245,8 @@ int vnet_vxlan_add_del_tunnel set_int_l2_mode(vxm->vlib_main, vnm, MODE_L3, t->sw_if_index, 0, 0, 0, 0); vec_add1 (vxm->free_vxlan_tunnel_hw_if_indices, t->hw_if_index); + vxm->tunnel_index_by_sw_if_index[t->sw_if_index] = ~0; + hash_unset (vxm->vxlan_tunnel_by_key, key.as_u64); vec_free (t->rewrite); diff --git a/vnet/vnet/vxlan/vxlan.h b/vnet/vnet/vxlan/vxlan.h index 5c82a3dfd9d..b38e65de4c1 100644 --- a/vnet/vnet/vxlan/vxlan.h +++ b/vnet/vnet/vxlan/vxlan.h @@ -102,6 +102,9 @@ typedef struct { u64 dummy_str [sizeof(ip4_vxlan_header_t)/sizeof(u64) + 2]; #define vxlan_dummy_rewrite ((u8 *) &vxlan_main.dummy_str[1]) + /* Mapping from sw_if_index to tunnel index */ + u32 * tunnel_index_by_sw_if_index; + /* convenience */ vlib_main_t * vlib_main; vnet_main_t * vnet_main; |