File: stream_binary_flow_api.h

package info (click to toggle)
dpdk 25.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 127,892 kB
  • sloc: ansic: 2,358,479; python: 16,426; sh: 4,474; makefile: 1,713; awk: 70
file content (88 lines) | stat: -rw-r--r-- 2,917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2023 Napatech A/S
 */

#ifndef _STREAM_BINARY_FLOW_API_H_
#define _STREAM_BINARY_FLOW_API_H_

#include <rte_ether.h>
#include "rte_flow.h"
#include "rte_flow_driver.h"

/* Max RSS hash key length in bytes */
#define MAX_RSS_KEY_LEN 40

/* NT specific MASKs for RSS configuration */
/* NOTE: Masks are required for correct RSS configuration, do not modify them! */
#define NT_ETH_RSS_IPV4_MASK                                                                      \
	(RTE_ETH_RSS_IPV4 | RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_NONFRAG_IPV4_OTHER |              \
	 RTE_ETH_RSS_NONFRAG_IPV4_SCTP | RTE_ETH_RSS_NONFRAG_IPV4_TCP |                           \
	 RTE_ETH_RSS_NONFRAG_IPV4_UDP)

#define NT_ETH_RSS_IPV6_MASK                                                                      \
	(RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_FRAG_IPV6 | RTE_ETH_RSS_IPV6_EX |                         \
	 RTE_ETH_RSS_IPV6_TCP_EX | RTE_ETH_RSS_IPV6_UDP_EX | RTE_ETH_RSS_NONFRAG_IPV6_OTHER |     \
	 RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_NONFRAG_IPV6_TCP |                           \
	 RTE_ETH_RSS_NONFRAG_IPV6_UDP)

#define NT_ETH_RSS_IP_MASK                                                                        \
	(NT_ETH_RSS_IPV4_MASK | NT_ETH_RSS_IPV6_MASK | RTE_ETH_RSS_L3_SRC_ONLY |                  \
	 RTE_ETH_RSS_L3_DST_ONLY)

/* List of all RSS flags supported for RSS calculation offload */
#define NT_ETH_RSS_OFFLOAD_MASK                                                                   \
	(RTE_ETH_RSS_ETH | RTE_ETH_RSS_L2_PAYLOAD | RTE_ETH_RSS_IP | RTE_ETH_RSS_TCP |            \
	 RTE_ETH_RSS_UDP | RTE_ETH_RSS_SCTP | RTE_ETH_RSS_L2_SRC_ONLY | RTE_ETH_RSS_L2_DST_ONLY | \
	 RTE_ETH_RSS_L4_SRC_ONLY | RTE_ETH_RSS_L4_DST_ONLY | RTE_ETH_RSS_L3_SRC_ONLY |            \
	 RTE_ETH_RSS_L3_DST_ONLY | RTE_ETH_RSS_VLAN | RTE_ETH_RSS_LEVEL_MASK |                    \
	 RTE_ETH_RSS_IPV4_CHKSUM | RTE_ETH_RSS_L4_CHKSUM | RTE_ETH_RSS_PORT | RTE_ETH_RSS_GTPU)

/*
 * Flow frontend for binary programming interface
 */

#define FLOW_MAX_QUEUES 128

#define RAW_ENCAP_DECAP_ELEMS_MAX 16

extern uint64_t nthw_tsc_freq;
extern rte_spinlock_t nthw_lock;

/*
 * Flow eth dev profile determines how the FPGA module resources are
 * managed and what features are available
 */
enum flow_eth_dev_profile {
	FLOW_ETH_DEV_PROFILE_INLINE = 0,
};

struct flow_queue_id_s {
	int id;
	int hw_id;
};

/*
 * RTE_FLOW_ACTION_TYPE_RAW_ENCAP
 */
struct flow_action_raw_encap {
	uint8_t *data;
	uint8_t *preserve;
	size_t size;
	struct rte_flow_item items[RAW_ENCAP_DECAP_ELEMS_MAX];
	int item_count;
};

/*
 * RTE_FLOW_ACTION_TYPE_RAW_DECAP
 */
struct flow_action_raw_decap {
	uint8_t *data;
	size_t size;
	struct rte_flow_item items[RAW_ENCAP_DECAP_ELEMS_MAX];
	int item_count;
};

struct flow_eth_dev;             /* port device */
struct flow_handle;

#endif  /* _STREAM_BINARY_FLOW_API_H_ */