From: Shijith Thotton <sthotton@marvell.com>
To: <jerinj@marvell.com>
Cc: Shijith Thotton <sthotton@marvell.com>, <dev@dpdk.org>,
<pbhagavatula@marvell.com>
Subject: [PATCH] event/cnxk: arm early to account for software delays
Date: Tue, 13 Dec 2022 20:40:38 +0530 [thread overview]
Message-ID: <bd8a2f1697e86cd3eac0463fa7d0e26516a073bc.1670944154.git.sthotton@marvell.com> (raw)
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
next reply other threads:[~2022-12-13 15:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 15:10 Shijith Thotton [this message]
2023-01-18 12:49 ` 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=bd8a2f1697e86cd3eac0463fa7d0e26516a073bc.1670944154.git.sthotton@marvell.com \
--to=sthotton@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=pbhagavatula@marvell.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).