From patchwork Tue Nov 5 14:23:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178525 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp846827ilf; Tue, 5 Nov 2019 06:40:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwTThRn5fCVR+q6se8sqXwkRLuVd97uBnJaEKDhGaktPY53VooPr+6j4XhaF3znO6E5ev5O X-Received: by 2002:aa7:dc1a:: with SMTP id b26mr36173988edu.139.1572964840816; Tue, 05 Nov 2019 06:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964840; cv=none; d=google.com; s=arc-20160816; b=B2BlGLNNUtwXoeZwGV+2BHBIZHHARHWxJYS40js0oOnUJKtbV7SsiRq8r+y+1FCsca hnKmCQO225/oA1PD2uB5ESrYmcGtsdFa4pBwsTv29CjEwHspZozIZxkSODOl8ND6d6Ph f/H78quy7Sp6OUIW5AQWo89Kh8Yvv8iC80+IGZu7Fi7E1kadAr+ePanXHAI3zMIeGPo/ PxRzbmGFlWRb3IgCfvsumEaVVw617uA/HALL6HqjmvWjzedfEmQ+pkhJyAiRrPY/9nS7 iYJ/j2TT1ZK9ikIWwlSO3VnYvFyiC3JP8sW9laAhRwe8NefqXBfTfhFpkpKbm9C3Lktv P6HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=wmsp8w60/5JvgZAc219fq+6BozgOBVMWoJWP1r/XA5M=; b=BsTFGw1MOJ6emv+fjrs0hFw2c1z6jLkl5+Nlglfs4N8J+OTwzYkWWvp6BYqLgZ/e6X LMslUELkZYR5PyumVfrDSxNM+qK44A9lyT/pcH1UAPGFmdoghVBk2bYZHlAGDov2YxkV iv4bgsOHVQGhb7iAGMPRKA0X7VzlzyCsMVxILcOgDQtoun7YyySHDPs9EXItvxp7ko43 v2yvMxMJNlxo55LJzMz6w3rPaWtKDXoSdRbEMRcStDkjwBjQIiFuxG/LaFzhCsKW+QEI tIjFcPPdXXZTMVLCo02L8gRAXD9SZF+LfVMq/YZdseTLMtWWZUQDqsEnVqRCGNF88QOS 7Jww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id c15si558303ejd.74.2019.11.05.06.40.40; Tue, 05 Nov 2019 06:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B57B1BF49; Tue, 5 Nov 2019 15:39:54 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 922491BF3E for ; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 30DC0200528; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 601D6200522; Tue, 5 Nov 2019 15:39:49 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 54A6B40318; Tue, 5 Nov 2019 22:39:44 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com Date: Tue, 5 Nov 2019 19:53:20 +0530 Message-Id: <20191105142321.7478-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v4] bus/dpaa: moving qbman global init to bus X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal DPAA SEC shall be able to work independent of DPAA ETH driver. This patch moves qbman init to bus, so that any driver can use them even when no eth resources are present or none of the eth devices are probed. Signed-off-by: Hemant Agrawal Acked-by: Akhil Goyal --- drivers/bus/dpaa/dpaa_bus.c | 21 +++++++++++++++++++-- drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 -- drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 14 -------------- 4 files changed, 27 insertions(+), 18 deletions(-) -- 2.17.1 diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index d028ef3be..f27820db3 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -561,8 +561,24 @@ rte_dpaa_bus_probe(void) return 0; /* Device list creation is only done once */ - if (!process_once) + if (!process_once) { rte_dpaa_bus_dev_build(); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* One time load of Qman/Bman drivers */ + ret = qman_global_init(); + if (ret) { + DPAA_PMD_ERR("QMAN initialization failed: %d", + ret); + return ret; + } + ret = bman_global_init(); + if (ret) { + DPAA_PMD_ERR("BMAN initialization failed: %d", + ret); + return ret; + } + } + } process_once = 1; /* If no device present on DPAA bus nothing needs to be done */ @@ -600,7 +616,8 @@ rte_dpaa_bus_probe(void) RTE_DEV_WHITELISTED)) { ret = drv->probe(drv, dev); if (ret) { - DPAA_BUS_ERR("Unable to probe.\n"); + DPAA_BUS_ERR("unable to probe:%s", + dev->name); } else { dev->driver = drv; dev->device.driver = &drv->driver; diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 97f4f622d..cf428a54d 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -4,7 +4,6 @@ DPDK_17.11 { bman_acquire; bman_free_pool; bman_get_params; - bman_global_init; bman_new_pool; bman_query_free_buffers; bman_release; @@ -48,7 +47,6 @@ DPDK_17.11 { qman_enqueue_multi; qman_fq_fqid; qman_fq_state; - qman_global_init; qman_init_fq; qman_poll_dqrr; qman_query_fq_np; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 6c186338f..ee59cf974 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3334,6 +3334,14 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } } + if (unlikely(!RTE_PER_LCORE(dpaa_io))) { + retval = rte_dpaa_portal_init((void *)1); + if (retval) { + DPAA_SEC_ERR("Unable to initialize portal"); + return retval; + } + } + /* Invoke PMD device initialization function */ retval = dpaa_sec_dev_init(cryptodev); if (retval == 0) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index caf255d67..16b52b5e1 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1576,20 +1576,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused, } if (!is_global_init && (rte_eal_process_type() == RTE_PROC_PRIMARY)) { - /* One time load of Qman/Bman drivers */ - ret = qman_global_init(); - if (ret) { - DPAA_PMD_ERR("QMAN initialization failed: %d", - ret); - return ret; - } - ret = bman_global_init(); - if (ret) { - DPAA_PMD_ERR("BMAN initialization failed: %d", - ret); - return ret; - } - if (access("/tmp/fmc.bin", F_OK) == -1) { RTE_LOG(INFO, PMD, "* FMC not configured.Enabling default mode\n");