[dpdk-dev,4/4] event/dpaa: fix portal allocation

Message ID 1517808117-28562-4-git-send-email-nipun.gupta@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nipun Gupta Feb. 5, 2018, 5:21 a.m. UTC
  Checking if portal has been allocated is now required at the
caller of rte_dpaa_portal_init() API. This patch adds check
in the dpaa eventdev driver.

Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/event/dpaa/dpaa_eventdev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
  

Comments

Hemant Agrawal Feb. 5, 2018, 11:53 a.m. UTC | #1
On 2/5/2018 10:51 AM, Nipun Gupta wrote:
> Checking if portal has been allocated is now required at the
> caller of rte_dpaa_portal_init() API. This patch adds check
> in the dpaa eventdev driver.
> 
> Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
> 
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
> ---
>   drivers/event/dpaa/dpaa_eventdev.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
<snip..>
  

Patch

diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index 7360fad..0006801 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -112,11 +112,13 @@ 
 	struct dpaa_port *portal = (struct dpaa_port *)port;
 	struct rte_mbuf *mbuf;
 
-	/* Affine current thread context to a qman portal */
-	ret = rte_dpaa_portal_init((void *)0);
-	if (ret) {
-		DPAA_EVENTDEV_ERR("Unable to initialize portal");
-		return ret;
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		/* Affine current thread context to a qman portal */
+		ret = rte_dpaa_portal_init((void *)0);
+		if (ret) {
+			DPAA_EVENTDEV_ERR("Unable to initialize portal");
+			return ret;
+		}
 	}
 
 	if (unlikely(!portal->is_port_linked)) {