From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nipun Gupta Subject: [PATCH 4/4] event/dpaa: fix portal allocation Date: Mon, 5 Feb 2018 10:51:57 +0530 Message-ID: <1517808117-28562-4-git-send-email-nipun.gupta@nxp.com> References: <1517808117-28562-1-git-send-email-nipun.gupta@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, santosh.shukla@caviumnetworks.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, sunil.kori@nxp.com, Nipun Gupta To: thomas@monjalon.net, jerin.jacob@caviumnetworks.com Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0087.outbound.protection.outlook.com [104.47.1.87]) by dpdk.org (Postfix) with ESMTP id 326F91B2DE for ; Mon, 5 Feb 2018 06:22:39 +0100 (CET) In-Reply-To: <1517808117-28562-1-git-send-email-nipun.gupta@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/event/dpaa/dpaa_eventdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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)) { -- 1.9.1