DPDK  20.11.0
rte_swx_ctl.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4 #ifndef __INCLUDE_RTE_SWX_CTL_H__
5 #define __INCLUDE_RTE_SWX_CTL_H__
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
16 #include <stddef.h>
17 #include <stdint.h>
18 
19 #include <rte_compat.h>
20 
21 #include "rte_swx_port.h"
22 #include "rte_swx_table.h"
23 
24 struct rte_swx_pipeline;
25 
27 #ifndef RTE_SWX_CTL_NAME_SIZE
28 #define RTE_SWX_CTL_NAME_SIZE 64
29 #endif
30 
31 /*
32  * Pipeline Query API.
33  */
34 
38  uint32_t n_ports_in;
39 
41  uint32_t n_ports_out;
42 
44  uint32_t n_actions;
45 
47  uint32_t n_tables;
48 };
49 
61 __rte_experimental
62 int
63 rte_swx_ctl_pipeline_info_get(struct rte_swx_pipeline *p,
64  struct rte_swx_ctl_pipeline_info *pipeline);
65 
77 __rte_experimental
78 int
79 rte_swx_ctl_pipeline_numa_node_get(struct rte_swx_pipeline *p,
80  int *numa_node);
81 
82 /*
83  * Ports Query API.
84  */
85 
99 __rte_experimental
100 int
101 rte_swx_ctl_pipeline_port_in_stats_read(struct rte_swx_pipeline *p,
102  uint32_t port_id,
103  struct rte_swx_port_in_stats *stats);
104 
118 __rte_experimental
119 int
120 rte_swx_ctl_pipeline_port_out_stats_read(struct rte_swx_pipeline *p,
121  uint32_t port_id,
122  struct rte_swx_port_out_stats *stats);
123 
124 /*
125  * Action Query API.
126  */
127 
132 
134  uint32_t n_args;
135 };
136 
150 __rte_experimental
151 int
152 rte_swx_ctl_action_info_get(struct rte_swx_pipeline *p,
153  uint32_t action_id,
154  struct rte_swx_ctl_action_info *action);
155 
160 
162  uint32_t n_bits;
163 };
164 
180 __rte_experimental
181 int
182 rte_swx_ctl_action_arg_info_get(struct rte_swx_pipeline *p,
183  uint32_t action_id,
184  uint32_t action_arg_id,
185  struct rte_swx_ctl_action_arg_info *action_arg);
186 
187 /*
188  * Table Query API.
189  */
190 
195 
198 
200  uint32_t n_match_fields;
201 
203  uint32_t n_actions;
204 
210 
212  uint32_t size;
213 };
214 
228 __rte_experimental
229 int
230 rte_swx_ctl_table_info_get(struct rte_swx_pipeline *p,
231  uint32_t table_id,
232  struct rte_swx_ctl_table_info *table);
233 
241  enum rte_swx_table_match_type match_type;
242 
247 
249  uint32_t n_bits;
250 
254  uint32_t offset;
255 };
256 
272 __rte_experimental
273 int
274 rte_swx_ctl_table_match_field_info_get(struct rte_swx_pipeline *p,
275  uint32_t table_id,
276  uint32_t match_field_id,
277  struct rte_swx_ctl_table_match_field_info *match_field);
278 
282  uint32_t action_id;
283 };
284 
303 __rte_experimental
304 int
305 rte_swx_ctl_table_action_info_get(struct rte_swx_pipeline *p,
306  uint32_t table_id,
307  uint32_t table_action_id,
308  struct rte_swx_ctl_table_action_info *table_action);
309 
329 __rte_experimental
330 int
331 rte_swx_ctl_table_ops_get(struct rte_swx_pipeline *p,
332  uint32_t table_id,
333  struct rte_swx_table_ops *table_ops,
334  int *is_stub);
335 
336 /*
337  * Table Update API.
338  */
339 
343  void *obj;
344 
347 
352 };
353 
370 __rte_experimental
371 int
372 rte_swx_pipeline_table_state_get(struct rte_swx_pipeline *p,
373  struct rte_swx_table_state **table_state);
374 
389 __rte_experimental
390 int
391 rte_swx_pipeline_table_state_set(struct rte_swx_pipeline *p,
392  struct rte_swx_table_state *table_state);
393 
394 /*
395  * High Level Reference Table Update API.
396  */
397 
399 struct rte_swx_ctl_pipeline;
400 
409 __rte_experimental
410 struct rte_swx_ctl_pipeline *
411 rte_swx_ctl_pipeline_create(struct rte_swx_pipeline *p);
412 
429 __rte_experimental
430 int
431 rte_swx_ctl_pipeline_table_entry_add(struct rte_swx_ctl_pipeline *ctl,
432  const char *table_name,
433  struct rte_swx_table_entry *entry);
434 
451 __rte_experimental
452 int
453 rte_swx_ctl_pipeline_table_default_entry_add(struct rte_swx_ctl_pipeline *ctl,
454  const char *table_name,
455  struct rte_swx_table_entry *entry);
456 
474 __rte_experimental
475 int
476 rte_swx_ctl_pipeline_table_entry_delete(struct rte_swx_ctl_pipeline *ctl,
477  const char *table_name,
478  struct rte_swx_table_entry *entry);
479 
495 __rte_experimental
496 int
497 rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl,
498  int abort_on_fail);
499 
508 __rte_experimental
509 void
510 rte_swx_ctl_pipeline_abort(struct rte_swx_ctl_pipeline *ctl);
511 
527 __rte_experimental
528 struct rte_swx_table_entry *
529 rte_swx_ctl_pipeline_table_entry_read(struct rte_swx_ctl_pipeline *ctl,
530  const char *table_name,
531  const char *string);
532 
548 __rte_experimental
549 int
551  struct rte_swx_ctl_pipeline *ctl,
552  const char *table_name);
553 
560 __rte_experimental
561 void
562 rte_swx_ctl_pipeline_free(struct rte_swx_ctl_pipeline *ctl);
563 
564 #ifdef __cplusplus
565 }
566 #endif
567 
568 #endif
__rte_experimental int rte_swx_ctl_table_action_info_get(struct rte_swx_pipeline *p, uint32_t table_id, uint32_t table_action_id, struct rte_swx_ctl_table_action_info *table_action)
Definition: rte_swx_table.h:67
__rte_experimental struct rte_swx_table_entry * rte_swx_ctl_pipeline_table_entry_read(struct rte_swx_ctl_pipeline *ctl, const char *table_name, const char *string)
__rte_experimental int rte_swx_ctl_pipeline_table_default_entry_add(struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry)
uint8_t * default_action_data
Definition: rte_swx_ctl.h:351
__rte_experimental int rte_swx_ctl_action_arg_info_get(struct rte_swx_pipeline *p, uint32_t action_id, uint32_t action_arg_id, struct rte_swx_ctl_action_arg_info *action_arg)
rte_swx_table_match_type
Definition: rte_swx_table.h:22
uint64_t default_action_id
Definition: rte_swx_ctl.h:346
__rte_experimental int rte_swx_ctl_pipeline_numa_node_get(struct rte_swx_pipeline *p, int *numa_node)
__rte_experimental void rte_swx_ctl_pipeline_free(struct rte_swx_ctl_pipeline *ctl)
__rte_experimental int rte_swx_ctl_table_ops_get(struct rte_swx_pipeline *p, uint32_t table_id, struct rte_swx_table_ops *table_ops, int *is_stub)
__rte_experimental int rte_swx_ctl_pipeline_table_entry_delete(struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry)
__rte_experimental int rte_swx_ctl_action_info_get(struct rte_swx_pipeline *p, uint32_t action_id, struct rte_swx_ctl_action_info *action)
__rte_experimental int rte_swx_ctl_pipeline_table_entry_add(struct rte_swx_ctl_pipeline *ctl, const char *table_name, struct rte_swx_table_entry *entry)
__rte_experimental int rte_swx_ctl_pipeline_port_out_stats_read(struct rte_swx_pipeline *p, uint32_t port_id, struct rte_swx_port_out_stats *stats)
__rte_experimental int rte_swx_ctl_pipeline_info_get(struct rte_swx_pipeline *p, struct rte_swx_ctl_pipeline_info *pipeline)
__rte_experimental struct rte_swx_ctl_pipeline * rte_swx_ctl_pipeline_create(struct rte_swx_pipeline *p)
__rte_experimental int rte_swx_ctl_pipeline_port_in_stats_read(struct rte_swx_pipeline *p, uint32_t port_id, struct rte_swx_port_in_stats *stats)
__rte_experimental int rte_swx_ctl_table_match_field_info_get(struct rte_swx_pipeline *p, uint32_t table_id, uint32_t match_field_id, struct rte_swx_ctl_table_match_field_info *match_field)
__rte_experimental int rte_swx_pipeline_table_state_get(struct rte_swx_pipeline *p, struct rte_swx_table_state **table_state)
__rte_experimental int rte_swx_ctl_table_info_get(struct rte_swx_pipeline *p, uint32_t table_id, struct rte_swx_ctl_table_info *table)
__rte_experimental int rte_swx_ctl_pipeline_commit(struct rte_swx_ctl_pipeline *ctl, int abort_on_fail)
__rte_experimental int rte_swx_ctl_pipeline_table_fprintf(FILE *f, struct rte_swx_ctl_pipeline *ctl, const char *table_name)
#define RTE_SWX_CTL_NAME_SIZE
Definition: rte_swx_ctl.h:28
__rte_experimental int rte_swx_pipeline_table_state_set(struct rte_swx_pipeline *p, struct rte_swx_table_state *table_state)
__rte_experimental void rte_swx_ctl_pipeline_abort(struct rte_swx_ctl_pipeline *ctl)