From patchwork Wed May 13 13:27:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186604 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp469361ilb; Wed, 13 May 2020 06:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo/NyO+8P11jGeGytHapuN3I0Te7wDJTaEFtxglOKdaZ/jhpLFiobNPxWc8F7PR3UvDL3x X-Received: by 2002:adf:8b98:: with SMTP id o24mr4672207wra.156.1589376697039; Wed, 13 May 2020 06:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589376697; cv=none; d=google.com; s=arc-20160816; b=UYxSwstDarf5pgEO7HNgTVU1/Ta54lZJn5U0q7ric/0Sp3mFRh4QiDSmLIGbbIitC6 6j6RC9jfG8V0kBqqX4fZx+trUyfccBYySV/EKHyF/CSoqpQCfQBpuAd3mUlx9kPAYdYc B/KnGavP3ehulUdhOO2dKRWsx/T4s+RaKQMSUBbKK0T5Z7KF2mKo1fHFtVsW7EypIckA wC8xPGuqCquRxEKQsIf+D+xuJymHYdWAD+VXAq9kmDGtqYEL3KMpkEvowA820mpowMUI 2snQ4c7QUyfZ2FXak4hsmLP9AYlzyXQdM+5RWTvs0ykqK8rakep/MEkRgiZ4Y5G+Yit1 UXJw== 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=yZBiRq8FzH+ajlax6D2R8VYgp7tK/aQJAUr2u4nMNO0Ok7NWq4/51+eYmgXIofRWk3 /RD/YZvjFJthAs6KjCrcaxRHsk6zC4vz+8fCxY6yPW5XLREr98TW8byr/37VSsG1p9t1 +SDaKh2JZI9YZJvX6673l4nFWdUJQ272JXHXer27naGQbB5AnqRE0l3zK8R5jh6t3xqc 2BzIdbtEQHPzweEFNqn9rzSyTC8AaHBOWHdUEAkVtZNeDBL3EOSVdr/5iWm0Sq4efk0L Pet32pJLdpaVoBRgXcEaFMNkP8LuP1tCh0M4IMN7utRC+Q8YAKH7FTvyRWzg/ddbH0M2 lZ+A== 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 f2si15736658wrr.565.2020.05.13.06.31.36; Wed, 13 May 2020 06:31:37 -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 928BA1D620; Wed, 13 May 2020 15:30:27 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 144C51D5EE for ; Wed, 13 May 2020 15:30:16 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EE024201377; Wed, 13 May 2020 15:30:15 +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 E9CDC201374; Wed, 13 May 2020 15:30:13 +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 5EC73402E3; Wed, 13 May 2020 21:30:11 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Wed, 13 May 2020 18:57:41 +0530 Message-Id: <20200513132745.9006-9-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200513132745.9006-1-hemant.agrawal@nxp.com> References: <20200512140100.26803-1-hemant.agrawal@nxp.com> <20200513132745.9006-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 08/12] 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;