NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_flow_net.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
25 #ifndef DOCA_FLOW_NET_H_
26 #define DOCA_FLOW_NET_H_
27 
28 #include <stdint.h>
29 #include <stdbool.h>
30 #include <doca_types.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #define DOCA_FLOW_ETHER_ADDR_LEN (6)
37 #define DOCA_FLOW_PROTO_ICMP (1)
38 #define DOCA_FLOW_PROTO_ICMP6 (58)
39 #define DOCA_FLOW_PROTO_IPV4 (4)
40 #define DOCA_FLOW_PROTO_IPV6 (41)
41 #define DOCA_FLOW_PROTO_TCP (6)
42 #define DOCA_FLOW_PROTO_UDP (17)
43 #define DOCA_FLOW_PROTO_IB_BTH (16)
44 #define DOCA_FLOW_PROTO_GRE (47)
45 #define DOCA_FLOW_PROTO_ESP (50)
46 #define DOCA_FLOW_PROTO_IP4_IN_IP (4)
47 #define DOCA_FLOW_PROTO_IP6_IN_IP (41)
48 #define DOCA_FLOW_GTPU_DEFAULT_PORT (2152)
49 #define DOCA_FLOW_VXLAN_DEFAULT_PORT (4789)
50 #define DOCA_FLOW_VXLAN_GPE_DEFAULT_PORT (4790)
51 #define DOCA_FLOW_MPLS_DEFAULT_PORT (6635)
52 #define DOCA_FLOW_GENEVE_DEFAULT_PORT (6081)
53 #define DOCA_FLOW_PSP_DEFAULT_PORT (1000)
54 #define DOCA_FLOW_ROCEV2_DEFAULT_PORT (4791)
57 #define DOCA_FLOW_ETHER_TYPE_IPV4 (0x0800)
58 #define DOCA_FLOW_ETHER_TYPE_IPV6 (0x86DD)
59 #define DOCA_FLOW_ETHER_TYPE_TEB (0x6558)
60 #define DOCA_FLOW_ETHER_TYPE_ARP (0x0806)
61 #define DOCA_FLOW_ETHER_TYPE_VLAN (0x8100)
62 #define DOCA_FLOW_ETHER_TYPE_QINQ (0x88A8)
65 #define DOCA_FLOW_UDP_HEADER_LEN 8
66 
68 #define DOCA_FLOW_ESP_HEADER_LEN (4 * sizeof(doca_be32_t))
69 
71 #define DOCA_FLOW_ESP_HEADER_MARKER_LEN_4B 4
72 
74 #define DOCA_FLOW_ESP_HEADER_MARKER_LEN_8B 8
75 
77 #define DOCA_FLOW_CRYPTO_KEY_LEN_MAX 32
78 
80 #define DOCA_FLOW_GENEVE_OPT_LEN_MAX 63
81 
83 #define DOCA_FLOW_ENCAP_GENEVE_OPT_LEN_MAX 19
84 
86 #define DOCA_FLOW_GENEVE_DATA_OPTION_LEN_MAX 31
87 
89 #define DOCA_FLOW_GENEVE_NUM_OF_OPTIONS_MAX 8
90 
92 #define DOCA_FLOW_MPLS_LABELS_MAX 5
93 
95 #define DOCA_FLOW_PSP_HEADER_LEN (6 * sizeof(doca_be32_t))
96 
98 #define DOCA_FLOW_VXLAN_GPE_TYPE_IPV4 1
99 #define DOCA_FLOW_VXLAN_GPE_TYPE_IPV6 2
100 #define DOCA_FLOW_VXLAN_GPE_TYPE_ETH 3
101 #define DOCA_FLOW_VXLAN_GPE_TYPE_NSH 4
102 #define DOCA_FLOW_VXLAN_GPE_TYPE_MPLS 5
103 #define DOCA_FLOW_VXLAN_GPE_TYPE_GBP 6
104 #define DOCA_FLOW_VXLAN_GPE_TYPE_VBNG 7
107 #define DOCA_FLOW_GTP_EXT_PSC (0x85)
109 #define DOCA_FLOW_IB_BTH_DST_QP_LEN 3
110 #define DOCA_FLOW_IB_BTH_PSN_LEN 3
121 #define DOCA_FLOW_CRYPTO_HEADER_LEN_MAX \
122  (DOCA_FLOW_ETHER_ADDR_LEN * 2 + sizeof(doca_be16_t) + sizeof(doca_be16_t) * 2 * 2 + sizeof(doca_be32_t) * 15 + \
123  sizeof(doca_be32_t) * 2 + DOCA_FLOW_PSP_HEADER_LEN)
124 
131 };
132 
143 };
144 
155 };
156 
161  enum doca_flow_l3_type type;
163  union {
168  };
169 };
170 
189 };
190 
195  uint8_t opcode;
197  uint8_t sempt;
201  uint8_t flags0;
205  uint8_t flags1;
209 };
210 
219 };
220 
227 };
228 
233  struct doca_flow_header_udp udp;
237 };
238 
245  uint8_t data_offset;
247  uint8_t flags;
253 };
254 
259  uint8_t type;
261  uint8_t code;
265 };
266 
277 };
278 
287  uint8_t version_ihl;
289  uint8_t dscp_ecn;
297  uint8_t next_proto;
299  uint8_t ttl;
301 };
302 
311  uint8_t traffic_class;
317  uint8_t next_proto;
319  uint8_t hop_limit;
321 };
322 
331 };
332 
341 };
342 
358 };
359 
364  uint8_t ver_opt_len;
366  uint8_t o_c;
372 };
373 
382  struct {
385  uint8_t type;
387  uint8_t length;
393  };
397 };
398 
403  uint8_t nexthdr;
405  uint8_t hdrextlen;
407  uint8_t res_cryptofst;
409  uint8_t s_d_ver_v;
417 };
418 
423  DOCA_FLOW_TUN_NONE = 0,
443 };
444 
455 };
456 
465 };
466 
473  union {
474  struct {
477  union {
478  struct {
483  };
484  struct {
487  };
488  };
493  };
495  struct {
499  union {
500  struct {
505  };
506  struct {
509  uint8_t nvgre_flow_id;
511  };
512  };
513  };
515  struct {
522  };
524  struct {
529  };
531  struct {
534  };
536  struct {
541  };
543  struct {
544  struct doca_flow_header_psp psp;
545  };
547  };
548 };
549 
550 #ifdef __cplusplus
551 } /* extern "C" */
552 #endif
553 
556 #endif /* DOCA_FLOW_NET_H_ */
doca_flow_l4_type_ext
doca flow layer 4 packet extend type
#define DOCA_FLOW_MPLS_LABELS_MAX
Definition: doca_flow_net.h:92
doca_flow_l3_type
doca flow layer 3 packet type
doca_flow_ip_fragment_flags
doca flow IP fragment flags
doca_flow_tun_ext_vxlan_type
doca flow tunnel extension vxlan type
#define DOCA_FLOW_GENEVE_OPT_LEN_MAX
Definition: doca_flow_net.h:80
#define DOCA_FLOW_IB_BTH_PSN_LEN
doca_flow_tun_type
doca flow tunnel type
#define DOCA_FLOW_IB_BTH_DST_QP_LEN
doca_flow_tun_ext_gre_type
doca flow tun extension gre type
#define DOCA_FLOW_ETHER_ADDR_LEN
Definition: doca_flow_net.h:36
@ DOCA_FLOW_L4_TYPE_EXT_ROCE_V2
@ DOCA_FLOW_L4_TYPE_EXT_ICMP6
@ DOCA_FLOW_L4_TYPE_EXT_TCP
@ DOCA_FLOW_L4_TYPE_EXT_NONE
@ DOCA_FLOW_L4_TYPE_EXT_ICMP
@ DOCA_FLOW_L4_TYPE_EXT_UDP
@ DOCA_FLOW_L4_TYPE_EXT_TRANSPORT
@ DOCA_FLOW_L3_TYPE_IP6
@ DOCA_FLOW_L3_TYPE_IP4
@ DOCA_FLOW_L3_TYPE_NONE
@ DOCA_FLOW_IP4_FLAG_MORE_FRAGMENTS
@ DOCA_FLOW_IP4_FLAG_DONT_FRAGMENT
@ DOCA_FLOW_TUN_EXT_VXLAN_STANDARD
@ DOCA_FLOW_TUN_EXT_VXLAN_GBP
@ DOCA_FLOW_TUN_EXT_VXLAN_GPE
@ DOCA_FLOW_TUN_GRE
@ DOCA_FLOW_TUN_GENEVE
@ DOCA_FLOW_TUN_GTPU
@ DOCA_FLOW_TUN_VXLAN
@ DOCA_FLOW_TUN_NONE
@ DOCA_FLOW_TUN_MPLS_O_UDP
@ DOCA_FLOW_TUN_MAX
@ DOCA_FLOW_TUN_PSP
@ DOCA_FLOW_TUN_IP_IN_IP
@ DOCA_FLOW_TUN_ESP
@ DOCA_FLOW_TUN_EXT_GRE_NVGRE
@ DOCA_FLOW_TUN_EXT_GRE_STANDARD
uint32_t doca_be32_t
Definition: doca_types.h:121
uint64_t doca_be64_t
Definition: doca_types.h:122
uint16_t doca_be16_t
Declare DOCA endianity types.
Definition: doca_types.h:120
doca_be32_t dst_ip
doca_be32_t src_ip
doca_be32_t src_ip[4]
doca_be32_t dst_ip[4]
doca flow vlan header
doca flow eth header
uint8_t dst_mac[DOCA_FLOW_ETHER_ADDR_LEN]
uint8_t src_mac[DOCA_FLOW_ETHER_ADDR_LEN]
doca flow GENEVE header.
doca flow BTH header in match data
uint8_t dest_qp[DOCA_FLOW_IB_BTH_DST_QP_LEN]
uint8_t psn[DOCA_FLOW_IB_BTH_PSN_LEN]
doca flow icmp header in match data
doca flow ipv4 header in match data
doca_be16_t identification
doca_be16_t flags_fragment_offset
doca flow ipv6 header in match data
doca_be16_t payload_len
doca_be32_t dst_ip[4]
doca_be32_t flow_label
doca_be32_t src_ip[4]
doca flow tcp or udp port header in match data
doca flow MPLS header.
doca flow psp header in match data and modify/encap actions
doca flow ROCEv2 header in match data
struct doca_flow_header_udp udp
struct doca_flow_header_ib_bth bth
doca flow tcp header in match data
struct doca_flow_header_l4_port l4_port
doca flow udp header in match data
struct doca_flow_header_l4_port l4_port
doca flow ip address
doca_be32_t ipv4_addr
doca_be32_t ipv6_addr[4]
enum doca_flow_l3_type type
doca flow tunnel information
enum doca_flow_tun_type type
doca_be32_t nvgre_vs_id
doca_be16_t vxlan_gbp_group_policy_id
doca_be32_t vxlan_tun_id
union doca_flow_geneve_option geneve_options[DOCA_FLOW_GENEVE_OPT_LEN_MAX]
struct doca_flow_header_psp psp
doca_be32_t esp_spi
uint8_t gtp_ext_psc_qfi
doca_be32_t gtp_teid
enum doca_flow_tun_ext_gre_type gre_type
uint8_t vxlan_tun_rsvd1
uint8_t nvgre_flow_id
enum doca_flow_tun_ext_vxlan_type vxlan_type
doca_be16_t protocol
struct doca_flow_header_mpls mpls[DOCA_FLOW_MPLS_LABELS_MAX]
uint8_t vxlan_gpe_next_protocol
doca_be32_t gre_key
uint8_t gtp_next_ext_hdr_type
uint8_t vxlan_gpe_flags
struct doca_flow_header_geneve geneve
doca_be32_t esp_sn
doca flow GENEVE option single DW.