diff options
author | Dave Barach <openvpp@barachs.net> | 2015-12-18 12:26:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@projectrotterdam.info> | 2015-12-18 12:26:04 +0000 |
commit | 2b75816bc7c2f10849a4535e160cebbbe5d34c4d (patch) | |
tree | 27e5b2987eb8acb718b65af7d4ac831d44c98aad /vnet | |
parent | 93520817c60f027ecba62b0b15bc2475c70154d0 (diff) | |
parent | 60231f35fa860228f31f40753d94e129e8432988 (diff) |
Merge "Add vpe-api message to get vxlan tunnel details."
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; |