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 70A34A04A5; Mon, 27 Dec 2021 17:18:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8417C411DD; Mon, 27 Dec 2021 17:17:11 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 6DA92410FC for ; Mon, 27 Dec 2021 17:16:54 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4F94C1A0204; Mon, 27 Dec 2021 17:16:54 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 197B81A1539; Mon, 27 Dec 2021 17:16:54 +0100 (CET) Received: from lsv03274.swis.in-blr01.nxp.com (lsv03274.swis.in-blr01.nxp.com [92.120.147.114]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 78C31183AD07; Tue, 28 Dec 2021 00:16:53 +0800 (+08) From: nipun.gupta@nxp.com To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, Gagandeep Singh Subject: [PATCH v2 15/16] net/pfe: reduce driver initialization time Date: Mon, 27 Dec 2021 21:46:44 +0530 Message-Id: <20211227161645.24359-16-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211227161645.24359-1-nipun.gupta@nxp.com> References: <20211206121824.3493-1-nipun.gupta@nxp.com> <20211227161645.24359-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Gagandeep Singh This patch reduces the delay in the device init. Signed-off-by: Gagandeep Singh --- drivers/net/pfe/pfe_hif.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/pfe/pfe_hif.c b/drivers/net/pfe/pfe_hif.c index c4a7154ba7..eade726b2e 100644 --- a/drivers/net/pfe/pfe_hif.c +++ b/drivers/net/pfe/pfe_hif.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2019 NXP + * Copyright 2018-2020 NXP */ #include "pfe_logs.h" @@ -9,6 +9,8 @@ #include #include +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define msleep(x) rte_delay_us(1000 * (x)) static int pfe_hif_alloc_descr(struct pfe_hif *hif) { @@ -766,7 +768,7 @@ pfe_hif_rx_idle(struct pfe_hif *hif) if (rx_status & BDP_CSR_RX_DMA_ACTV) send_dummy_pkt_to_hif(); - sleep(1); + msleep(DIV_ROUND_UP(100, 1000)); } while (--hif_stop_loop); if (readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV) -- 2.17.1