DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] event/cnxk: arm early to account for software delays
@ 2022-12-13 15:10 Shijith Thotton
  2023-01-18 12:49 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Shijith Thotton @ 2022-12-13 15:10 UTC (permalink / raw)
  To: jerinj; +Cc: Shijith Thotton, dev, pbhagavatula

Arm a bucket early to account for software delays in timer arm routine.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 drivers/event/cnxk/cnxk_tim_worker.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/event/cnxk/cnxk_tim_worker.h b/drivers/event/cnxk/cnxk_tim_worker.h
index eda84c6f31..16909ef06d 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.h
+++ b/drivers/event/cnxk/cnxk_tim_worker.h
@@ -133,11 +133,13 @@ cnxk_tim_get_target_bucket(struct cnxk_tim_ring *const tim_ring,
 {
 	const uint64_t bkt_cyc =
 		tim_ring->tick_fn(tim_ring->tbase) - tim_ring->ring_start_cyc;
-	uint64_t bucket =
-		rte_reciprocal_divide_u64(bkt_cyc, &tim_ring->fast_div) +
-		rel_bkt;
+	uint64_t bucket = rte_reciprocal_divide_u64(bkt_cyc, &tim_ring->fast_div);
 	uint64_t mirr_bucket = 0;
 
+	if ((bkt_cyc - bucket * tim_ring->tck_int) < tim_ring->tck_int / 2)
+		bucket--;
+
+	bucket += rel_bkt;
 	bucket = cnxk_tim_bkt_fast_mod(bucket, tim_ring->nb_bkts,
 				       tim_ring->fast_bkt);
 	mirr_bucket =
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-18 12:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 15:10 [PATCH] event/cnxk: arm early to account for software delays Shijith Thotton
2023-01-18 12:49 ` Jerin Jacob

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