X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fgtpu%2Fgtpu.h;h=72d09232001baf0d638a075bb0ca1a4d05dcfcbb;hb=4da8be4dbabbbf53f1a3a9576f5178d982de6a06;hp=7296ece5b7ca8c96b7d604c78145432a044c18ed;hpb=0333121d83287957062cdd03c6ec40e8f21e2b53;p=vpp.git diff --git a/src/plugins/gtpu/gtpu.h b/src/plugins/gtpu/gtpu.h index 7296ece5b7c..72d09232001 100644 --- a/src/plugins/gtpu/gtpu.h +++ b/src/plugins/gtpu/gtpu.h @@ -23,13 +23,15 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include +#include #include #include #include @@ -81,7 +83,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* */ @@ -134,8 +136,9 @@ typedef struct /* FIB DPO for IP forwarding of gtpu encap packet */ dpo_id_t next_dpo; - /* gtpu teid in HOST byte order */ + /* gtpu local(rx) and remote(tx) TEIDs in HOST byte order */ u32 teid; + u32 tteid; /* tunnel src and dst addresses */ ip46_address_t src; @@ -173,6 +176,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 \ @@ -208,8 +213,7 @@ typedef struct /* local VTEP IPs ref count used by gtpu-bypass node to check if received gtpu packet DIP matches any local VTEP address */ - uword *vtep4; /* local ip4 VTEPs keyed on their ip4 addr */ - uword *vtep6; /* local ip6 VTEPs keyed on their ip6 addr */ + vtep_table_t vtep_table; /* mcast shared info */ uword *mcast_shared; /* keyed on mcast ip46 addr */ @@ -231,6 +235,10 @@ typedef struct /* convenience */ vlib_main_t *vlib_main; vnet_main_t *vnet_main; + u32 flow_id_start; + /* cache for last 8 gtpu tunnel */ + vtep4_cache_t vtep4_u512; + } gtpu_main_t; extern gtpu_main_t gtpu_main; @@ -239,30 +247,37 @@ 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); typedef struct { - u8 is_add; - u8 is_ip6; + u8 opn; +#define GTPU_DEL_TUNNEL 0 +#define GTPU_ADD_TUNNEL 1 +#define GTPU_UPD_TTEID 2 ip46_address_t src, dst; u32 mcast_sw_if_index; u32 encap_fib_index; u32 decap_next_index; - u32 teid; -} vnet_gtpu_add_del_tunnel_args_t; + u32 teid; /* local or rx teid */ + u32 tteid; /* remote or tx teid */ +} vnet_gtpu_add_mod_del_tunnel_args_t; -int vnet_gtpu_add_del_tunnel - (vnet_gtpu_add_del_tunnel_args_t * a, u32 * sw_if_indexp); +int vnet_gtpu_add_mod_del_tunnel + (vnet_gtpu_add_mod_del_tunnel_args_t * a, u32 * sw_if_indexp); typedef struct { u32 tunnel_index; - u32 teid; + u32 tteid; } 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 */