From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B894A0540; Tue, 13 Dec 2022 16:11:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05F9A40146; Tue, 13 Dec 2022 16:11:04 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D610A400D5 for ; Tue, 13 Dec 2022 16:11:02 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BDDeHhM016221 for ; Tue, 13 Dec 2022 07:11:01 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=lLow9Icv5UTxf55s6xCPpkU3FJviQluPslQJlkX9uUA=; b=L6IAp9Q2VGSHpLVd2pxs2+syRfXJgpeDd0Dr+zaHBRZvTtNIdwnLPyi3jG1V0m7hofrX xG7z1dB2mIOkoSbeu1XN8q/gqXrC/4CcudwCrEGTmOyJcEVmvUdUiq2T2sDGWqT7BUOT NpD4MnbSrcqtreZvkM9kYQDpq6VwSO9w4xwxLZIENAV6OhUnxMvk8pKmYs8Gvr+wONTC IqEZddTqOADJRPdJ3UGmgSOl0tvWj0dVZst6VoZQNTfoHEXIUJCIkPXYMEOp34AzpVYm O7SbhKC6o92mMjUFOrV7mpQY0d3Y7Q5iwLabwA0Rd9uzQn+QNPrbPxv9nQycBYR9Vc2b lQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mcrbvjteq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 13 Dec 2022 07:11:01 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 13 Dec 2022 07:10:59 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 13 Dec 2022 07:10:59 -0800 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id 5E86F3F707E; Tue, 13 Dec 2022 07:10:58 -0800 (PST) From: Shijith Thotton To: CC: Shijith Thotton , , Subject: [PATCH] event/cnxk: arm early to account for software delays Date: Tue, 13 Dec 2022 20:40:38 +0530 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: A4xQqkJeVeUoslI26zBEJeesrM6G3cFM X-Proofpoint-ORIG-GUID: A4xQqkJeVeUoslI26zBEJeesrM6G3cFM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-13_03,2022-12-13_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Arm a bucket early to account for software delays in timer arm routine. Signed-off-by: Shijith Thotton --- 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