DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Abdullah Sevincer <abdullah.sevincer@intel.com>
Subject: [PATCH] event/dlb2: remove unnecessary timer call
Date: Wed, 13 Dec 2023 11:48:22 +0000	[thread overview]
Message-ID: <20231213114822.12440-1-bruce.richardson@intel.com> (raw)

We only need to consult the timer value when the driver waits for a
timeout, so skip making the call to get the current timer/TSC value if
the timeout is zero, as no wait will ever be done.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/event/dlb2/dlb2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 050ace0904..f395ef0cb7 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -3966,7 +3966,8 @@ dlb2_hw_dequeue_sparse(struct dlb2_eventdev *dlb2,
 	else
 		timeout = dlb2->global_dequeue_wait_ticks;
 
-	start_ticks = rte_get_timer_cycles();
+	if (timeout != 0)
+		start_ticks = rte_get_timer_cycles();
 
 	use_scalar = use_scalar || (max_num & 0x3);
 
@@ -4114,7 +4115,8 @@ dlb2_hw_dequeue(struct dlb2_eventdev *dlb2,
 	else
 		timeout = dlb2->global_dequeue_wait_ticks;
 
-	start_ticks = rte_get_timer_cycles();
+	if (timeout != 0)
+		start_ticks = rte_get_timer_cycles();
 
 	while (num < max_num) {
 		struct dlb2_dequeue_qe qes[DLB2_NUM_QES_PER_CACHE_LINE];
-- 
2.40.1


             reply	other threads:[~2023-12-13 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 11:48 Bruce Richardson [this message]
2023-12-13 15:22 ` Sevincer, Abdullah
2023-12-14  6:58   ` Jerin Jacob
2023-12-13 15:41 ` Aaron Conole
2023-12-13 16:50 ` Aaron Conole
2023-12-13 17:10   ` Bruce Richardson
2023-12-13 21:31     ` Aaron Conole

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=20231213114822.12440-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    /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).