DPDK patches and discussions
 help / color / mirror / Atom feed
From: Timothy McDaniel <timothy.mcdaniel@intel.com>
Cc: dev@dpdk.org, erik.g.carrillo@intel.com,
	harry.van.haaren@intel.com, jerinj@marvell.com,
	thomas@monjalon.net, david.marchand@redhat.com,
	timothy.mcdaniel@intel.com
Subject: [dpdk-dev] [PATCH v2] event/dlb2: make scalar mode dequeue the default
Date: Thu, 20 May 2021 13:08:02 -0500	[thread overview]
Message-ID: <1621534082-8996-1-git-send-email-timothy.mcdaniel@intel.com> (raw)
In-Reply-To: <1620843888-882873-1-git-send-email-timothy.mcdaniel@intel.com>

Optimized dequeue using x86 vector instructions was added
in 21.05, but due to limited testing the default has been
changed back to the scalar mode implementation. The vector mode
implementation can be enabled via the devargs option
"vector_opts_enabled=<y/Y>".

Fixes: 000a7b8e7582 ("event/dlb2: optimize dequeue operation")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>

---
Cc: timothy.mcdaniel@intel.com
---
 doc/guides/eventdevs/dlb2.rst  | 13 +++++++++++++
 drivers/event/dlb2/dlb2.c      | 24 ++++++++++++------------
 drivers/event/dlb2/dlb2_priv.h |  6 +++---
 3 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/doc/guides/eventdevs/dlb2.rst b/doc/guides/eventdevs/dlb2.rst
index c60c454d6..acdb00587 100644
--- a/doc/guides/eventdevs/dlb2.rst
+++ b/doc/guides/eventdevs/dlb2.rst
@@ -367,3 +367,16 @@ Class of service can be specified in the devargs, as follows
     .. code-block:: console
 
        --vdev=dlb2_event,cos=<0..4>
+
+Use X86 Vector Instructions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+DLB supports using x86 vector instructions to optimize the data path.
+
+The default mode of operation is to use scalar instructions, but
+the use of vector instructions can be enabled in the devargs, as
+follows
+
+    .. code-block:: console
+
+      --allow ea:00.0,vector_opts_enabled=<y/Y>
diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 588c41ee7..0022f65fc 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -376,11 +376,11 @@ set_default_depth_thresh(const char *key __rte_unused,
 }
 
 static int
-set_vector_opts_disab(const char *key __rte_unused,
+set_vector_opts_enab(const char *key __rte_unused,
 	const char *value,
 	void *opaque)
 {
-	bool *dlb2_vector_opts_disabled = opaque;
+	bool *dlb2_vector_opts_enabled = opaque;
 
 	if (value == NULL || opaque == NULL) {
 		DLB2_LOG_ERR("NULL pointer\n");
@@ -388,9 +388,9 @@ set_vector_opts_disab(const char *key __rte_unused,
 	}
 
 	if ((*value == 'y') || (*value == 'Y'))
-		*dlb2_vector_opts_disabled = true;
+		*dlb2_vector_opts_enabled = true;
 	else
-		*dlb2_vector_opts_disabled = false;
+		*dlb2_vector_opts_enabled = false;
 
 	return 0;
 }
@@ -1469,7 +1469,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
 #else
 	if ((qm_port->cq_depth > 64) ||
 	    (!rte_is_power_of_2(qm_port->cq_depth)) ||
-	    (dlb2->vector_opts_disabled == true))
+	    (dlb2->vector_opts_enabled == false))
 		qm_port->use_scalar = true;
 #endif
 
@@ -1665,7 +1665,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
 #else
 	if ((qm_port->cq_depth > 64) ||
 	    (!rte_is_power_of_2(qm_port->cq_depth)) ||
-	    (dlb2->vector_opts_disabled == true))
+	    (dlb2->vector_opts_enabled == false))
 		qm_port->use_scalar = true;
 #endif
 
