From patchwork Fri May 15 09:47:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186821 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp266373ilb; Fri, 15 May 2020 02:51:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSQh0lOj3YrGyoQnSnQhMS1AiskRe9nbokHVI8qudQjgMiEHqElyJgBnh1JsPX/pC3C5sj X-Received: by 2002:adf:8403:: with SMTP id 3mr3218802wrf.186.1589536302981; Fri, 15 May 2020 02:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589536302; cv=none; d=google.com; s=arc-20160816; b=v/6uubmrhCsg1CjB5ku1XOqbLDbKsXmHs6+FVWRx0WevoetMkNAmwp6q9+MWJCs4HD v1R7E1M0q+nwJ41h/bV412/b0JQL2iHGq4KyDo/Z0OjFwbnFHSCT01daOYmqC3rrn6Qz 3y8Yk3kyGuKwd6GUff6FvCVkDi8AV8GTiQXdJnXQd5d1NYPm3tPiJyrzvgtANQykv9KB 8imS5LPSQEnxOBdlITxaks9UIbWN/RzKFMbOPYWkNj0dG5gcqFcgWGEtmRh0a01dvR+N 5CEraFYBbLZ6j8fedGMa0P3pG+D3MC1IIQaMVoVqn6KU2wnR3ELqYrnnWMqk5OaAmh5m ZJDw== 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=dP607l42QwL2EApOdlklNFs+VBnAjI99dGrYn1Va86U=; b=BJ4TydY0P1Rk2k9vOUmlOQZUK7tuLWkylF8IPC5tu/smJv4WKvaFL9qMkedTy9J4yY FT9NLk15wSNFPphzPZdEwE1eUyeG7fdEA6ja7foYvXklNnRSl11ROlU9aqAo9u0NCiN4 NJzs+K98bKGiLc4g2U0BCMldyrhXFyy4TKiDmTSdPzTzX3Eva7nYTceqFHCeoh5QypEH rD/h57Iuk4Kj27HXyk2vRMrA9rIMFthSmzKu1njBOmgFAjAM1kqhbrQANfpqxyPBA363 B2l2oqGXFjA/liKuXFF8gA3eMYv9XQXfNidFalWmjrrztiOsdCZ8Cthgq3wK4rBHj18w yTMg== 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 m8si1725721wmg.183.2020.05.15.02.51.42; Fri, 15 May 2020 02:51:42 -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 9E8411DAFB; Fri, 15 May 2020 11:50:43 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id AF7321DAC4 for ; Fri, 15 May 2020 11:50:27 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8730E200748; Fri, 15 May 2020 11:50:27 +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 829262005FF; Fri, 15 May 2020 11:50:25 +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 CBED84031D; Fri, 15 May 2020 17:50:22 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Fri, 15 May 2020 15:17:48 +0530 Message-Id: <20200515094752.28490-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515094752.28490-1-hemant.agrawal@nxp.com> References: <20200514132533.13752-1-hemant.agrawal@nxp.com> <20200515094752.28490-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v8 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 Acked-by: Ray Kinsella 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 53732289d3..8bb2757e04 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -12,6 +12,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; @@ -50,8 +52,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_clear_irq; 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;