diff options
author | John Lo <loj@cisco.com> | 2016-11-30 12:51:39 -0500 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2016-12-01 19:34:12 +0000 |
commit | 37682e1237f83f0f84cdc4f9f92aa74d8fe3c139 (patch) | |
tree | 0ca723a11ab786245df26895365521b3f2fae11f /vpp-api-test/vat/api_format.c | |
parent | 436d06b1c7d00e8c30ab055560724285a017290b (diff) |
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 <interface> [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 <loj@cisco.com>
Diffstat (limited to 'vpp-api-test/vat/api_format.c')
-rw-r--r-- | vpp-api-test/vat/api_format.c | 54 |
1 files changed, 54 insertions, 0 deletions
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, \ @@ -5018,6 +5020,56 @@ api_sw_interface_set_vpath (vat_main_t * vam) } 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) { unformat_input_t *i = vam->input; @@ -16728,6 +16780,8 @@ _(sw_interface_set_mpls_enable, \ "<intfc> | sw_if_index [disable | dis]") \ _(sw_interface_set_vpath, \ "<intfc> | sw_if_index <id> enable | disable") \ +_(sw_interface_set_vxlan_bypass, \ + "<intfc> | sw_if_index <id> [ip4 | ip6] enable | disable") \ _(sw_interface_set_l2_xconnect, \ "rx <intfc> | rx_sw_if_index <id> tx <intfc> | tx_sw_if_index <id>\n" \ "enable | disable") \ |