From patchwork Fri Oct 11 05:46:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175913 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp312203ill; Thu, 10 Oct 2019 23:03:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5tVLQhKUru/kxJoBKmBJEMlrNchyc/TpbKoMZtrXF4Th2JchuLTAC9dOHx7v5k5nlQMVI X-Received: by 2002:a17:906:6a43:: with SMTP id n3mr11854891ejs.292.1570773811097; Thu, 10 Oct 2019 23:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570773811; cv=none; d=google.com; s=arc-20160816; b=ZUfnLIfOPZPuxvpDDwvMI44L09HjoU8kvqc+4R2+KM1OyOr5Jg4w5MkaGDc4cpr/7w 5/IKCMGvlYQQ0q0xK2o9JAOralKWmVtYGSCjSegzV/UWc6JrqMDZDLVPuEUpJaFTE+zq 1dO2bhdDIYd4F0jhwwoAS2jmXy3hvAHsRgG18RBpG6dnQC3NNJ/IFpLR1oeCTYOGKWyv 3umDJJXmVkix0c8FrqFEopQHIfdT0NEP6g46BBbVt51NNN/dujWf0mWNKNmQddjhRbSy le0qL5jSZHdHhzk8o+lFjM3vjoFTYIXSaP4YE9uUDKBToy+M1WTG5aYbEG3H5piyi3IF 9RDw== 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=DxCMn8zwp1aA6We1jteGvVDRyTLLIDGmLQSYD15LD+c=; b=uYUxAcEYc7SaR+pRWwAxOXGEkp4c4FzOVAGHkcNTSw03UzhTjuzhBSlmL2QkDT20Q4 9o/UPmHz1zNso2cVOdeQ8Tpyi6aOA8kU4gqa4khJz1RLbrfkORPu0caRh7ckAFRShydQ 8C/agor4977yjmsiHE0P9X6par/mQAVmPWH0yAsAaJrnx6wYCgq+nRm5QNBYwqWCuTdX Xap1abZCtCAjw7p53ajJC1exDjqOwZ7y2GonqVgkHbBygdHi/5yEZPmH3CXt7h175+sX tlfcU2IxtGUUx2CYIyk72ZA3ASmGJtD7S82DswtM3jMpQbmIYPS195ecLZUNxNpgozbB PLHg== 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 e43si5041836eda.296.2019.10.10.23.03.30; Thu, 10 Oct 2019 23:03:31 -0700 (PDT) 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 6BB2D1E9B6; Fri, 11 Oct 2019 08:02:50 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 89C6F1E97A for ; Fri, 11 Oct 2019 08:02:41 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 694A1200094; Fri, 11 Oct 2019 08:02:41 +0200 (CEST) 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 DEBF52004CD; Fri, 11 Oct 2019 08:02:38 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C564A40299; Fri, 11 Oct 2019 14:02:35 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com Date: Fri, 11 Oct 2019 11:16:56 +0530 Message-Id: <20191011054657.21931-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011054657.21931-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9] 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 --- 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 1d8a294b1..882b6e2f3 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 a221522c2..3b411aa13 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; @@ -50,7 +49,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 1754862be..ce9a87095 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2718,6 +2718,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");