From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D21FAA0C4A; Thu, 8 Jul 2021 13:47:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE0BF415E7; Thu, 8 Jul 2021 13:47:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3E258415E7 for ; Thu, 8 Jul 2021 13:47:43 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168Bim9d014939 for ; Thu, 8 Jul 2021 04:47:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=IzkPHWEC1jAxO+RGImrDCxGzbNPFnZyB+600RUdOahA=; b=gJv3g9an35Fm5sWdpcSNEi58ZuESponEvvP8frn4+VuL0ag1sGH5Y221MmeIlBs0GZl8 FTt4FdvWqiheU/CvWI2Q/BYZQ0StCS92SVWBA7zwGO+Mj+3n2u0tDdbfUdbdIi1QXPsL XADPQdWuTW32H1f9qXkN2cSpa5qf1cBeKGjPp031XFR9Hso0+ZHyHt7yUhQVbsmaqYkF YdS8eTSHubASQXev53QCQm2cB66ODNVC8Pc/5wjtY04SxmgAYtzaJLBhXVhDT3T09Rj+ orXzXvzYEv8gyYCdQecjqOzeyUGAQHQjVrxrNYLKsXc4Vq8szy/RMBCCnihslbBbIkD2 dA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 39nrnu1rpv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 08 Jul 2021 04:47:42 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 8 Jul 2021 04:47:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 8 Jul 2021 04:47:40 -0700 Received: from hyd1349.t110.caveonetworks.com.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id 1AB7A3F7064; Thu, 8 Jul 2021 04:47:38 -0700 (PDT) From: Ankur Dwivedi To: CC: , , , , Ankur Dwivedi Date: Thu, 8 Jul 2021 17:17:13 +0530 Message-ID: <20210708114714.32623-2-adwivedi@marvell.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210708114714.32623-1-adwivedi@marvell.com> References: <20210708114714.32623-1-adwivedi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Y0B-WgYNgqXMURlZG57W7AhQwtfZ63x_ X-Proofpoint-GUID: Y0B-WgYNgqXMURlZG57W7AhQwtfZ63x_ X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-08_06:2021-07-08, 2021-07-08 signatures=0 Subject: [dpdk-dev] [PATCH 1/2] common/cnxk: move instruction queue enable to roc API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" The code for enabling instruction queue is moved to roc API. Signed-off-by: Ankur Dwivedi --- drivers/common/cnxk/roc_cpt.c | 41 ++++++++++++++++++++------------- drivers/common/cnxk/roc_cpt.h | 1 + drivers/common/cnxk/version.map | 1 + 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index 788b28a167..c001497f74 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -444,8 +444,6 @@ cpt_iq_init(struct roc_cpt_lf *lf) { union cpt_lf_q_size lf_q_size = {.u = 0x0}; union cpt_lf_q_base lf_q_base = {.u = 0x0}; - union cpt_lf_inprog lf_inprog; - union cpt_lf_ctl lf_ctl; uintptr_t addr; lf->io_addr = lf->rbase + CPT_LF_NQX(0); @@ -465,19 +463,6 @@ cpt_iq_init(struct roc_cpt_lf *lf) lf_q_size.s.size_div40 = CPT_IQ_NB_DESC_SIZE_DIV40(lf->nb_desc); plt_write64(lf_q_size.u, lf->rbase + CPT_LF_Q_SIZE); - /* Enable command queue execution */ - lf_inprog.u = plt_read64(lf->rbase + CPT_LF_INPROG); - lf_inprog.s.eena = 1; - plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG); - - /* Enable instruction queue enqueuing */ - lf_ctl.u = plt_read64(lf->rbase + CPT_LF_CTL); - lf_ctl.s.ena = 1; - lf_ctl.s.fc_ena = 1; - lf_ctl.s.fc_up_crossing = 1; - lf_ctl.s.fc_hyst_bits = CPT_FC_NUM_HYST_BITS; - plt_write64(lf_ctl.u, lf->rbase + CPT_LF_CTL); - lf->fc_addr = (uint64_t *)addr; } @@ -573,7 +558,6 @@ cpt_lf_init(struct roc_cpt_lf *lf) if (rc) goto disable_iq; - cpt_lf_dump(lf); return 0; disable_iq: @@ -807,6 +791,31 @@ roc_cpt_iq_disable(struct roc_cpt_lf *lf) plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG); } +void +roc_cpt_iq_enable(struct roc_cpt_lf *lf) +{ + union cpt_lf_inprog lf_inprog; + union cpt_lf_ctl lf_ctl; + + /* Disable command queue */ + roc_cpt_iq_disable(lf); + + /* Enable command queue execution */ + lf_inprog.u = plt_read64(lf->rbase + CPT_LF_INPROG); + lf_inprog.s.eena = 1; + plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG); + + /* Enable instruction queue enqueuing */ + lf_ctl.u = plt_read64(lf->rbase + CPT_LF_CTL); + lf_ctl.s.ena = 1; + lf_ctl.s.fc_ena = 1; + lf_ctl.s.fc_up_crossing = 1; + lf_ctl.s.fc_hyst_bits = CPT_FC_NUM_HYST_BITS; + plt_write64(lf_ctl.u, lf->rbase + CPT_LF_CTL); + + cpt_lf_dump(lf); +} + int roc_cpt_lmtline_init(struct roc_cpt *roc_cpt, struct roc_cpt_lmtline *lmtline, int lf_id) diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h index 8dd2b5ee69..3a2f5b97e1 100644 --- a/drivers/common/cnxk/roc_cpt.h +++ b/drivers/common/cnxk/roc_cpt.h @@ -139,6 +139,7 @@ int __roc_api roc_cpt_inline_ipsec_inb_cfg(struct roc_cpt *roc_cpt, int __roc_api roc_cpt_afs_print(struct roc_cpt *roc_cpt); int __roc_api roc_cpt_lfs_print(struct roc_cpt *roc_cpt); void __roc_api roc_cpt_iq_disable(struct roc_cpt_lf *lf); +void __roc_api roc_cpt_iq_enable(struct roc_cpt_lf *lf); int __roc_api roc_cpt_lmtline_init(struct roc_cpt *roc_cpt, struct roc_cpt_lmtline *lmtline, int lf_id); diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map index e3af48c02e..490a366ea6 100644 --- a/drivers/common/cnxk/version.map +++ b/drivers/common/cnxk/version.map @@ -54,6 +54,7 @@ INTERNAL { roc_cpt_inline_ipsec_cfg; roc_cpt_inline_ipsec_inb_cfg; roc_cpt_iq_disable; + roc_cpt_iq_enable; roc_cpt_lf_ctx_flush; roc_cpt_lf_init; roc_cpt_lf_fini; -- 2.28.0