DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: Jerin Jacob <jerinj@marvell.com>
Cc: dev@dpdk.org, "Peter Nilsson J" <peter.j.nilsson@ericsson.com>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
Subject: [PATCH 2/2] event/dsw: replace burst with bulk enqueue
Date: Mon, 3 Apr 2023 15:13:46 +0200	[thread overview]
Message-ID: <20230403131346.1070133-2-mattias.ronnblom@ericsson.com> (raw)
In-Reply-To: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com>

An enqueue operation to a DSW port's input ring is guaranteed to
succeed, an thus a bulk type enqueue (instead of a burst enqueue) may
be used. There is also need not check the return code of such calls.

This change shaves off a handful of CPU cycles worth of latency per
enqueued event.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 drivers/event/dsw/dsw_event.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c
index 9932caf2ee..90d298a255 100644
--- a/drivers/event/dsw/dsw_event.c
+++ b/drivers/event/dsw/dsw_event.c
@@ -590,7 +590,6 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port,
 	struct dsw_port *dest_port = &(dsw->ports[dest_port_id]);
 	uint16_t *buffer_len = &source_port->out_buffer_len[dest_port_id];
 	struct rte_event *buffer = source_port->out_buffer[dest_port_id];
-	uint16_t enqueued = 0;
 
 	if (*buffer_len == 0)
 		return;
@@ -598,13 +597,8 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port,
 	/* The rings are dimensioned to fit all in-flight events (even
 	 * on a single ring), so looping will work.
 	 */
-	do {
-		enqueued +=
-			rte_event_ring_enqueue_burst(dest_port->in_ring,
-						     buffer+enqueued,
-						     *buffer_len-enqueued,
-						     NULL);
-	} while (unlikely(enqueued != *buffer_len));
+	rte_event_ring_enqueue_bulk(dest_port->in_ring, buffer, *buffer_len,
+				    NULL);
 
 	(*buffer_len) = 0;
 }
-- 
2.34.1


  reply	other threads:[~2023-04-03 13:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 13:13 [PATCH 1/2] eventdev: add bulk type event ring operations Mattias Rönnblom
2023-04-03 13:13 ` Mattias Rönnblom [this message]
2023-04-04  7:03 ` Jerin Jacob
2023-05-02 10:32   ` Jerin Jacob

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=20230403131346.1070133-2-mattias.ronnblom@ericsson.com \
    --to=mattias.ronnblom@ericsson.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=peter.j.nilsson@ericsson.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).