summaryrefslogtreecommitdiffstats
path: root/src/plugins/gtpu/gtpu.c
diff options
context:
space:
mode:
authorChenmin Sun <chenmin.sun@intel.com>2020-03-02 00:08:20 +0800
committerDamjan Marion <dmarion@me.com>2020-05-05 09:50:32 +0000
commited63a0ff7b819ebfc4d82b4cfc09218fc49b8977 (patch)
tree9c5d2a1a097da101e1ee42fe59ababf826244ea5 /src/plugins/gtpu/gtpu.c
parent350737cd4510aa3869f4ba9efe558f2fcda674cc (diff)
gtpu: RX offload for IPv6 payload supporting
this patch adds the offloading capability for the IPv4 GTPU tunnel which the next-node is assigned as IPv6 Type: feature Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: Ie39cd43058d36514656351dc6e906a19d5de89c0
Diffstat (limited to 'src/plugins/gtpu/gtpu.c')
-rw-r--r--src/plugins/gtpu/gtpu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/gtpu/gtpu.c b/src/plugins/gtpu/gtpu.c
index 7aa374ff66a..386721b6b39 100644
--- a/src/plugins/gtpu/gtpu.c
+++ b/src/plugins/gtpu/gtpu.c
@@ -1097,7 +1097,7 @@ vnet_gtpu_add_del_rx_flow (u32 hw_if_index, u32 t_index, int is_add)
.redirect_node_index = gtpu4_flow_input_node.index,
.buffer_advance = sizeof (ethernet_header_t)
+ sizeof (ip4_header_t) + sizeof (udp_header_t),
- .type = VNET_FLOW_TYPE_IP4_GTPU_IP4,
+ .type = VNET_FLOW_TYPE_IP4_GTPU,
.ip4_gtpu = {
.protocol = IP_PROTOCOL_UDP,
.src_addr.addr = t->dst.ip4,
@@ -1178,10 +1178,11 @@ gtpu_offload_command_fn (vlib_main_t * vm,
if (!ip46_address_is_ip4 (&t->dst))
return clib_error_return (0, "currently only IPV4 tunnels are supported");
- /* inner protocol should be IPv4 */
- if (t->decap_next_index != GTPU_INPUT_NEXT_IP4_INPUT)
+ /* inner protocol should be IPv4/IPv6 */
+ if ((t->decap_next_index != GTPU_INPUT_NEXT_IP4_INPUT) &&
+ (t->decap_next_index != GTPU_INPUT_NEXT_IP6_INPUT))
return clib_error_return (0,
- "currently only inner IPV4 protocol is supported");
+ "currently only inner IPv4/IPv6 protocol is supported");
vnet_hw_interface_t *hw_if = vnet_get_hw_interface (vnm, hw_if_index);
ip4_main_t *im = &ip4_main;