From patchwork Fri May 15 05:08:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186802 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp110294ilb; Thu, 14 May 2020 22:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRWzSDC3qqLeu1bElf99WH8g30l31etC2bm+Vbu8iSoTefvB8D9v32CTWD3vviqjqPNMU5 X-Received: by 2002:a05:6000:47:: with SMTP id k7mr1962314wrx.233.1589519545592; Thu, 14 May 2020 22:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589519545; cv=none; d=google.com; s=arc-20160816; b=Lh3rqSNgmvk+wsuBesqrXrE0ffqrG9fQAjLLF95dDUaiFRFEowLEdYYiuPEmP95du4 1G1jTqaKWd3alVZBu/F1jPiHHipzsjWA8hFdYdHucRA5kQ9CalOwKt40TZj67mqTR4Ai /o93SXXVhBKP24JR1rhjKHbHrH2UnpQF716Bc6vfE2LCqbQs0vWVAwqIRtHTCBEj2yUO wGmaZCTqUwEWVf0vYGYmc/GIQCZlvkh4gWoSwrCze+OOoUwYiaSs537ABiA5Z6XKYLyy mnppg9BKuR771vPk51tt95Pgj5OBM5JFJW0HhI7tII21hGCYg2w9nHg1j6JGNZdP8iiP +a/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=dP607l42QwL2EApOdlklNFs+VBnAjI99dGrYn1Va86U=; b=htx47gK3N2ngWFft6lyRaquJ8TqjeSvlN0j3M6V1Vw2osJs5HGyq2SnHuRtt7HFb4B +EakjOyVzIY4cHDukFjJP7Ir+PD3raf8y6YNehfLLNjyf9HA4kd14OX1k+sMFzNGLJmg tCQr//q3qg0BbV1z0nf4DMkiz/9Zk0wbWXpkrYeBFrgsZxiMoru2G9gDf7lCwcXELy33 2JKeAhnHDI9blsfiatisrTESNKxXwKk38IoVjVr2KLobGJ8oR3Y9Z1NsJKbThPNyJPTF zTzgtnmmXxEF+7Y1gwGDvdx0efqqBHv6Q1gscu9rVHdL96001NwJImQMXP3Iex088SKn uiPQ== 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 v9si961825wrf.556.2020.05.14.22.12.25; Thu, 14 May 2020 22:12:25 -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 F07821D9EE; Fri, 15 May 2020 07:11:19 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id BC2241D90A for ; Fri, 15 May 2020 07:11:06 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A03741A05E9; Fri, 15 May 2020 07:11:06 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 961401A05E3; Fri, 15 May 2020 07:11:04 +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 7621A402D3; Fri, 15 May 2020 13:11:00 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Fri, 15 May 2020 10:38:27 +0530 Message-Id: <20200515050831.22834-10-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515050831.22834-1-hemant.agrawal@nxp.com> References: <20200514142951.31801-1-hemant.agrawal@nxp.com> <20200515050831.22834-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v7 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 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;