From 37682e1237f83f0f84cdc4f9f92aa74d8fe3c139 Mon Sep 17 00:00:00 2001 From: John Lo Date: Wed, 30 Nov 2016 12:51:39 -0500 Subject: Add vxlan-bypass feature to IP4 forwarding path Added vxlan-bypass feature which can be enabled on the underlay interface which receive VXLAN packets to accelerate VXLAN decap processing. The CLI to enable it is: set interface ip vxlan-bypass [del] With this feature enabled on an interface, there is an overhead for non-VXLAN packets at about 13 clocks per packet. The API is created to support vxlan-bypass for both VXLANoIPv4 and VXLANoIPv6. With this change, vxlan-bypass is only implemented for IPv4 forwarding path. Change-Id: Ica7239f642010b231eade7fd5009aa4b42c119d3 Signed-off-by: John Lo --- vpp-api-test/vat/api_format.c | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'vpp-api-test') diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c index 800fa2b3df0..448ae75c3ae 100644 --- a/vpp-api-test/vat/api_format.c +++ b/vpp-api-test/vat/api_format.c @@ -3448,6 +3448,7 @@ _(sw_interface_add_del_address_reply) \ _(sw_interface_set_table_reply) \ _(sw_interface_set_mpls_enable_reply) \ _(sw_interface_set_vpath_reply) \ +_(sw_interface_set_vxlan_bypass_reply) \ _(sw_interface_set_l2_bridge_reply) \ _(sw_interface_set_dpdk_hqos_pipe_reply) \ _(sw_interface_set_dpdk_hqos_subport_reply) \ @@ -3597,6 +3598,7 @@ _(SW_INTERFACE_ADD_DEL_ADDRESS_REPLY, \ _(SW_INTERFACE_SET_TABLE_REPLY, sw_interface_set_table_reply) \ _(SW_INTERFACE_SET_MPLS_ENABLE_REPLY, sw_interface_set_mpls_enable_reply) \ _(SW_INTERFACE_SET_VPATH_REPLY, sw_interface_set_vpath_reply) \ +_(SW_INTERFACE_SET_VXLAN_BYPASS_REPLY, sw_interface_set_vxlan_bypass_reply) \ _(SW_INTERFACE_SET_L2_XCONNECT_REPLY, \ sw_interface_set_l2_xconnect_reply) \ _(SW_INTERFACE_SET_L2_BRIDGE_REPLY, \ @@ -5017,6 +5019,56 @@ api_sw_interface_set_vpath (vat_main_t * vam) W; } +static int +api_sw_interface_set_vxlan_bypass (vat_main_t * vam) +{ + unformat_input_t *i = vam->input; + vl_api_sw_interface_set_vxlan_bypass_t *mp; + f64 timeout; + u32 sw_if_index = 0; + u8 sw_if_index_set = 0; + u8 is_enable = 0; + u8 is_ipv6 = 0; + + /* Parse args required to build the message */ + while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) + { + if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index)) + sw_if_index_set = 1; + else if (unformat (i, "sw_if_index %d", &sw_if_index)) + sw_if_index_set = 1; + else if (unformat (i, "enable")) + is_enable = 1; + else if (unformat (i, "disable")) + is_enable = 0; + else if (unformat (i, "ip4")) + is_ipv6 = 0; + else if (unformat (i, "ip6")) + is_ipv6 = 1; + else + break; + } + + if (sw_if_index_set == 0) + { + errmsg ("missing interface name or sw_if_index\n"); + return -99; + } + + /* Construct the API message */ + M (SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass); + + mp->sw_if_index = ntohl (sw_if_index); + mp->enable = is_enable; + mp->is_ipv6 = is_ipv6; + + /* send it... */ + S; + + /* Wait for a reply... */ + W; +} + static int api_sw_interface_set_l2_xconnect (vat_main_t * vam) { @@ -16728,6 +16780,8 @@ _(sw_interface_set_mpls_enable, \ " | sw_if_index [disable | dis]") \ _(sw_interface_set_vpath, \ " | sw_if_index enable | disable") \ +_(sw_interface_set_vxlan_bypass, \ + " | sw_if_index [ip4 | ip6] enable | disable") \ _(sw_interface_set_l2_xconnect, \ "rx | rx_sw_if_index tx | tx_sw_if_index \n" \ "enable | disable") \ -- cgit 1.2.3-korg