From patchwork Thu May 14 14:29:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186750 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1457676ilb; Thu, 14 May 2020 07:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2RQF5hreMPoKz44ekFL46ShPEd5dCjNgbvzU+zx4KfqMdEWm1HTj63SbM3Edki4HJC1Hc X-Received: by 2002:a05:6000:8:: with SMTP id h8mr6094684wrx.372.1589466842500; Thu, 14 May 2020 07:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589466842; cv=none; d=google.com; s=arc-20160816; b=Es5u/DGErWbm2zBIiVeOfpQGqAmyVcc1tSGf40ABJHvuls/2Py2gJ21EUAsgAQ18HJ dEbDh3w37AMb62WxP43iUfSrIZ4gx+JwzebLgWheHC5MoTnv0L7Xd/wLzQfWbIEh7O8O rEgmZ8CO/w1gmhp3cc/26rhiiFL/XQsTQVx7uUrfYsMcPI9Fi7UitDaqPFYeQPa3b9FR 4YNdnQbBSNa94Rlc2u5jq05A7nVYsLFQfVuRz5FI6JbHxrl2gehYG2k855OwNUTSASD4 2DJ5LZr3JXPeFTm+04L0K20jmvXdTZ0zR/i3qChDRrp7tpXbbinhdyTRreZpWlPZSoHS tHbQ== 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=14FqiY9yc25eLywBDIbkf3a8eskTLrQApSYt/r8/Y3Y=; b=dWeOmB6DHdLN93tIvRZgS+4ky6r/DKxxLICDWqrpVqcYvVGudWyDGxnTrId8YfO316 /SAUT4+CVDTEFxM9YzU9UmrtK4AccagjLj1puzFNvBRk9JagXPcyI4bVVrwowUpplG1t mGGAOKWjTnwoZlhEJk2GeGHsIKId1TW05VINreuPIgInKjvxzr+kXAXHgI4WaX91532Y evNbYUtH53GYUy74/e5tfS/bUVAEcMQKR9r5nDEQ0g1RBIUFj/qgqOlgbJgn4KJACsmw x2oB/ZVu9x7jGIaXUD3ZLbMmAtvqFefoKEWD0m7q9phend1L4C06r1o9BY9Q/GFsr/Yz v2Iw== 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 c10si12532073wml.105.2020.05.14.07.34.02; Thu, 14 May 2020 07:34:02 -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 444881D9F9; Thu, 14 May 2020 16:32:37 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 3C8E11D9B7 for ; Thu, 14 May 2020 16:32:24 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0F9502003AF; Thu, 14 May 2020 16:32:24 +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 0825A2003BE; Thu, 14 May 2020 16:32:22 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 14BD4402DF; Thu, 14 May 2020 22:32:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Thu, 14 May 2020 19:59:47 +0530 Message-Id: <20200514142951.31801-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514142951.31801-1-hemant.agrawal@nxp.com> References: <20200514132533.13752-1-hemant.agrawal@nxp.com> <20200514142951.31801-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v6 09/13] bus/dpaa: share qman portal ids as function calls 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" qman caam and pool portal ids are only used in control path. This patch changes their inter library access to function call instead of direct shared variable. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman_driver.c | 10 ++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 8 +++++++- drivers/bus/dpaa/rte_bus_dpaa_version.map | 4 ++-- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 69244ef701..1166d68e21 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -30,6 +30,16 @@ static __thread struct dpaa_ioctl_portal_map map = { .type = dpaa_portal_qman }; +u16 dpaa_get_qm_channel_caam(void) +{ + return qm_channel_caam; +} + +u16 dpaa_get_qm_channel_pool(void) +{ + return qm_channel_pool1; +} + static int fsl_qman_portal_init(uint32_t index, int is_shared) { struct qman_portal *portal; diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 4411bb0a79..78b698f393 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -44,6 +44,12 @@ enum qm_dc_portal { qm_dc_portal_pme = 3 }; +__rte_internal +u16 dpaa_get_qm_channel_caam(void); + +__rte_internal +u16 dpaa_get_qm_channel_pool(void); + /* Portal processing (interrupt) sources */ #define QM_PIRQ_CCSCI 0x00200000 /* CEETM Congestion State Change */ #define QM_PIRQ_CSCI 0x00100000 /* Congestion State Change */ @@ -65,7 +71,7 @@ enum qm_dc_portal { /* for conversion from n of qm_channel */ static inline u32 QM_SDQCR_CHANNELS_POOL_CONV(u16 channel) { - return QM_SDQCR_CHANNELS_POOL(channel + 1 - qm_channel_pool1); + return QM_SDQCR_CHANNELS_POOL(channel + 1 - dpaa_get_qm_channel_pool()); } /* For qman_volatile_dequeue(); Choose one PRECEDENCE. EXACT is optional. Use diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index f4947fac41..220fc32da1 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -8,6 +8,8 @@ INTERNAL { bman_query_free_buffers; bman_release; bman_thread_irq; + dpaa_get_qm_channel_caam; + dpaa_get_qm_channel_pool; dpaa_logtype_eventdev; dpaa_logtype_mempool; dpaa_logtype_pmd; @@ -46,8 +48,6 @@ INTERNAL { netcfg_release; per_lcore_dpaa_io; per_lcore_held_bufs; - qm_channel_caam; - qm_channel_pool1; qman_alloc_cgrid_range; qman_alloc_pool_range; qman_create_cgr; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 25dcbd259a..4af9024a00 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -123,7 +123,7 @@ dpaa_sec_init_rx(struct qman_fq *fq_in, rte_iova_t hwdesc, qm_fqd_context_a_set64(&fq_opts.fqd, hwdesc); fq_opts.fqd.context_b = fqid_out; - fq_opts.fqd.dest.channel = qm_channel_caam; + fq_opts.fqd.dest.channel = dpaa_get_qm_channel_caam(); fq_opts.fqd.dest.wq = 0; fq_in->cb.ern = ern_sec_fq_handler;