DPDK  25.11.0
rte_graph_feature_arc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2025 Marvell International Ltd.
3  */
4 
5 #ifndef _RTE_GRAPH_FEATURE_ARC_H_
6 #define _RTE_GRAPH_FEATURE_ARC_H_
7 
8 #include <assert.h>
9 #include <errno.h>
10 #include <signal.h>
11 #include <stddef.h>
12 #include <stdint.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 
17 #include <rte_common.h>
18 #include <rte_compat.h>
19 #include <rte_debug.h>
20 #include <rte_graph.h>
21 #include <rte_rcu_qsbr.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
206 #define RTE_GRAPH_FEATURE_ARC_NAMELEN RTE_NODE_NAMESIZE
207 
209 #define RTE_GRAPH_FEATURE_ARC_INITIALIZER ((rte_graph_feature_arc_t)UINT16_MAX)
210 #define RTE_GRAPH_FEATURE_DATA_INVALID ((rte_graph_feature_data_t)UINT32_MAX)
211 #define RTE_GRAPH_FEATURE_INVALID ((rte_graph_feature_t)UINT8_MAX)
212 
214 typedef uint16_t rte_graph_feature_arc_t;
215 
217 typedef uint8_t rte_graph_feature_t;
218 
220 typedef uint32_t rte_graph_feature_data_t;
221 
223 typedef void (*rte_graph_feature_change_notifier_cb_t)(const char *arc_name,
224  const char *feature_name,
225  rte_node_t feature_node_id,
226  uint32_t index,
227  bool enable_disable,
228  uint16_t app_cookie);
229 
231 typedef uint16_t (*rte_graph_feature_override_index_cb_t)(void);
232 
242 
247  const char *arc_name;
248 
250  const char *feature_name;
251 
259 
268 
276 
280  const char *runs_after;
281 
285  const char *runs_before;
286 
299 
304 };
305 
308  STAILQ_ENTRY(rte_graph_feature_arc_register) next_arc;
309 
311  const char *arc_name;
312 
323  uint16_t max_features;
324 
329  uint16_t max_indexes;
330 
333 
340 
343 };
344 
346 #define RTE_GRAPH_FEATURE_REGISTER(reg) \
347  RTE_INIT(__rte_graph_feature_register_##reg) \
348  { \
349  __rte_graph_feature_register(&reg, __func__, __LINE__); \
350  }
351 
353 #define RTE_GRAPH_FEATURE_ARC_REGISTER(reg) \
354  RTE_INIT(__rte_graph_feature_arc_register_##reg) \
355  { \
356  __rte_graph_feature_arc_register(&reg, __func__, __LINE__); \
357  }
388 __rte_experimental
389 int rte_graph_feature_arc_init(uint16_t num_feature_arcs);
390 
405 __rte_experimental
408 
421 __rte_experimental
423 
444 __rte_experimental
446 
472 __rte_experimental
473 int rte_graph_feature_enable(rte_graph_feature_arc_t _arc, uint32_t index, const
474  char *feature_name, uint16_t app_cookie,
475  struct rte_rcu_qsbr *qsbr);
476 
500 __rte_experimental
502  const char *feature_name, struct rte_rcu_qsbr *qsbr);
503 
519 __rte_experimental
521  rte_graph_feature_t *feature);
522 
534 __rte_experimental
536 
544 __rte_experimental
546 
556 __rte_experimental
558 
569 __rte_experimental
571 
582 __rte_experimental
584  rte_graph_feature_t feature);
585 
599 __rte_experimental
600 int
602  rte_graph_feature_t feature,
603  rte_node_t *node);
604 
616 __rte_experimental
617 uint32_t
619 
632 __rte_experimental
633 void __rte_graph_feature_arc_register(struct rte_graph_feature_arc_register *reg,
634  const char *caller_name, int lineno);
635 
648 __rte_experimental
649 void __rte_graph_feature_register(struct rte_graph_feature_register *reg,
650  const char *caller_name, int lineno);
651 
652 #ifdef __cplusplus
653 }
654 #endif
655 
656 #endif
uint16_t(* rte_node_process_t)(struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs)
Definition: rte_graph.h:95
uint32_t rte_node_t
Definition: rte_graph.h:42
__rte_experimental int rte_graph_feature_lookup(rte_graph_feature_arc_t arc, const char *feature_name, rte_graph_feature_t *feature)
__rte_experimental int rte_graph_feature_add(struct rte_graph_feature_register *feat_reg)
__rte_experimental uint32_t rte_graph_feature_arc_names_get(char *arc_names[])
__rte_experimental int rte_graph_feature_disable(rte_graph_feature_arc_t _arc, uint32_t index, const char *feature_name, struct rte_rcu_qsbr *qsbr)
uint32_t rte_graph_feature_data_t
uint16_t(* rte_graph_feature_override_index_cb_t)(void)
__rte_experimental int rte_graph_feature_arc_create(struct rte_graph_feature_arc_register *reg, rte_graph_feature_arc_t *_arc)
__rte_experimental int rte_graph_feature_arc_cleanup(void)
__rte_experimental uint32_t rte_graph_feature_arc_num_features(rte_graph_feature_arc_t _arc)
__rte_experimental int rte_graph_feature_enable(rte_graph_feature_arc_t _arc, uint32_t index, const char *feature_name, uint16_t app_cookie, struct rte_rcu_qsbr *qsbr)
uint16_t rte_graph_feature_arc_t
__rte_experimental int rte_graph_feature_arc_feature_to_node(rte_graph_feature_arc_t _arc, rte_graph_feature_t feature, rte_node_t *node)
__rte_experimental int rte_graph_feature_arc_destroy(rte_graph_feature_arc_t _arc)
uint8_t rte_graph_feature_t
void(* rte_graph_feature_change_notifier_cb_t)(const char *arc_name, const char *feature_name, rte_node_t feature_node_id, uint32_t index, bool enable_disable, uint16_t app_cookie)
__rte_experimental int rte_graph_feature_arc_init(uint16_t num_feature_arcs)
__rte_experimental uint32_t rte_graph_feature_arc_num_enabled_features(rte_graph_feature_arc_t _arc)
__rte_experimental int rte_graph_feature_arc_lookup_by_name(const char *arc_name, rte_graph_feature_arc_t *_arc)
__rte_experimental char * rte_graph_feature_arc_feature_to_name(rte_graph_feature_arc_t _arc, rte_graph_feature_t feature)
struct rte_node_register * start_node
rte_node_process_t start_node_feature_process_fn
struct rte_graph_feature_register * end_feature
struct rte_node_register * feature_node
rte_graph_feature_change_notifier_cb_t notifier_cb
rte_node_process_t feature_process_fn
STAILQ_ENTRY(rte_graph_feature_register) next_feature
rte_graph_feature_override_index_cb_t override_index_cb