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 0DC27A0558; Mon, 5 Sep 2022 15:33:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E63E42B70; Mon, 5 Sep 2022 15:33:14 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 6CA63427F9 for ; Mon, 5 Sep 2022 15:33:12 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 285ChAdJ031978 for ; Mon, 5 Sep 2022 06:33:11 -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=NZv4OKgkvAu5FdwnvTwASxcjQvPKOKKtBJxEhrhWizE=; b=NE0XvM0U/rFssGNRujyBKlj9Sqexv8L7fFnpPDETdnBQDUvk+IlqeIrbCRKHFE3Sk0fp CBdb3UsgJ6m62oqF/5pRUOLNo/ZYeAR6NbNZruTZYpuFHTtrl9KRtj3E0dg+W2rqBBwp w+ykwCRq/N/IvmkdoK5NH4XTFxoBQdIK0Ck48f0qYW35FJQzPLSAMIu0F5/JQU6YBsQU XN7f3WAMRbsO/SLGNLKIA4FmCxmWPJR235Krsnja+nzK4fkx5iWhi5w9oLNKwXQlrpXN Xi9UyfuHqByndymBTPZiA6s48F50XEaBZFvmpMISkRptUGIjoGDEF7yUJa2qOckdacXG JA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jc6epngf8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 05 Sep 2022 06:33:11 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 5 Sep 2022 06:33:09 -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.2 via Frontend Transport; Mon, 5 Sep 2022 06:33:09 -0700 Received: from localhost.localdomain (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id BDD1E5E6870; Mon, 5 Sep 2022 06:33:06 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj CC: , , Vidya Sagar Velumuri Subject: [PATCH v2 13/31] common/cnxk: avoid the use of platform specific APIs Date: Mon, 5 Sep 2022 19:02:10 +0530 Message-ID: <20220905133228.818616-13-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905133228.818616-1-ndabilpuram@marvell.com> References: <20220809184908.24030-1-ndabilpuram@marvell.com> <20220905133228.818616-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: WPuJozCSuA_uvT9aBIOCX5yfF5qNFrjn X-Proofpoint-GUID: WPuJozCSuA_uvT9aBIOCX5yfF5qNFrjn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-05_09,2022-09-05_02,2022-06-22_01 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 From: Vidya Sagar Velumuri Replace the use of platform specific APIs with platform independent APIs. Signed-off-by: Vidya Sagar Velumuri --- drivers/common/cnxk/roc_cpt.c | 8 ++++---- drivers/common/cnxk/roc_cpt.h | 2 +- drivers/crypto/cnxk/cn9k_ipsec.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index d607bde3c4..6f0ee44b54 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -998,7 +998,7 @@ roc_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa_dptr, void *sa_cptr, } int -roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa, uint8_t opcode, +roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, uint64_t sa, uint8_t opcode, uint16_t ctx_len, uint8_t egrp) { union cpt_res_s res, *hw_res; @@ -1019,9 +1019,9 @@ roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa, uint8_t opcode, inst.w4.s.param1 = 0; inst.w4.s.param2 = 0; inst.w4.s.dlen = ctx_len; - inst.dptr = rte_mempool_virt2iova(sa); + inst.dptr = sa; inst.rptr = 0; - inst.w7.s.cptr = rte_mempool_virt2iova(sa); + inst.w7.s.cptr = sa; inst.w7.s.egrp = egrp; inst.w0.u64 = 0; @@ -1029,7 +1029,7 @@ roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa, uint8_t opcode, inst.w3.u64 = 0; inst.res_addr = (uintptr_t)hw_res; - rte_io_wmb(); + plt_io_wmb(); do { /* Copy CPT command to LMTLINE */ diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h index 4e3a078a90..6953f2bdd3 100644 --- a/drivers/common/cnxk/roc_cpt.h +++ b/drivers/common/cnxk/roc_cpt.h @@ -173,7 +173,7 @@ void __roc_api roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth); int __roc_api roc_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa_dptr, void *sa_cptr, uint16_t sa_len); -int __roc_api roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa, +int __roc_api roc_on_cpt_ctx_write(struct roc_cpt_lf *lf, uint64_t sa, uint8_t opcode, uint16_t ctx_len, uint8_t egrp); #endif /* _ROC_CPT_H_ */ diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c index 6d26b0cc01..78c181b4a4 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec.c +++ b/drivers/crypto/cnxk/cn9k_ipsec.c @@ -82,8 +82,8 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp, ctx_len = ret; opcode = ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_OUTBOUND; egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_IE]; - ret = roc_on_cpt_ctx_write(&qp->lf, (void *)&sa->out_sa, opcode, - ctx_len, egrp); + ret = roc_on_cpt_ctx_write(&qp->lf, rte_mempool_virt2iova(&sa->out_sa), + opcode, ctx_len, egrp); if (ret) return ret; @@ -174,8 +174,8 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp, ctx_len = ret; opcode = ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_INBOUND; egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_IE]; - ret = roc_on_cpt_ctx_write(&qp->lf, (void *)&sa->in_sa, opcode, ctx_len, - egrp); + ret = roc_on_cpt_ctx_write(&qp->lf, rte_mempool_virt2iova(&sa->in_sa), + opcode, ctx_len, egrp); if (ret) return ret; -- 2.25.1