From: Christophe Fontaine <cfontain@redhat.com>
To: Jerin Jacob <jerinj@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Zhirun Yan <yanzhirun_163@163.com>
Cc: dev@dpdk.org, Christophe Fontaine <cfontain@redhat.com>
Subject: [PATCH 1/2] graph: allow non EAL Thread for pipeline mode
Date: Wed, 23 Jul 2025 18:50:00 +0200 [thread overview]
Message-ID: <20250723165001.11162-2-cfontain@redhat.com> (raw)
In-Reply-To: <20250723165001.11162-1-cfontain@redhat.com>
rte_graph_model_mcore_dispatch_core_bind relied on
rte_lcore_is_enabled.
Yet, "rte_lcore_is_enabled" only checks for EAL threads, which forbids
external threads (NON EAL) to run a part of the graph.
Verify if the lcore role is not "ROLE_OFF", and return relevant
error code otherwise.
Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
---
lib/graph/graph.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/graph/graph.c b/lib/graph/graph.c
index 0975bd8d49..146d0a12b4 100644
--- a/lib/graph/graph.c
+++ b/lib/graph/graph.c
@@ -340,17 +340,22 @@ rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore)
{
struct graph *graph;
- if (graph_from_id(id) == NULL)
+ if (graph_from_id(id) == NULL) {
+ rte_errno = ENOENT;
goto fail;
- if (!rte_lcore_is_enabled(lcore))
- SET_ERR_JMP(ENOLINK, fail, "lcore %d not enabled", lcore);
+ }
+
+ if (rte_lcore_has_role(lcore, ROLE_OFF))
+ SET_ERR_JMP(ENOLINK, fail, "lcore %d is invalid", lcore);
STAILQ_FOREACH(graph, &graph_list, next)
if (graph->id == id)
break;
- if (graph->graph->model != RTE_GRAPH_MODEL_MCORE_DISPATCH)
+ if (graph->graph->model != RTE_GRAPH_MODEL_MCORE_DISPATCH) {
+ rte_errno = EPERM;
goto fail;
+ }
graph->lcore_id = lcore;
graph->graph->dispatch.lcore_id = graph->lcore_id;
--
2.43.5
next prev parent reply other threads:[~2025-07-23 16:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 16:49 [PATCH 0/2] graph: dispatch mode improvements Christophe Fontaine
2025-07-23 16:50 ` Christophe Fontaine [this message]
2025-07-23 16:50 ` [PATCH 2/2] graph: add callback in dispatch mode Christophe Fontaine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250723165001.11162-2-cfontain@redhat.com \
--to=cfontain@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=yanzhirun_163@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).