diff mbox series

[01/15] bus/dpaa: use non-block mode for FD open

Message ID 20220928052516.1279442-2-g.singh@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series DPAA and DPAA2 driver changes | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gagandeep Singh Sept. 28, 2022, 5:25 a.m. UTC
From: Vanshika Shukla <vanshika.shukla@nxp.com>

This patch sets qman portal file descriptors used for
interrupts IO processing in non-blocking mode to avoid
any unwanted blocks while IO operations over the FD.

Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 drivers/bus/dpaa/base/qbman/qman_driver.c | 6 +++---
 drivers/net/dpaa/dpaa_ethdev.c            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index dfbafe581a..7a129a2d86 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -1,7 +1,7 @@ 
 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
  *
  * Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2017,2019 NXP
+ * Copyright 2017-2022 NXP
  *
  */
 
@@ -64,7 +64,7 @@  static int fsl_qman_portal_init(uint32_t index, int is_shared)
 	qpcfg.addr_virt[DPAA_PORTAL_CE] = map.addr.cena;
 	qpcfg.addr_virt[DPAA_PORTAL_CI] = map.addr.cinh;
 
-	qmfd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY);
+	qmfd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY | O_NONBLOCK);
 	if (qmfd == -1) {
 		pr_err("QMan irq init failed\n");
 		process_portal_unmap(&map.addr);
@@ -174,7 +174,7 @@  struct qman_portal *fsl_qman_fq_portal_create(int *fd)
 	q_pcfg->addr_virt[DPAA_PORTAL_CE] = q_map.addr.cena;
 	q_pcfg->addr_virt[DPAA_PORTAL_CI] = q_map.addr.cinh;
 
-	q_fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY);
+	q_fd = open(QMAN_PORTAL_IRQ_PATH, O_RDONLY | O_NONBLOCK);
 	if (q_fd == -1) {
 		pr_err("QMan irq init failed\n");
 		goto err;
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index f21cbba0d9..abcb1bc9ec 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -1496,7 +1496,7 @@  static int dpaa_dev_queue_intr_disable(struct rte_eth_dev *dev,
 
 	temp1 = read(rxq->q_fd, &temp, sizeof(temp));
 	if (temp1 != sizeof(temp))
-		DPAA_PMD_ERR("irq read error");
+		DPAA_PMD_DEBUG("read did not return anything");
 
 	qman_fq_portal_thread_irq(rxq->qp);