DPDK  24.03.0
rte_graph_model_rtc.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  * Copyright(C) 2023 Intel Corporation
4  */
5 
7 
17 static inline void
18 rte_graph_walk_rtc(struct rte_graph *graph)
19 {
20  const rte_graph_off_t *cir_start = graph->cir_start;
21  const rte_node_t mask = graph->cir_mask;
22  uint32_t head = graph->head;
23  struct rte_node *node;
24 
25  /*
26  * Walk on the source node(s) ((cir_start - head) -> cir_start) and then
27  * on the pending streams (cir_start -> (cir_start + mask) -> cir_start)
28  * in a circular buffer fashion.
29  *
30  * +-----+ <= cir_start - head [number of source nodes]
31  * | |
32  * | ... | <= source nodes
33  * | |
34  * +-----+ <= cir_start [head = 0] [tail = 0]
35  * | |
36  * | ... | <= pending streams
37  * | |
38  * +-----+ <= cir_start + mask
39  */
40  while (likely(head != graph->tail)) {
41  node = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]);
42  __rte_node_process(graph, node);
43  head = likely((int32_t)head > 0) ? head & mask : head;
44  }
45  graph->tail = 0;
46 }
uint32_t rte_node_t
Definition: rte_graph.h:40
#define likely(x)
#define RTE_PTR_ADD(ptr, x)
Definition: rte_common.h:395
uint32_t rte_graph_off_t
Definition: rte_graph.h:39