DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_graph_model_mcore_dispatch.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(C) 2023 Intel Corporation
3
*/
4
5
#ifndef _RTE_GRAPH_MODEL_MCORE_DISPATCH_H_
6
#define _RTE_GRAPH_MODEL_MCORE_DISPATCH_H_
7
14
15
#include <
rte_errno.h
>
16
#include <
rte_mempool.h
>
17
#include <
rte_memzone.h
>
18
#include <
rte_ring.h
>
19
20
#include "
rte_graph_worker_common.h
"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
#define RTE_GRAPH_SCHED_WQ_SIZE_MULTIPLIER 8
27
#define RTE_GRAPH_SCHED_WQ_SIZE(nb_nodes) \
28
((typeof(nb_nodes))((nb_nodes) * RTE_GRAPH_SCHED_WQ_SIZE_MULTIPLIER))
29
47
bool
__rte_noinline
__rte_graph_mcore_dispatch_sched_node_enqueue(
struct
rte_node *node,
48
struct
rte_graph_rq_head *rq);
49
62
void
__rte_graph_mcore_dispatch_sched_wq_process(
struct
rte_graph *graph);
63
76
int
rte_graph_model_mcore_dispatch_node_lcore_affinity_set
(
const
char
*name,
77
unsigned
int
lcore_id);
78
88
static
inline
void
89
rte_graph_walk_mcore_dispatch
(
struct
rte_graph *graph)
90
{
91
const
rte_graph_off_t
*cir_start = graph->cir_start;
92
const
rte_node_t
mask = graph->cir_mask;
93
uint32_t head = graph->head;
94
struct
rte_node *node;
95
96
if
(graph->dispatch.wq != NULL)
97
__rte_graph_mcore_dispatch_sched_wq_process(graph);
98
99
while
(
likely
(head != graph->tail)) {
100
node = (
struct
rte_node *)
RTE_PTR_ADD
(graph, cir_start[(int32_t)head++]);
101
102
/* skip the src nodes which not bind with current worker */
103
if
((int32_t)head < 1 && node->dispatch.lcore_id != graph->dispatch.lcore_id)
104
continue
;
105
106
/* Schedule the node until all task/objs are done */
107
if
(node->dispatch.lcore_id != RTE_MAX_LCORE &&
108
graph->dispatch.lcore_id != node->dispatch.lcore_id &&
109
graph->dispatch.rq != NULL &&
110
__rte_graph_mcore_dispatch_sched_node_enqueue(node, graph->dispatch.rq))
111
continue
;
112
113
__rte_node_process(graph, node);
114
115
head =
likely
((int32_t)head > 0) ? head & mask : head;
116
}
117
118
graph->tail = 0;
119
}
120
121
#ifdef __cplusplus
122
}
123
#endif
124
125
#endif
/* _RTE_GRAPH_MODEL_MCORE_DISPATCH_H_ */
likely
#define likely(x)
Definition
rte_branch_prediction.h:26
__rte_noinline
#define __rte_noinline
Definition
rte_common.h:499
RTE_PTR_ADD
#define RTE_PTR_ADD(ptr, x)
Definition
rte_common.h:554
rte_errno.h
rte_node_t
uint32_t rte_node_t
Definition
rte_graph.h:42
rte_graph_off_t
uint32_t rte_graph_off_t
Definition
rte_graph.h:41
rte_graph_model_mcore_dispatch_node_lcore_affinity_set
int rte_graph_model_mcore_dispatch_node_lcore_affinity_set(const char *name, unsigned int lcore_id)
rte_graph_walk_mcore_dispatch
static void rte_graph_walk_mcore_dispatch(struct rte_graph *graph)
Definition
rte_graph_model_mcore_dispatch.h:89
rte_graph_worker_common.h
rte_mempool.h
rte_memzone.h
rte_ring.h
lib
graph
rte_graph_model_mcore_dispatch.h
Generated by
1.17.0