16 #ifndef included_vnet_flow_flow_h 17 #define included_vnet_flow_flow_h 26 #define foreach_flow_type \ 28 _(ETHERNET, ethernet, "ethernet") \ 30 _(IP4_N_TUPLE, ip4_n_tuple, "ipv4-n-tuple") \ 31 _(IP6_N_TUPLE, ip6_n_tuple, "ipv6-n-tuple") \ 32 _(IP4_N_TUPLE_TAGGED, ip4_n_tuple_tagged, "ipv4-n-tuple-tagged") \ 33 _(IP6_N_TUPLE_TAGGED, ip6_n_tuple_tagged, "ipv6-n-tuple-tagged") \ 35 _(IP4_L2TPV3OIP, ip4_l2tpv3oip, "ipv4-l2tpv3oip") \ 37 _(IP4_VXLAN, ip4_vxlan, "ipv4-vxlan") \ 38 _(IP6_VXLAN, ip6_vxlan, "ipv6-vxlan") \ 39 _(IP4_GTPC, ip4_gtpc, "ipv4-gtpc") \ 40 _(IP4_GTPU, ip4_gtpu, "ipv4-gtpu") \ 41 _(IP4_GTPU_IP4, ip4_gtpu_ip4, "ipv4-gtpu-ipv4") \ 42 _(IP4_GTPU_IP6, ip4_gtpu_ip6, "ipv4-gtpu-ipv6") \ 43 _(IP6_GTPC, ip6_gtpc, "ipv6-gtpc") \ 44 _(IP6_GTPU, ip6_gtpu, "ipv6-gtpu") \ 45 _(IP6_GTPU_IP4, ip6_gtpu_ip4, "ipv6-gtpu-ipv4") \ 46 _(IP6_GTPU_IP6, ip6_gtpu_ip6, "ipv6-gtpu-ipv6") 48 #define foreach_flow_entry_ethernet \ 49 _fe(ethernet_header_t, eth_hdr) 51 #define foreach_flow_entry_ip4_n_tuple \ 52 _fe(ip4_address_and_mask_t, src_addr) \ 53 _fe(ip4_address_and_mask_t, dst_addr) \ 54 _fe(ip_port_and_mask_t, src_port) \ 55 _fe(ip_port_and_mask_t, dst_port) \ 56 _fe(ip_protocol_t, protocol) 58 #define foreach_flow_entry_ip6_n_tuple \ 59 _fe(ip6_address_and_mask_t, src_addr) \ 60 _fe(ip6_address_and_mask_t, dst_addr) \ 61 _fe(ip_port_and_mask_t, src_port) \ 62 _fe(ip_port_and_mask_t, dst_port) \ 63 _fe(ip_protocol_t, protocol) 65 #define foreach_flow_entry_ip4_n_tuple_tagged \ 66 _fe(ip4_address_and_mask_t, src_addr) \ 67 _fe(ip4_address_and_mask_t, dst_addr) \ 68 _fe(ip_port_and_mask_t, src_port) \ 69 _fe(ip_port_and_mask_t, dst_port) \ 70 _fe(ip_protocol_t, protocol) 72 #define foreach_flow_entry_ip6_n_tuple_tagged \ 73 _fe(ip6_address_and_mask_t, src_addr) \ 74 _fe(ip6_address_and_mask_t, dst_addr) \ 75 _fe(ip_port_and_mask_t, src_port) \ 76 _fe(ip_port_and_mask_t, dst_port) \ 77 _fe(ip_protocol_t, protocol) 79 #define foreach_flow_entry_ip4_l2tpv3oip \ 80 _fe(ip4_address_and_mask_t, src_addr) \ 81 _fe(ip4_address_and_mask_t, dst_addr) \ 82 _fe(ip_protocol_t, protocol) \ 85 #define foreach_flow_entry_ip4_vxlan \ 86 _fe(ip4_address_t, src_addr) \ 87 _fe(ip4_address_t, dst_addr) \ 91 #define foreach_flow_entry_ip6_vxlan \ 92 _fe(ip6_address_t, src_addr) \ 93 _fe(ip6_address_t, dst_addr) \ 97 #define foreach_flow_entry_ip4_gtpc \ 98 foreach_flow_entry_ip4_n_tuple \ 101 #define foreach_flow_entry_ip4_gtpu \ 102 foreach_flow_entry_ip4_n_tuple \ 105 #define foreach_flow_entry_ip4_gtpu_ip4 \ 106 foreach_flow_entry_ip4_gtpu \ 107 _fe(ip4_address_and_mask_t, inner_src_addr) \ 108 _fe(ip4_address_and_mask_t, inner_dst_addr) 110 #define foreach_flow_entry_ip4_gtpu_ip6 \ 111 foreach_flow_entry_ip4_gtpu \ 112 _fe(ip6_address_and_mask_t, inner_src_addr) \ 113 _fe(ip6_address_and_mask_t, inner_dst_addr) 115 #define foreach_flow_entry_ip6_gtpc \ 116 foreach_flow_entry_ip6_n_tuple \ 119 #define foreach_flow_entry_ip6_gtpu \ 120 foreach_flow_entry_ip6_n_tuple \ 123 #define foreach_flow_entry_ip6_gtpu_ip4 \ 124 foreach_flow_entry_ip6_gtpu \ 125 _fe(ip4_address_and_mask_t, inner_src_addr) \ 126 _fe(ip4_address_and_mask_t, inner_dst_addr) 128 #define foreach_flow_entry_ip6_gtpu_ip6 \ 129 foreach_flow_entry_ip6_gtpu \ 130 _fe(ip6_address_and_mask_t, inner_src_addr) \ 131 _fe(ip6_address_and_mask_t, inner_dst_addr) 133 #define foreach_flow_action \ 134 _(0, COUNT, "count") \ 136 _(2, BUFFER_ADVANCE, "buffer-advance") \ 137 _(3, REDIRECT_TO_NODE, "redirect-to-node") \ 138 _(4, REDIRECT_TO_QUEUE, "redirect-to-queue") \ 144 #define _(v,n,s) VNET_FLOW_ACTION_##n = (1 << v), 150 #define foreach_flow_error \ 151 _( -1, NOT_SUPPORTED, "not supported") \ 152 _( -2, ALREADY_DONE, "already done") \ 153 _( -3, ALREADY_EXISTS, "already exists") \ 154 _( -4, NO_SUCH_ENTRY, "no such entry") \ 155 _( -5, NO_SUCH_INTERFACE, "no such interface") \ 156 _( -6, INTERNAL, "internal error") 158 #define foreach_flow_rss_types \ 159 _(0, FRAG_IPV4, "ipv4-frag") \ 160 _(1, IPV4_TCP, "ipv4-tcp") \ 161 _(2, IPV4_UDP, "ipv4-udp") \ 162 _(3, IPV4_SCTP, "ipv4-sctp") \ 163 _(4, IPV4_OTHER, "ipv4-other") \ 165 _(6, IPV6_TCP_EX, "ipv6-tcp-ex") \ 166 _(7, IPV6_UDP_EX, "ipv6-udp-ex") \ 167 _(8, FRAG_IPV6, "ipv6-frag") \ 168 _(9, IPV6_TCP, "ipv6-tcp") \ 169 _(10, IPV6_UDP, "ipv6-udp") \ 170 _(11, IPV6_SCTP, "ipv6-sctp") \ 171 _(12, IPV6_OTHER, "ipv6-other") \ 172 _(13, IPV6_EX, "ipv6-ex") \ 173 _(14, IPV6, "ipv6") \ 174 _(15, L2_PAYLOAD, "l2-payload") \ 175 _(16, PORT, "port") \ 176 _(17, VXLAN, "vxlan") \ 177 _(18, GENEVE, "geneve") \ 178 _(19, NVGRE, "nvgre") \ 179 _(20, GTPU, "gtpu") \ 180 _(60, L4_DST_ONLY, "l4-dst-only") \ 181 _(61, L4_SRC_ONLY, "l4-src-only") \ 182 _(62, L3_DST_ONLY, "l3-dst-only") \ 183 _(63, L3_SRC_ONLY, "l3-src-only") 185 #define foreach_rss_function \ 186 _(DEFAULT, "default") \ 187 _(TOEPLITZ, "toeplitz") \ 188 _(SIMPLE_XOR, "simple_xor") \ 189 _(SYMMETRIC_TOEPLITZ, "symmetric_toeplitz") 194 #define _(v,n,s) VNET_FLOW_ERROR_##n = v, 207 #define _(a,b,c) VNET_FLOW_TYPE_##a, 215 #define _(a,b) VNET_RSS_FUNC_##a, 224 #define _fe(a, b) a b; 228 foreach_flow_entry_##b \ 267 #define _(a,b,c) vnet_flow_##b##_t b;
vnet_rss_function_t rss_fun
int vnet_flow_get_range(vnet_main_t *vnm, char *owner, u32 count, u32 *start)
#define foreach_rss_function
PCAP utility definitions.
#define foreach_flow_type
vnet_flow_t * global_flow_pool
int vnet_flow_enable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
vnet_flow_range_t * ranges
vnet_flow_main_t flow_main
format_function_t format_flow_actions
vnet_flow_t * vnet_get_flow(u32 flow_index)
int vnet_flow_del(vnet_main_t *vnm, u32 flow_index)
int vnet_flow_add(vnet_main_t *vnm, vnet_flow_t *flow, u32 *flow_index)
format_function_t format_flow_enabled_hw
#define foreach_flow_error
int vnet_flow_disable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
#define foreach_flow_action
u32 redirect_device_input_next_index