DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCH v2 3/5] event/dpaa2: enchance timeout handling
Date: Fri, 21 Sep 2018 17:16:04 +0530	[thread overview]
Message-ID: <1537530366-4722-3-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com>

This patch enahances:
1. configure the dequeue time out value as per the given
   method or per dequeue, global or default.
2. The timeout values were being mixed as ns or ms timeouts.
    now the values are stored as ns and scale is in ms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
v2: added description

 drivers/event/dpaa2/dpaa2_eventdev.c | 19 ++++++++++++++++---
 drivers/event/dpaa2/dpaa2_eventdev.h |  1 +
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index c4064a4..4b56e2e 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -284,7 +284,7 @@ dpaa2_eventdev_info_get(struct rte_eventdev *dev,
 	dev_info->max_dequeue_timeout_ns =
 		DPAA2_EVENT_MAX_DEQUEUE_TIMEOUT;
 	dev_info->dequeue_timeout_ns =
-		DPAA2_EVENT_MIN_DEQUEUE_TIMEOUT;
+		DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS;
 	dev_info->max_event_queues = priv->max_event_queues;
 	dev_info->max_event_queue_flows =
 		DPAA2_EVENT_MAX_QUEUE_FLOWS;
@@ -314,7 +314,6 @@ dpaa2_eventdev_configure(const struct rte_eventdev *dev)
 
 	EVENTDEV_INIT_FUNC_TRACE();
 
-	priv->dequeue_timeout_ns = conf->dequeue_timeout_ns;
 	priv->nb_event_queues = conf->nb_event_queues;
 	priv->nb_event_ports = conf->nb_event_ports;
 	priv->nb_event_queue_flows = conf->nb_event_queue_flows;
@@ -322,6 +321,20 @@ dpaa2_eventdev_configure(const struct rte_eventdev *dev)
 	priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth;
 	priv->event_dev_cfg = conf->event_dev_cfg;
 
+	/* Check dequeue timeout method is per dequeue or global */
+	if (priv->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) {
+		/*
+		 * Use timeout value as given in dequeue operation.
+		 * So invalidating this timeout value.
+		 */
+		priv->dequeue_timeout_ns = 0;
+
+	} else if (conf->dequeue_timeout_ns == 0) {
+		priv->dequeue_timeout_ns = DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS;
+	} else {
+		priv->dequeue_timeout_ns = conf->dequeue_timeout_ns;
+	}
+
 	DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d",
 			     dev->data->dev_id);
 	return 0;
@@ -516,7 +529,7 @@ static int
 dpaa2_eventdev_timeout_ticks(struct rte_eventdev *dev, uint64_t ns,
 			     uint64_t *timeout_ticks)
 {
-	uint32_t scale = 1;
+	uint32_t scale = 1000*1000;
 
 	EVENTDEV_INIT_FUNC_TRACE();
 
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h
index d2f98c6..8898024 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.h
+++ b/drivers/event/dpaa2/dpaa2_eventdev.h
@@ -21,6 +21,7 @@
 #define DPAA2_EVENT_MAX_QUEUES			16
 #define DPAA2_EVENT_MIN_DEQUEUE_TIMEOUT		1
 #define DPAA2_EVENT_MAX_DEQUEUE_TIMEOUT		(UINT32_MAX - 1)
+#define DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS	100UL
 #define DPAA2_EVENT_MAX_QUEUE_FLOWS		2048
 #define DPAA2_EVENT_MAX_QUEUE_PRIORITY_LEVELS	8
 #define DPAA2_EVENT_MAX_EVENT_PRIORITY_LEVELS	0
-- 
2.7.4

  parent reply	other threads:[~2018-09-21 11:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  6:03 [dpdk-dev] [PATCH 1/5] event/dpaa2: fix mbuf assignment in atomic processing Hemant Agrawal
2018-08-30  6:03 ` [dpdk-dev] [PATCH 2/5] event/dpaa2: rename evq info to dpaa2 eventq Hemant Agrawal
2018-08-30  6:03 ` [dpdk-dev] [PATCH 3/5] event/dpaa2: enchance timeout handling Hemant Agrawal
2018-09-10 13:37   ` Jerin Jacob
2018-08-30  6:03 ` [dpdk-dev] [PATCH 4/5] event/dpaa2: support Max event port value Hemant Agrawal
2018-08-30  6:03 ` [dpdk-dev] [PATCH 5/5] event/dpaa2: affining portal at runtime during I/O Hemant Agrawal
2018-09-21 11:46 ` [dpdk-dev] [PATCH v2 1/5] event/dpaa2: fix mbuf assignment in atomic processing Hemant Agrawal
2018-09-21 11:46   ` [dpdk-dev] [PATCH v2 2/5] event/dpaa2: rename evq info to dpaa2 eventq Hemant Agrawal
2018-09-21 11:46   ` Hemant Agrawal [this message]
2018-09-21 11:46   ` [dpdk-dev] [PATCH v2 4/5] event/dpaa2: support Max event port value Hemant Agrawal
2018-09-21 11:46   ` [dpdk-dev] [PATCH v2 5/5] event/dpaa2: affining portal at runtime during I/O Hemant Agrawal
2018-09-23  7:52   ` [dpdk-dev] [PATCH v2 1/5] event/dpaa2: fix mbuf assignment in atomic processing 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=1537530366-4722-3-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.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).