event/dlb2: remove unnecessary timer call

Message ID 20231213114822.12440-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series event/dlb2: remove unnecessary timer call |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Bruce Richardson Dec. 13, 2023, 11:48 a.m. UTC
  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(-)
  

Comments

Sevincer, Abdullah Dec. 13, 2023, 3:22 p.m. UTC | #1
Acked-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
  
Aaron Conole Dec. 13, 2023, 3:41 p.m. UTC | #2
Bruce Richardson <bruce.richardson@intel.com> writes:

> 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>
> ---

Recheck-request: github-robot
  
Aaron Conole Dec. 13, 2023, 4:50 p.m. UTC | #3
Bruce Richardson <bruce.richardson@intel.com> writes:

> 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>
> ---

Had a bad config value - retrying again.

(Apologies to Bruce for the noise on this patch)

Recheck-request: github-robot
  
Bruce Richardson Dec. 13, 2023, 5:10 p.m. UTC | #4
On Wed, Dec 13, 2023 at 11:50:46AM -0500, Aaron Conole wrote:
> Bruce Richardson <bruce.richardson@intel.com> writes:
> 
> > 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>
> > ---
> 
> 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? :-)
  
Aaron Conole Dec. 13, 2023, 9:31 p.m. UTC | #5
Bruce Richardson <bruce.richardson@intel.com> writes:

> On Wed, Dec 13, 2023 at 11:50:46AM -0500, Aaron Conole wrote:
>> Bruce Richardson <bruce.richardson@intel.com> writes:
>> 
>> > 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>
>> > ---
>> 
>> 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.
  
Jerin Jacob Dec. 14, 2023, 6:58 a.m. UTC | #6
On Thu, Dec 14, 2023 at 10:28 AM Sevincer, Abdullah
<abdullah.sevincer@intel.com> wrote:
>
> Acked-by: Abdullah Sevincer <abdullah.sevincer@intel.com>

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.

    Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
    Acked-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
  

Patch

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];