@@ -4434,7 +4434,7 @@ dlb2_primary_eventdev_probe(struct rte_eventdev *dev,
 	dlb2->poll_interval = dlb2_args->poll_interval;
 	dlb2->sw_credit_quanta = dlb2_args->sw_credit_quanta;
 	dlb2->default_depth_thresh = dlb2_args->default_depth_thresh;
-	dlb2->vector_opts_disabled = dlb2_args->vector_opts_disabled;
+	dlb2->vector_opts_enabled = dlb2_args->vector_opts_enabled;
 
 	err = dlb2_iface_open(&dlb2->qm_instance, name);
 	if (err < 0) {
@@ -4538,7 +4538,7 @@ dlb2_parse_params(const char *params,
 					     DLB2_POLL_INTERVAL_ARG,
 					     DLB2_SW_CREDIT_QUANTA_ARG,
 					     DLB2_DEPTH_THRESH_ARG,
-					     DLB2_VECTOR_OPTS_DISAB_ARG,
+					     DLB2_VECTOR_OPTS_ENAB_ARG,
 					     NULL };
 
 	if (params != NULL && params[0] != '\0') {
@@ -4653,11 +4653,11 @@ dlb2_parse_params(const char *params,
 			}
 
 			ret = rte_kvargs_process(kvlist,
-					DLB2_VECTOR_OPTS_DISAB_ARG,
-					set_vector_opts_disab,
-					&dlb2_args->vector_opts_disabled);
+					DLB2_VECTOR_OPTS_ENAB_ARG,
+					set_vector_opts_enab,
+					&dlb2_args->vector_opts_enabled);
 			if (ret != 0) {
-				DLB2_LOG_ERR("%s: Error parsing vector opts disabled",
+				DLB2_LOG_ERR("%s: Error parsing vector opts enabled",
 					     name);
 				rte_kvargs_free(kvlist);
 				return ret;
diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h
index b1225af37..bb87072da 100644
--- a/drivers/event/dlb2/dlb2_priv.h
+++ b/drivers/event/dlb2/dlb2_priv.h
@@ -37,7 +37,7 @@
 #define DLB2_POLL_INTERVAL_ARG "poll_interval"
 #define DLB2_SW_CREDIT_QUANTA_ARG "sw_credit_quanta"
 #define DLB2_DEPTH_THRESH_ARG "default_depth_thresh"
-#define DLB2_VECTOR_OPTS_DISAB_ARG "vector_opts_disable"
+#define DLB2_VECTOR_OPTS_ENAB_ARG "vector_opts_enable"
 
 /* Begin HW related defines and structs */
 
@@ -565,7 +565,7 @@ struct dlb2_eventdev {
 	uint32_t new_event_limit;
 	int max_num_events_override;
 	int num_dir_credits_override;
-	bool vector_opts_disabled;
+	bool vector_opts_enabled;
 	volatile enum dlb2_run_state run_state;
 	uint16_t num_dir_queues; /* total num of evdev dir queues requested */
 	union {
@@ -623,7 +623,7 @@ struct dlb2_devargs {
 	int poll_interval;
 	int sw_credit_quanta;
 	int default_depth_thresh;
-	bool vector_opts_disabled;
+	bool vector_opts_enabled;
 };
 
 /* End Eventdev related defines and structs */
-- 
2.23.0


      parent reply	other threads:[~2021-05-20 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 18:24 [dpdk-dev] [PATCH 1/1] event/dlb2: fix vector based dequeue McDaniel, Timothy
2021-05-18 15:01 ` Jerin Jacob
2021-05-19  9:44   ` Thomas Monjalon
2021-05-19 15:23     ` McDaniel, Timothy
2021-05-20 16:11 ` [dpdk-dev] [PATCH] event/dlb2: fix extraction of HW scheduling type Timothy McDaniel
2021-05-20 16:12 ` [dpdk-dev] [PATCH] event/dlb2: make scalar mode dequeue the default Timothy McDaniel
2021-05-20 16:13 ` [dpdk-dev] [PATCH] event/dlb2: remove references to deferred scheduling Timothy McDaniel
2021-05-20 18:08 ` Timothy McDaniel [this message]

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=1621534082-8996-1-git-send-email-timothy.mcdaniel@intel.com \
    --to=timothy.mcdaniel@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=jerinj@marvell.com \
    --cc=thomas@monjalon.net \
    /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).