From patchwork Wed Oct 30 12:09:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178111 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1205153ill; Wed, 30 Oct 2019 05:27:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqywOS+iP2xs6S9/mBC9C/hrvNrm75SBTEcgUy74RIMHPmpNR7XmLmrpX0K2gP0ECku/zbA3 X-Received: by 2002:a17:906:d972:: with SMTP id rp18mr8677596ejb.179.1572438433938; Wed, 30 Oct 2019 05:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438433; cv=none; d=google.com; s=arc-20160816; b=uyTQcg1+faydPYMWPC/LycGhM80yfaw2UaTAWiJ1mqMf8RdjeQpwmrxPS5nHR1XDwY Agoi+zjFWc5IqXk/AAnzEjZdvjwh4o2bue7z3BitutUg5KPzpHGFCq4mVW78Mtv9hfso aT/ojhrM8LjuZ+zR4aen+WeFtC+2o4u+Ck1PWo9I8pGZ1tc7HJWUnqylQdqgkKDOXxyR XndanDr4ST8Tx2iLtw3Z7Yjqrwi8RkcoAOBaoS1epkpPMSBLz82zm7fKftlxGVfaWamG PN/Li2igkemBuXfVzwqCaFYC/9JKX8VVYhbuvn44etupG9Qx+7UAIief4SsVfMEQN7p4 u8/w== 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=li2J+maWZa5t2B0Sp0iwMc1K312h3XjwGNl5l6can2tOcwnhSR0E7Iur3DlTK5u2BJ EK9DPoXxbKxOPxRXA5qenejbuuzM5ea9uy+CHOxg8vafcD9lRW3yESLYQ6XTq+MTXODs 6TnYczV2gaI11UqQYUjk8iOmsCB9KgYTKlDOoyNQlHYuNUaIArBss3Cx85JydPSMqgJg MUHiUrV5oRpm8UHCNj1ui/hhBCKbjQOQqJI5oknLXtDWSmsJmBRKQVch1HcfpgmxwfBe gAda5FfIHJ8PoJGekCf3c44kOui25Jgeq0TzK01jp3kbgrO73wYLMAhw9o9I5cJRVWMz ip9w== 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 m8si1141711ejx.85.2019.10.30.05.27.13; Wed, 30 Oct 2019 05:27:13 -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 61F491C0D6; Wed, 30 Oct 2019 13:26:48 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 9A10A1C045 for ; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7B2C1200497; Wed, 30 Oct 2019 13:26:12 +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 A9337200473; Wed, 30 Oct 2019 13:26:09 +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 76CFB40307; Wed, 30 Oct 2019 20:26:06 +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: Wed, 30 Oct 2019 17:39:54 +0530 Message-Id: <20191030120955.26904-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 8/9 v3] 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");