DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com,
	hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com,
	narender.vangati@intel.com, nikhil.rao@intel.com,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH] eventdev: add producer enqueue hint
Date: Mon, 12 Jun 2017 17:16:27 +0530	[thread overview]
Message-ID: <20170612114627.18893-1-jerin.jacob@caviumnetworks.com> (raw)

Some PMD like OCTEONTX can have optimized handling of
events if the PMD knows it is a producer pattern in advance.
For instance, OCTEONTX PMD can support burst mode if
op == RTE_EVENT_OP_NEW.

Since the event producer initialize(set all_op_new == 1) the event
object before the main producer loop, This scheme does not call for
any performance regression on other PMDs.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
Another option is to add a flag in enqueue API or have parallel enqueue API.
---
 drivers/event/octeontx/ssovf_worker.c | 12 ++++++++++--
 lib/librte_eventdev/rte_eventdev.h    | 10 +++++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c
index ad3fe684d..209c595cf 100644
--- a/drivers/event/octeontx/ssovf_worker.c
+++ b/drivers/event/octeontx/ssovf_worker.c
@@ -196,8 +196,16 @@ ssows_enq(void *port, const struct rte_event *ev)
 uint16_t __hot
 ssows_enq_burst(void *port, const struct rte_event ev[], uint16_t nb_events)
 {
-	RTE_SET_USED(nb_events);
-	return ssows_enq(port, ev);
+	uint16_t i;
+	struct ssows *ws = port;
+
+	if (ev[0].all_op_new) {
+		rte_smp_wmb();
+		for (i = 0; i < nb_events; i++)
+			ssows_new_event(ws, &ev[i]);
+		return i;
+	} else
+		return ssows_enq(port, ev);
 }
 
 void
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index a248fe90e..1c1a46593 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -933,7 +933,15 @@ struct rte_event {
 			 * and is undefined on dequeue.
 			 * @see RTE_EVENT_OP_NEW, (RTE_EVENT_OP_*)
 			 */
-			uint8_t rsvd:4;
+			uint8_t all_op_new:1;
+			/**< Valid only with event enqueue operation - This hint
+			 * indicates that the enqueue request has only the
+			 * events with op == RTE_EVENT_OP_NEW.
+			 * The event producer, typically use this pattern to
+			 * inject the events to eventdev.
+			 * @see RTE_EVENT_OP_NEW rte_event_enqueue_burst()
+			 */
+			uint8_t rsvd:3;
 			/**< Reserved for future use */
 			uint8_t sched_type:2;
 			/**< Scheduler synchronization type (RTE_SCHED_TYPE_*)
-- 
2.13.1

             reply	other threads:[~2017-06-12 11:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 11:46 Jerin Jacob [this message]
2017-06-26 15:44 ` Eads, Gage
2017-06-27  8:08   ` Jerin Jacob
2017-06-27  8:44     ` Van Haaren, Harry
2017-06-27 10:17       ` 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=20170612114627.18893-1-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gage.eads@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=narender.vangati@intel.com \
    --cc=nikhil.rao@intel.com \
    --cc=nipun.gupta@nxp.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).