xref: /dpdk/app/test-flow-perf/flow_gen.h (revision fda3750de619617a258da4281de7535b4bad7401)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2020 Mellanox Technologies, Ltd
3  *
4  * This file contains the items, actions and attributes
5  * definition. And the methods to prepare and fill items,
6  * actions and attributes to generate rte_flow rule.
7  */
8 
9 #ifndef FLOW_PERF_FLOW_GEN
10 #define FLOW_PERF_FLOW_GEN
11 
12 #include <stdint.h>
13 #include <rte_flow.h>
14 
15 #include "config.h"
16 
17 /* Actions */
18 #define HAIRPIN_QUEUE_ACTION FLOW_ACTION_MASK(0)
19 #define HAIRPIN_RSS_ACTION   FLOW_ACTION_MASK(1)
20 
21 /* Attributes */
22 #define INGRESS              FLOW_ATTR_MASK(0)
23 #define EGRESS               FLOW_ATTR_MASK(1)
24 #define TRANSFER             FLOW_ATTR_MASK(2)
25 
26 struct rte_flow *
27 generate_flow(uint16_t port_id,
28 	uint16_t group,
29 	uint64_t *flow_attrs,
30 	uint64_t *flow_items,
31 	uint64_t *flow_actions,
32 	uint16_t next_table,
33 	uint32_t outer_ip_src,
34 	uint16_t hairpinq,
35 	uint64_t encap_data,
36 	uint64_t decap_data,
37 	uint16_t dst_port,
38 	uint8_t core_idx,
39 	uint8_t rx_queues_count,
40 	bool unique_data,
41 	uint8_t max_priority,
42 	struct rte_flow_error *error);
43 
44 #endif /* FLOW_PERF_FLOW_GEN */
45