Skip to contentSkip to conversation

event/dlb2: remove unnecessary timer call

PATCH In review Bruce Richardson 4 participants 7 messages Dec 13, 2023 – Dec 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 event/dlb2: remove unnecessary timer call

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.

---
 drivers/event/dlb2/dlb2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/event/dlb2/dlb2.c +4 -2
index 050ace0904..f395ef0cb7 100644
@@ -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];
Signature · 1 line
2.40.1
Acked-by Abdullah Sevincer
#2 lore raw
Quoted 2 lines · Abdullah

Updated the git commit as follows and applied to
dpdk-next-net-eventdev/for-main. Thanks

event/dlb2: remove unnecessary timer call

Consult the timer value only 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.

#4 lore raw
In reply to Bruce Richardson
Quoted 6 lines · Bruce Richardson

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.

---

Had a bad config value - retrying again.

(Apologies to Bruce for the noise on this patch)

Recheck-request: github-robot

#5 lore raw
Quoted 6 lines · Aaron Conole
Quoted 4 lines · Bruce Richardson

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.

Quoted 7 lines
Quoted 2 lines

---

Had a bad config value - retrying again.

(Apologies to Bruce for the noise on this patch)

No problem!
We are going for the record for best-checked patch in DPDK history, right? :-)

#6 lore raw
Quoted 10 lines · Bruce Richardson
Quoted 9 lines · Aaron Conole
Quoted 6 lines · Bruce Richardson

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.

---

Quoted 6 lines
Quoted 4 lines

Had a bad config value - retrying again.

(Apologies to Bruce for the noise on this patch)

No problem!
We are going for the record for best-checked patch in DPDK history, right? :-)

Absolutely! If we're removing a call, best be safe.