public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Robin Jarry <rjarry@redhat.com>
To: dev@dpdk.org, Jerin Jacob <jerinj@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Zhirun Yan <yanzhirun_163@163.com>
Subject: [RFC PATCH dpdk 1/3] graph: optimize rte_node_enqueue_next to batch by edge
Date: Thu,  5 Feb 2026 10:26:34 +0100	[thread overview]
Message-ID: <20260205092630.100488-8-rjarry@redhat.com> (raw)
In-Reply-To: <20260205092630.100488-6-rjarry@redhat.com>

Replace the per-object rte_node_enqueue_x1() calls with batched
rte_node_enqueue() calls. The function now tracks runs of consecutive
objects going to the same edge and flushes them in bulk.

When all objects go to the same edge and come from the node's own
buffer (objs == node->objs), use rte_node_next_stream_move() which
swaps pointers instead of copying.

Signed-off-by: Robin Jarry <rjarry@redhat.com>
---
 lib/graph/rte_graph_worker_common.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h
index 4ab53a533e4c..7fda67c07169 100644
--- a/lib/graph/rte_graph_worker_common.h
+++ b/lib/graph/rte_graph_worker_common.h
@@ -432,10 +432,21 @@ static inline void
 rte_node_enqueue_next(struct rte_graph *graph, struct rte_node *node,
 		      rte_edge_t *nexts, void **objs, uint16_t nb_objs)
 {
+	rte_edge_t last = nexts[0];
+	uint16_t run_start = 0;
 	uint16_t i;
 
-	for (i = 0; i < nb_objs; i++)
-		rte_node_enqueue_x1(graph, node, nexts[i], objs[i]);
+	for (i = 1; i < nb_objs; i++) {
+		if (nexts[i] != last) {
+			rte_node_enqueue(graph, node, last, &objs[run_start], i - run_start);
+			run_start = i;
+			last = nexts[i];
+		}
+	}
+	if (run_start == 0 && objs == node->objs)
+		rte_node_next_stream_move(graph, node, last);
+	else
+		rte_node_enqueue(graph, node, last, &objs[run_start], nb_objs - run_start);
 }
 
 /**
-- 
2.52.0


  reply	other threads:[~2026-02-05  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  9:26 [RFC PATCH dpdk 0/3] graph: deferred enqueue API for simplified node processing Robin Jarry
2026-02-05  9:26 ` Robin Jarry [this message]
2026-03-10  5:46   ` [EXTERNAL] [RFC PATCH dpdk 1/3] graph: optimize rte_node_enqueue_next to batch by edge Pavan Nikhilesh Bhagavatula
2026-02-05  9:26 ` [RFC PATCH dpdk 2/3] graph: add deferred enqueue API for batch processing Robin Jarry
2026-03-10  5:49   ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2026-02-05  9:26 ` [RFC PATCH dpdk 3/3] node: use deferred enqueue API in process functions Robin Jarry
2026-03-10  5:31 ` [EXTERNAL] [RFC PATCH dpdk 0/3] graph: deferred enqueue API for simplified node processing Pavan Nikhilesh Bhagavatula
2026-03-31  3:10 ` Stephen Hemminger

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=20260205092630.100488-8-rjarry@redhat.com \
    --to=rjarry@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