From 00fdf53c7076d1bd0045439e73f0144d613eb09c Mon Sep 17 00:00:00 2001 From: Chenmin Sun Date: Mon, 17 Feb 2020 02:19:15 +0800 Subject: gtpu: offload RX flow ip4 gtpu cli/api (using flow infra) to create flows and enable them on different hardware (currently tested with ice) to offload a gtpu tunnel onto hw: set flow-offload gtpu hw TwentyFiveGigabitEthernet3/0/0 rx gtpu_tunnel0 to remove offload: set flow-offload gtpu hw TwentyFiveGigabitEthernet3/0/0 rx gtpu_tunnel0 del TODO:ipv6 handling Type: feature Signed-off-by: Chenmin Sun Change-Id: I8e356feeb0b16cfeadc1bbbe92f773aa2916e715 --- src/plugins/gtpu/gtpu.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/gtpu/gtpu.h') diff --git a/src/plugins/gtpu/gtpu.h b/src/plugins/gtpu/gtpu.h index dc36308d8a8..1d47f2d1b93 100644 --- a/src/plugins/gtpu/gtpu.h +++ b/src/plugins/gtpu/gtpu.h @@ -81,7 +81,7 @@ typedef CLIB_PACKED(struct { ip4_header_t ip4; /* 20 bytes */ udp_header_t udp; /* 8 bytes */ - gtpu_header_t gtpu; /* 8 bytes */ + gtpu_header_t gtpu; /* 12 bytes */ }) ip4_gtpu_header_t; /* *INDENT-ON* */ @@ -173,6 +173,8 @@ typedef struct * The tunnels sibling index on the FIB entry's dependency list. */ u32 sibling_index; + + u32 flow_index; /* infra flow index */ } gtpu_tunnel_t; #define foreach_gtpu_input_next \ @@ -231,6 +233,7 @@ typedef struct /* convenience */ vlib_main_t *vlib_main; vnet_main_t *vnet_main; + u32 flow_id_start; } gtpu_main_t; extern gtpu_main_t gtpu_main; @@ -239,6 +242,7 @@ extern vlib_node_registration_t gtpu4_input_node; extern vlib_node_registration_t gtpu6_input_node; extern vlib_node_registration_t gtpu4_encap_node; extern vlib_node_registration_t gtpu6_encap_node; +extern vlib_node_registration_t gtpu4_flow_input_node; u8 *format_gtpu_encap_trace (u8 * s, va_list * args); @@ -262,6 +266,9 @@ typedef struct } gtpu_encap_trace_t; void vnet_int_gtpu_bypass_mode (u32 sw_if_index, u8 is_ip6, u8 is_enable); +u32 vnet_gtpu_get_tunnel_index (u32 sw_if_index); +int vnet_gtpu_add_del_rx_flow (u32 hw_if_index, u32 t_imdex, int is_add); + #endif /* included_vnet_gtpu_h */ -- cgit 1.2.3-korg