xref: /dpdk/examples/ip_pipeline/pipeline.h (revision 5ac1abdd37aa43692603cd8670111c354014766f)
1d75c371eSJasvinder Singh /* SPDX-License-Identifier: BSD-3-Clause
2d75c371eSJasvinder Singh  * Copyright(c) 2010-2018 Intel Corporation
3d75c371eSJasvinder Singh  */
4d75c371eSJasvinder Singh 
5d75c371eSJasvinder Singh #ifndef _INCLUDE_PIPELINE_H_
6d75c371eSJasvinder Singh #define _INCLUDE_PIPELINE_H_
7d75c371eSJasvinder Singh 
8d75c371eSJasvinder Singh #include <stdint.h>
9d75c371eSJasvinder Singh #include <sys/queue.h>
10d75c371eSJasvinder Singh 
11d75c371eSJasvinder Singh #include <rte_pipeline.h>
12d75c371eSJasvinder Singh #include <rte_table_action.h>
13d75c371eSJasvinder Singh 
14d75c371eSJasvinder Singh #include "common.h"
15d75c371eSJasvinder Singh #include "action.h"
16d75c371eSJasvinder Singh 
17d75c371eSJasvinder Singh struct pipeline_params {
18d75c371eSJasvinder Singh 	uint32_t timer_period_ms;
19d75c371eSJasvinder Singh 	uint32_t offset_port_id;
20d75c371eSJasvinder Singh 	uint32_t cpu_id;
21d75c371eSJasvinder Singh };
22d75c371eSJasvinder Singh 
23d75c371eSJasvinder Singh enum port_in_type {
24d75c371eSJasvinder Singh 	PORT_IN_RXQ,
25d75c371eSJasvinder Singh 	PORT_IN_SWQ,
26d75c371eSJasvinder Singh 	PORT_IN_TMGR,
27d75c371eSJasvinder Singh 	PORT_IN_TAP,
28d75c371eSJasvinder Singh 	PORT_IN_SOURCE,
29e1884698SFan Zhang 	PORT_IN_CRYPTODEV,
30d75c371eSJasvinder Singh };
31d75c371eSJasvinder Singh 
32d75c371eSJasvinder Singh struct port_in_params {
33d75c371eSJasvinder Singh 	/* Read */
34d75c371eSJasvinder Singh 	enum port_in_type type;
35d75c371eSJasvinder Singh 	const char *dev_name;
36d75c371eSJasvinder Singh 	union {
37d75c371eSJasvinder Singh 		struct {
38d75c371eSJasvinder Singh 			uint16_t queue_id;
39d75c371eSJasvinder Singh 		} rxq;
40d75c371eSJasvinder Singh 
41d75c371eSJasvinder Singh 		struct {
42d75c371eSJasvinder Singh 			const char *mempool_name;
43d75c371eSJasvinder Singh 			uint32_t mtu;
44d75c371eSJasvinder Singh 		} tap;
45d75c371eSJasvinder Singh 
46d75c371eSJasvinder Singh 		struct {
47d75c371eSJasvinder Singh 			const char *mempool_name;
48d75c371eSJasvinder Singh 			const char *file_name;
49d75c371eSJasvinder Singh 			uint32_t n_bytes_per_pkt;
50d75c371eSJasvinder Singh 		} source;
51e1884698SFan Zhang 
52e1884698SFan Zhang 		struct {
53e1884698SFan Zhang 			uint16_t queue_id;
54e1884698SFan Zhang 			void *f_callback;
55e1884698SFan Zhang 			void *arg_callback;
56e1884698SFan Zhang 		} cryptodev;
57d75c371eSJasvinder Singh 	};
58d75c371eSJasvinder Singh 	uint32_t burst_size;
59d75c371eSJasvinder Singh 
60d75c371eSJasvinder Singh 	/* Action */
61d75c371eSJasvinder Singh 	const char *action_profile_name;
62d75c371eSJasvinder Singh };
63d75c371eSJasvinder Singh 
64d75c371eSJasvinder Singh enum port_out_type {
65d75c371eSJasvinder Singh 	PORT_OUT_TXQ,
66d75c371eSJasvinder Singh 	PORT_OUT_SWQ,
67d75c371eSJasvinder Singh 	PORT_OUT_TMGR,
68d75c371eSJasvinder Singh 	PORT_OUT_TAP,
69d75c371eSJasvinder Singh 	PORT_OUT_SINK,
70e1884698SFan Zhang 	PORT_OUT_CRYPTODEV,
71d75c371eSJasvinder Singh };
72d75c371eSJasvinder Singh 
73d75c371eSJasvinder Singh struct port_out_params {
74d75c371eSJasvinder Singh 	enum port_out_type type;
75d75c371eSJasvinder Singh 	const char *dev_name;
76d75c371eSJasvinder Singh 	union {
77d75c371eSJasvinder Singh 		struct {
78d75c371eSJasvinder Singh 			uint16_t queue_id;
79d75c371eSJasvinder Singh 		} txq;
80d75c371eSJasvinder Singh 
81d75c371eSJasvinder Singh 		struct {
82d75c371eSJasvinder Singh 			const char *file_name;
83d75c371eSJasvinder Singh 			uint32_t max_n_pkts;
84d75c371eSJasvinder Singh 		} sink;
85e1884698SFan Zhang 
86e1884698SFan Zhang 		struct {
87e1884698SFan Zhang 			uint16_t queue_id;
88e1884698SFan Zhang 			uint32_t op_offset;
89e1884698SFan Zhang 		} cryptodev;
90d75c371eSJasvinder Singh 	};
91d75c371eSJasvinder Singh 	uint32_t burst_size;
92d75c371eSJasvinder Singh 	int retry;
93d75c371eSJasvinder Singh 	uint32_t n_retries;
94d75c371eSJasvinder Singh };
95d75c371eSJasvinder Singh 
96d75c371eSJasvinder Singh enum table_type {
97d75c371eSJasvinder Singh 	TABLE_ACL,
98d75c371eSJasvinder Singh 	TABLE_ARRAY,
99d75c371eSJasvinder Singh 	TABLE_HASH,
100d75c371eSJasvinder Singh 	TABLE_LPM,
101d75c371eSJasvinder Singh 	TABLE_STUB,
102d75c371eSJasvinder Singh };
103d75c371eSJasvinder Singh 
104d75c371eSJasvinder Singh struct table_acl_params {
105d75c371eSJasvinder Singh 	uint32_t n_rules;
106d75c371eSJasvinder Singh 	uint32_t ip_header_offset;
107d75c371eSJasvinder Singh 	int ip_version;
108d75c371eSJasvinder Singh };
109d75c371eSJasvinder Singh 
110d75c371eSJasvinder Singh struct table_array_params {
111d75c371eSJasvinder Singh 	uint32_t n_keys;
112d75c371eSJasvinder Singh 	uint32_t key_offset;
113d75c371eSJasvinder Singh };
114d75c371eSJasvinder Singh 
115d75c371eSJasvinder Singh struct table_hash_params {
116d75c371eSJasvinder Singh 	uint32_t n_keys;
117d75c371eSJasvinder Singh 	uint32_t key_offset;
118d75c371eSJasvinder Singh 	uint32_t key_size;
119d75c371eSJasvinder Singh 	uint8_t *key_mask;
120d75c371eSJasvinder Singh 	uint32_t n_buckets;
121d75c371eSJasvinder Singh 	int extendable_bucket;
122d75c371eSJasvinder Singh };
123d75c371eSJasvinder Singh 
124d75c371eSJasvinder Singh struct table_lpm_params {
125d75c371eSJasvinder Singh 	uint32_t n_rules;
126d75c371eSJasvinder Singh 	uint32_t key_offset;
127d75c371eSJasvinder Singh 	uint32_t key_size;
128d75c371eSJasvinder Singh };
129d75c371eSJasvinder Singh 
130d75c371eSJasvinder Singh struct table_params {
131d75c371eSJasvinder Singh 	/* Match */
132d75c371eSJasvinder Singh 	enum table_type match_type;
133d75c371eSJasvinder Singh 	union {
134d75c371eSJasvinder Singh 		struct table_acl_params acl;
135d75c371eSJasvinder Singh 		struct table_array_params array;
136d75c371eSJasvinder Singh 		struct table_hash_params hash;
137d75c371eSJasvinder Singh 		struct table_lpm_params lpm;
138d75c371eSJasvinder Singh 	} match;
139d75c371eSJasvinder Singh 
140d75c371eSJasvinder Singh 	/* Action */
141d75c371eSJasvinder Singh 	const char *action_profile_name;
142d75c371eSJasvinder Singh };
143d75c371eSJasvinder Singh 
14435c10b58SCristian Dumitrescu struct table_rule;
14535c10b58SCristian Dumitrescu 
14635c10b58SCristian Dumitrescu TAILQ_HEAD(table_rule_list, table_rule);
14735c10b58SCristian Dumitrescu 
148d75c371eSJasvinder Singh struct port_in {
149d75c371eSJasvinder Singh 	struct port_in_params params;
150d75c371eSJasvinder Singh 	struct port_in_action_profile *ap;
151d75c371eSJasvinder Singh 	struct rte_port_in_action *a;
152d75c371eSJasvinder Singh };
153d75c371eSJasvinder Singh 
154d75c371eSJasvinder Singh struct table {
155d75c371eSJasvinder Singh 	struct table_params params;
156d75c371eSJasvinder Singh 	struct table_action_profile *ap;
157d75c371eSJasvinder Singh 	struct rte_table_action *a;
15835c10b58SCristian Dumitrescu 	struct table_rule_list rules;
15935c10b58SCristian Dumitrescu 	struct table_rule *rule_default;
160d75c371eSJasvinder Singh };
161d75c371eSJasvinder Singh 
162d75c371eSJasvinder Singh struct pipeline {
163d75c371eSJasvinder Singh 	TAILQ_ENTRY(pipeline) node;
164d75c371eSJasvinder Singh 	char name[NAME_SIZE];
165d75c371eSJasvinder Singh 
166d75c371eSJasvinder Singh 	struct rte_pipeline *p;
167d75c371eSJasvinder Singh 	struct port_in port_in[RTE_PIPELINE_PORT_IN_MAX];
168d75c371eSJasvinder Singh 	struct table table[RTE_PIPELINE_TABLE_MAX];
169d75c371eSJasvinder Singh 	uint32_t n_ports_in;
170d75c371eSJasvinder Singh 	uint32_t n_ports_out;
171d75c371eSJasvinder Singh 	uint32_t n_tables;
172d75c371eSJasvinder Singh 
173d75c371eSJasvinder Singh 	struct rte_ring *msgq_req;
174d75c371eSJasvinder Singh 	struct rte_ring *msgq_rsp;
175d75c371eSJasvinder Singh 	uint32_t timer_period_ms;
176d75c371eSJasvinder Singh 
177d75c371eSJasvinder Singh 	int enabled;
178d75c371eSJasvinder Singh 	uint32_t thread_id;
179d75c371eSJasvinder Singh 	uint32_t cpu_id;
180d75c371eSJasvinder Singh };
181d75c371eSJasvinder Singh 
182d75c371eSJasvinder Singh TAILQ_HEAD(pipeline_list, pipeline);
183d75c371eSJasvinder Singh 
184d75c371eSJasvinder Singh int
185d75c371eSJasvinder Singh pipeline_init(void);
186d75c371eSJasvinder Singh 
187d75c371eSJasvinder Singh struct pipeline *
188d75c371eSJasvinder Singh pipeline_find(const char *name);
189d75c371eSJasvinder Singh 
190d75c371eSJasvinder Singh struct pipeline *
191d75c371eSJasvinder Singh pipeline_create(const char *name, struct pipeline_params *params);
192d75c371eSJasvinder Singh 
193d75c371eSJasvinder Singh int
194d75c371eSJasvinder Singh pipeline_port_in_create(const char *pipeline_name,
195d75c371eSJasvinder Singh 	struct port_in_params *params,
196d75c371eSJasvinder Singh 	int enabled);
197d75c371eSJasvinder Singh 
198d75c371eSJasvinder Singh int
199d75c371eSJasvinder Singh pipeline_port_in_connect_to_table(const char *pipeline_name,
200d75c371eSJasvinder Singh 	uint32_t port_id,
201d75c371eSJasvinder Singh 	uint32_t table_id);
202d75c371eSJasvinder Singh 
203d75c371eSJasvinder Singh int
204d75c371eSJasvinder Singh pipeline_port_out_create(const char *pipeline_name,
205d75c371eSJasvinder Singh 	struct port_out_params *params);
206d75c371eSJasvinder Singh 
207d75c371eSJasvinder Singh int
208d75c371eSJasvinder Singh pipeline_table_create(const char *pipeline_name,
209d75c371eSJasvinder Singh 	struct table_params *params);
210d75c371eSJasvinder Singh 
211d75c371eSJasvinder Singh struct table_rule_match_acl {
212d75c371eSJasvinder Singh 	int ip_version;
213d75c371eSJasvinder Singh 
214d75c371eSJasvinder Singh 	union {
215d75c371eSJasvinder Singh 		struct {
216d75c371eSJasvinder Singh 			uint32_t sa;
217d75c371eSJasvinder Singh 			uint32_t da;
218d75c371eSJasvinder Singh 		} ipv4;
219d75c371eSJasvinder Singh 
220d75c371eSJasvinder Singh 		struct {
221*5ac1abddSRobin Jarry 			struct rte_ipv6_addr sa;
222*5ac1abddSRobin Jarry 			struct rte_ipv6_addr da;
223d75c371eSJasvinder Singh 		} ipv6;
224d75c371eSJasvinder Singh 	};
225d75c371eSJasvinder Singh 
226d75c371eSJasvinder Singh 	uint32_t sa_depth;
227d75c371eSJasvinder Singh 	uint32_t da_depth;
228d75c371eSJasvinder Singh 	uint16_t sp0;
229d75c371eSJasvinder Singh 	uint16_t sp1;
230d75c371eSJasvinder Singh 	uint16_t dp0;
231d75c371eSJasvinder Singh 	uint16_t dp1;
232d75c371eSJasvinder Singh 	uint8_t proto;
233d75c371eSJasvinder Singh 	uint8_t proto_mask;
234d75c371eSJasvinder Singh 	uint32_t priority;
235d75c371eSJasvinder Singh };
236d75c371eSJasvinder Singh 
237d75c371eSJasvinder Singh struct table_rule_match_array {
238d75c371eSJasvinder Singh 	uint32_t pos;
239d75c371eSJasvinder Singh };
240d75c371eSJasvinder Singh 
241d75c371eSJasvinder Singh #ifndef TABLE_RULE_MATCH_SIZE_MAX
242d75c371eSJasvinder Singh #define TABLE_RULE_MATCH_SIZE_MAX                          256
243d75c371eSJasvinder Singh #endif
244d75c371eSJasvinder Singh 
245d75c371eSJasvinder Singh #ifndef TABLE_RULE_ACTION_SIZE_MAX
246d75c371eSJasvinder Singh #define TABLE_RULE_ACTION_SIZE_MAX                         2048
247d75c371eSJasvinder Singh #endif
248d75c371eSJasvinder Singh 
249d75c371eSJasvinder Singh struct table_rule_match_hash {
250d75c371eSJasvinder Singh 	uint8_t key[TABLE_RULE_MATCH_SIZE_MAX];
251d75c371eSJasvinder Singh };
252d75c371eSJasvinder Singh 
253d75c371eSJasvinder Singh struct table_rule_match_lpm {
254d75c371eSJasvinder Singh 	int ip_version;
255d75c371eSJasvinder Singh 
256d75c371eSJasvinder Singh 	union {
257d75c371eSJasvinder Singh 		uint32_t ipv4;
258*5ac1abddSRobin Jarry 		struct rte_ipv6_addr ipv6;
259d75c371eSJasvinder Singh 	};
260d75c371eSJasvinder Singh 
261d75c371eSJasvinder Singh 	uint8_t depth;
262d75c371eSJasvinder Singh };
263d75c371eSJasvinder Singh 
264d75c371eSJasvinder Singh struct table_rule_match {
265d75c371eSJasvinder Singh 	enum table_type match_type;
266d75c371eSJasvinder Singh 
267d75c371eSJasvinder Singh 	union {
268d75c371eSJasvinder Singh 		struct table_rule_match_acl acl;
269d75c371eSJasvinder Singh 		struct table_rule_match_array array;
270d75c371eSJasvinder Singh 		struct table_rule_match_hash hash;
271d75c371eSJasvinder Singh 		struct table_rule_match_lpm lpm;
272d75c371eSJasvinder Singh 	} match;
273d75c371eSJasvinder Singh };
274d75c371eSJasvinder Singh 
275186b14d6SFan Zhang #ifndef SYM_CRYPTO_MAX_KEY_SIZE
276186b14d6SFan Zhang #define SYM_CRYPTO_MAX_KEY_SIZE                (256)
277186b14d6SFan Zhang #endif
278186b14d6SFan Zhang 
279d75c371eSJasvinder Singh struct table_rule_action {
280d75c371eSJasvinder Singh 	uint64_t action_mask;
281d75c371eSJasvinder Singh 	struct rte_table_action_fwd_params fwd;
282802755dcSJasvinder Singh 	struct rte_table_action_lb_params lb;
283d75c371eSJasvinder Singh 	struct rte_table_action_mtr_params mtr;
284d75c371eSJasvinder Singh 	struct rte_table_action_tm_params tm;
285d75c371eSJasvinder Singh 	struct rte_table_action_encap_params encap;
286d75c371eSJasvinder Singh 	struct rte_table_action_nat_params nat;
287d75c371eSJasvinder Singh 	struct rte_table_action_ttl_params ttl;
288d75c371eSJasvinder Singh 	struct rte_table_action_stats_params stats;
289d75c371eSJasvinder Singh 	struct rte_table_action_time_params time;
290d46fe944SFan Zhang 	struct rte_table_action_sym_crypto_params sym_crypto;
291186b14d6SFan Zhang 	uint8_t sym_crypto_key[SYM_CRYPTO_MAX_KEY_SIZE];
2921bdf2632SCristian Dumitrescu 	struct rte_table_action_tag_params tag;
293d5ed626fSCristian Dumitrescu 	struct rte_table_action_decap_params decap;
294186b14d6SFan Zhang 
295d75c371eSJasvinder Singh };
296d75c371eSJasvinder Singh 
29735c10b58SCristian Dumitrescu struct table_rule {
29835c10b58SCristian Dumitrescu 	TAILQ_ENTRY(table_rule) node;
29935c10b58SCristian Dumitrescu 	struct table_rule_match match;
30035c10b58SCristian Dumitrescu 	struct table_rule_action action;
30135c10b58SCristian Dumitrescu 	void *data;
30235c10b58SCristian Dumitrescu };
30335c10b58SCristian Dumitrescu 
3046b1b3c3cSJasvinder Singh int
30550e73d05SJasvinder Singh pipeline_port_in_stats_read(const char *pipeline_name,
30650e73d05SJasvinder Singh 	uint32_t port_id,
30750e73d05SJasvinder Singh 	struct rte_pipeline_port_in_stats *stats,
30850e73d05SJasvinder Singh 	int clear);
30950e73d05SJasvinder Singh 
31050e73d05SJasvinder Singh int
3116b1b3c3cSJasvinder Singh pipeline_port_in_enable(const char *pipeline_name,
3126b1b3c3cSJasvinder Singh 	uint32_t port_id);
3136b1b3c3cSJasvinder Singh 
3146b1b3c3cSJasvinder Singh int
3156b1b3c3cSJasvinder Singh pipeline_port_in_disable(const char *pipeline_name,
3166b1b3c3cSJasvinder Singh 	uint32_t port_id);
3176b1b3c3cSJasvinder Singh 
31850e73d05SJasvinder Singh int
31950e73d05SJasvinder Singh pipeline_port_out_stats_read(const char *pipeline_name,
32050e73d05SJasvinder Singh 	uint32_t port_id,
32150e73d05SJasvinder Singh 	struct rte_pipeline_port_out_stats *stats,
32250e73d05SJasvinder Singh 	int clear);
32350e73d05SJasvinder Singh 
32450e73d05SJasvinder Singh int
32550e73d05SJasvinder Singh pipeline_table_stats_read(const char *pipeline_name,
32650e73d05SJasvinder Singh 	uint32_t table_id,
32750e73d05SJasvinder Singh 	struct rte_pipeline_table_stats *stats,
32850e73d05SJasvinder Singh 	int clear);
32950e73d05SJasvinder Singh 
330a3a95b7dSJasvinder Singh int
331a3a95b7dSJasvinder Singh pipeline_table_rule_add(const char *pipeline_name,
332a3a95b7dSJasvinder Singh 	uint32_t table_id,
333a3a95b7dSJasvinder Singh 	struct table_rule_match *match,
3344c65163eSCristian Dumitrescu 	struct table_rule_action *action);
335a3a95b7dSJasvinder Singh 
336a3a95b7dSJasvinder Singh int
3373186282fSJasvinder Singh pipeline_table_rule_add_bulk(const char *pipeline_name,
3383186282fSJasvinder Singh 	uint32_t table_id,
33927b333b2SCristian Dumitrescu 	struct table_rule_list *list,
34027b333b2SCristian Dumitrescu 	uint32_t *n_rules_added,
34127b333b2SCristian Dumitrescu 	uint32_t *n_rules_not_added);
3423186282fSJasvinder Singh 
3433186282fSJasvinder Singh int
344a3a95b7dSJasvinder Singh pipeline_table_rule_add_default(const char *pipeline_name,
345a3a95b7dSJasvinder Singh 	uint32_t table_id,
346c348ec05SCristian Dumitrescu 	struct table_rule_action *action);
347a3a95b7dSJasvinder Singh 
348f634e4c5SJasvinder Singh int
349f634e4c5SJasvinder Singh pipeline_table_rule_delete(const char *pipeline_name,
350f634e4c5SJasvinder Singh 	uint32_t table_id,
351f634e4c5SJasvinder Singh 	struct table_rule_match *match);
352f634e4c5SJasvinder Singh 
353f634e4c5SJasvinder Singh int
354f634e4c5SJasvinder Singh pipeline_table_rule_delete_default(const char *pipeline_name,
355f634e4c5SJasvinder Singh 	uint32_t table_id);
356f634e4c5SJasvinder Singh 
357c64b9121SJasvinder Singh int
358c64b9121SJasvinder Singh pipeline_table_rule_stats_read(const char *pipeline_name,
359c64b9121SJasvinder Singh 	uint32_t table_id,
36087b36dcdSCristian Dumitrescu 	struct table_rule_match *match,
361c64b9121SJasvinder Singh 	struct rte_table_action_stats_counters *stats,
362c64b9121SJasvinder Singh 	int clear);
363c64b9121SJasvinder Singh 
3647e11393eSJasvinder Singh int
3657e11393eSJasvinder Singh pipeline_table_mtr_profile_add(const char *pipeline_name,
3667e11393eSJasvinder Singh 	uint32_t table_id,
3677e11393eSJasvinder Singh 	uint32_t meter_profile_id,
3687e11393eSJasvinder Singh 	struct rte_table_action_meter_profile *profile);
3697e11393eSJasvinder Singh 
3707e11393eSJasvinder Singh int
3717e11393eSJasvinder Singh pipeline_table_mtr_profile_delete(const char *pipeline_name,
3727e11393eSJasvinder Singh 	uint32_t table_id,
3737e11393eSJasvinder Singh 	uint32_t meter_profile_id);
3747e11393eSJasvinder Singh 
375e92058d6SJasvinder Singh int
376e92058d6SJasvinder Singh pipeline_table_rule_mtr_read(const char *pipeline_name,
377e92058d6SJasvinder Singh 	uint32_t table_id,
3788c6dc647SCristian Dumitrescu 	struct table_rule_match *match,
379e92058d6SJasvinder Singh 	struct rte_table_action_mtr_counters *stats,
380e92058d6SJasvinder Singh 	int clear);
381e92058d6SJasvinder Singh 
3822b82ef48SJasvinder Singh int
3832b82ef48SJasvinder Singh pipeline_table_dscp_table_update(const char *pipeline_name,
3842b82ef48SJasvinder Singh 	uint32_t table_id,
3852b82ef48SJasvinder Singh 	uint64_t dscp_mask,
3862b82ef48SJasvinder Singh 	struct rte_table_action_dscp_table *dscp_table);
3872b82ef48SJasvinder Singh 
388d0d306c7SJasvinder Singh int
389d0d306c7SJasvinder Singh pipeline_table_rule_ttl_read(const char *pipeline_name,
390d0d306c7SJasvinder Singh 	uint32_t table_id,
3918bfe22acSCristian Dumitrescu 	struct table_rule_match *match,
392d0d306c7SJasvinder Singh 	struct rte_table_action_ttl_counters *stats,
393d0d306c7SJasvinder Singh 	int clear);
394a3169ee5SCristian Dumitrescu 
395a3169ee5SCristian Dumitrescu int
396a3169ee5SCristian Dumitrescu pipeline_table_rule_time_read(const char *pipeline_name,
397a3169ee5SCristian Dumitrescu 	uint32_t table_id,
398a3169ee5SCristian Dumitrescu 	struct table_rule_match *match,
399a3169ee5SCristian Dumitrescu 	uint64_t *timestamp);
400a3169ee5SCristian Dumitrescu 
40135c10b58SCristian Dumitrescu struct table_rule *
40235c10b58SCristian Dumitrescu table_rule_find(struct table *table,
40335c10b58SCristian Dumitrescu 	struct table_rule_match *match);
40435c10b58SCristian Dumitrescu 
40535c10b58SCristian Dumitrescu void
40635c10b58SCristian Dumitrescu table_rule_add(struct table *table,
40735c10b58SCristian Dumitrescu 	struct table_rule *rule);
40835c10b58SCristian Dumitrescu 
40935c10b58SCristian Dumitrescu void
41035c10b58SCristian Dumitrescu table_rule_add_bulk(struct table *table,
41135c10b58SCristian Dumitrescu 	struct table_rule_list *list,
41235c10b58SCristian Dumitrescu 	uint32_t n_rules);
41335c10b58SCristian Dumitrescu 
41435c10b58SCristian Dumitrescu void
41535c10b58SCristian Dumitrescu table_rule_delete(struct table *table,
41635c10b58SCristian Dumitrescu 	struct table_rule_match *match);
41735c10b58SCristian Dumitrescu 
41835c10b58SCristian Dumitrescu void
41935c10b58SCristian Dumitrescu table_rule_default_add(struct table *table,
42035c10b58SCristian Dumitrescu 	struct table_rule *rule);
42135c10b58SCristian Dumitrescu 
42235c10b58SCristian Dumitrescu void
42335c10b58SCristian Dumitrescu table_rule_default_delete(struct table *table);
424d0d306c7SJasvinder Singh 
425d75c371eSJasvinder Singh #endif /* _INCLUDE_PIPELINE_H_ */
426