From c42912de8e2873c6a107fee047773b13950a764b Mon Sep 17 00:00:00 2001 From: John Lo Date: Mon, 7 Nov 2016 18:30:47 -0500 Subject: VXLAN tunnel encap forwarding optimization with FIB 2.0 Optimize VXLAN encap node so that vxlan4-encap node is used for IP4 and vxlan6-encap node is used for IP6 underlay. Also stack the VXLAN encap nodes to the appropriate FIB IP4 or IP6 load-balance node instead of ip4/ip6-lookup node to save IP lookup operation. For VXLAN decap node, check VXLAN header FLAGS field for each packet and remove the code to support decap-next for IP4 or IP6. These decap- next values were intended for experimentation purposes and not needed any more since VXLAN-GPE tunnel is supported. The decap-next field is still kept in API for backward compatibility and its value has no effect. Decap next for both vxlan4-decap and vxlan6-decap nodes is always l2-input node. Change-Id: I8ac95774946549ec403ab691f999df0c006b460f Signed-off-by: John Lo --- vpp/vpp-api/api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vpp') diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 6e0f27ee..e6066732 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -4925,7 +4925,7 @@ static void send_vxlan_tunnel_details vl_api_vxlan_tunnel_details_t *rmp; ip4_main_t *im4 = &ip4_main; ip6_main_t *im6 = &ip6_main; - u8 is_ipv6 = !(t->flags & VXLAN_TUNNEL_IS_IPV4); + u8 is_ipv6 = !ip46_address_is_ip4 (&t->dst); rmp = vl_msg_api_alloc (sizeof (*rmp)); memset (rmp, 0, sizeof (*rmp)); @@ -4943,7 +4943,8 @@ static void send_vxlan_tunnel_details rmp->encap_vrf_id = htonl (im4->fibs[t->encap_fib_index].ft_table_id); } rmp->vni = htonl (t->vni); - rmp->decap_next_index = htonl (t->decap_next_index); + /* decap_next_index is deprecated, hard code to l2-input */ + rmp->decap_next_index = htonl (VXLAN_INPUT_NEXT_L2_INPUT); rmp->sw_if_index = htonl (t->sw_if_index); rmp->is_ipv6 = is_ipv6; rmp->context = context; -- cgit