Thread (68 messages) flat view 68 messages, 6 authors, 2022-02-01
STALE1645d

Revision v2 of 3 in this series.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]

[PATCH v2 15/16] net/pfe: reduce driver initialization time

From: <hidden>
Date: 2021-12-27 16:18:16
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Gagandeep Singh <redacted>

This patch reduces the delay in the device init.

Signed-off-by: Gagandeep Singh <redacted>
---
 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 <sys/eventfd.h>
 #include <arpa/inet.h>
 
+#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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help