34 #ifndef _RTE_ETH_CTRL_H_
35 #define _RTE_ETH_CTRL_H_
59 #define RTE_ETH_FLOW_UNKNOWN 0
60 #define RTE_ETH_FLOW_RAW 1
61 #define RTE_ETH_FLOW_IPV4 2
62 #define RTE_ETH_FLOW_FRAG_IPV4 3
63 #define RTE_ETH_FLOW_NONFRAG_IPV4_TCP 4
64 #define RTE_ETH_FLOW_NONFRAG_IPV4_UDP 5
65 #define RTE_ETH_FLOW_NONFRAG_IPV4_SCTP 6
66 #define RTE_ETH_FLOW_NONFRAG_IPV4_OTHER 7
67 #define RTE_ETH_FLOW_IPV6 8
68 #define RTE_ETH_FLOW_FRAG_IPV6 9
69 #define RTE_ETH_FLOW_NONFRAG_IPV6_TCP 10
70 #define RTE_ETH_FLOW_NONFRAG_IPV6_UDP 11
71 #define RTE_ETH_FLOW_NONFRAG_IPV6_SCTP 12
72 #define RTE_ETH_FLOW_NONFRAG_IPV6_OTHER 13
73 #define RTE_ETH_FLOW_L2_PAYLOAD 14
74 #define RTE_ETH_FLOW_IPV6_EX 15
75 #define RTE_ETH_FLOW_IPV6_TCP_EX 16
76 #define RTE_ETH_FLOW_IPV6_UDP_EX 17
77 #define RTE_ETH_FLOW_MAX 18
83 RTE_ETH_FILTER_NONE = 0,
84 RTE_ETH_FILTER_MACVLAN,
85 RTE_ETH_FILTER_ETHERTYPE,
86 RTE_ETH_FILTER_FLEXIBLE,
88 RTE_ETH_FILTER_NTUPLE,
89 RTE_ETH_FILTER_TUNNEL,
109 RTE_ETH_FILTER_OP_MAX
137 #define RTE_ETHTYPE_FLAGS_MAC 0x0001
138 #define RTE_ETHTYPE_FLAGS_DROP 0x0002
145 struct rte_eth_ethertype_filter {
152 #define RTE_FLEX_FILTER_MAXLEN 128
153 #define RTE_FLEX_FILTER_MASK_SIZE \
154 (RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
186 #define RTE_NTUPLE_FLAGS_DST_IP 0x0001
187 #define RTE_NTUPLE_FLAGS_SRC_IP 0x0002
188 #define RTE_NTUPLE_FLAGS_DST_PORT 0x0004
189 #define RTE_NTUPLE_FLAGS_SRC_PORT 0x0008
190 #define RTE_NTUPLE_FLAGS_PROTO 0x0010
191 #define RTE_NTUPLE_FLAGS_TCP_FLAG 0x0020
193 #define RTE_5TUPLE_FLAGS ( \
194 RTE_NTUPLE_FLAGS_DST_IP | \
195 RTE_NTUPLE_FLAGS_SRC_IP | \
196 RTE_NTUPLE_FLAGS_DST_PORT | \
197 RTE_NTUPLE_FLAGS_SRC_PORT | \
198 RTE_NTUPLE_FLAGS_PROTO)
200 #define RTE_2TUPLE_FLAGS ( \
201 RTE_NTUPLE_FLAGS_DST_PORT | \
202 RTE_NTUPLE_FLAGS_PROTO)
204 #define TCP_URG_FLAG 0x20
205 #define TCP_ACK_FLAG 0x10
206 #define TCP_PSH_FLAG 0x08
207 #define TCP_RST_FLAG 0x04
208 #define TCP_SYN_FLAG 0x02
209 #define TCP_FIN_FLAG 0x01
210 #define TCP_FLAG_ALL 0x3F
242 RTE_TUNNEL_TYPE_NONE = 0,
243 RTE_TUNNEL_TYPE_VXLAN,
244 RTE_TUNNEL_TYPE_GENEVE,
245 RTE_TUNNEL_TYPE_TEREDO,
246 RTE_TUNNEL_TYPE_NVGRE,
253 #define ETH_TUNNEL_FILTER_OMAC 0x01
254 #define ETH_TUNNEL_FILTER_OIP 0x02
255 #define ETH_TUNNEL_FILTER_TENID 0x04
256 #define ETH_TUNNEL_FILTER_IMAC 0x08
257 #define ETH_TUNNEL_FILTER_IVLAN 0x10
258 #define ETH_TUNNEL_FILTER_IIP 0x20
260 #define RTE_TUNNEL_FILTER_IMAC_IVLAN (ETH_TUNNEL_FILTER_IMAC | \
261 ETH_TUNNEL_FILTER_IVLAN)
262 #define RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID (ETH_TUNNEL_FILTER_IMAC | \
263 ETH_TUNNEL_FILTER_IVLAN | \
264 ETH_TUNNEL_FILTER_TENID)
265 #define RTE_TUNNEL_FILTER_IMAC_TENID (ETH_TUNNEL_FILTER_IMAC | \
266 ETH_TUNNEL_FILTER_TENID)
267 #define RTE_TUNNEL_FILTER_OMAC_TENID_IMAC (ETH_TUNNEL_FILTER_OMAC | \
268 ETH_TUNNEL_FILTER_TENID | \
269 ETH_TUNNEL_FILTER_IMAC)
298 #define RTE_ETH_FDIR_MAX_FLEXLEN 16
303 struct rte_eth_l2_flow {
403 uint8_t
flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
422 RTE_ETH_FDIR_ACCEPT = 0,
467 uint16_t vlan_tci_mask;
470 uint16_t src_port_mask;
471 uint16_t dst_port_mask;
478 RTE_ETH_PAYLOAD_UNKNOWN = 0,
483 RTE_ETH_PAYLOAD_MAX = 8,
492 uint16_t
src_offset[RTE_ETH_FDIR_MAX_FLEXLEN];
505 uint8_t
mask[RTE_ETH_FDIR_MAX_FLEXLEN];
531 #define UINT32_BIT (CHAR_BIT * sizeof(uint32_t))
532 #define RTE_FLOW_MASK_ARRAY_SIZE \
533 (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
597 RTE_ETH_HASH_FILTER_INFO_TYPE_UNKNOWN = 0,
602 RTE_ETH_HASH_FILTER_INFO_TYPE_MAX,
609 RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
612 RTE_ETH_HASH_FUNCTION_MAX,
615 #define RTE_SYM_HASH_MASK_ARRAY_SIZE \
616 (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)