From patchwork Wed Oct 19 14:15:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 118573 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26D39A06C8; Wed, 19 Oct 2022 16:15:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1796842B6C; Wed, 19 Oct 2022 16:15:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5DE81410D1 for ; Wed, 19 Oct 2022 16:15:22 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29J8An7T010348 for ; Wed, 19 Oct 2022 07:15:21 -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=2Qf34o0yGXEHCOxM2VQr7fD3qIJpKukHn7KSciqSF4Q=; b=Gu0wGhyOd2XpJRixzCcRHf/KCKwnJSIAeQcjrM5akD7KA+SCDvyolyQeiwEFBKTL1BXJ 8bKxd7CpC9uiwcdeoHg5ArXB0ryS3sxHtzKwOZOFrVeKUQqTb2xcURZI0Kis6zDtKLwV dmBJqqKYvld3/NCDbXZCZuYdHhLVNpXDgvAiyS0DB5Mvp23jknzhLszXuj5suJV177sX oG77zFQzMFxFgpiLRAM1GiwkMHDCSKSPAss5Poj0Ca63eGa1oBGBNPRWaLfO0UL4pJzn JhDghv6Awy3lpKdlvYKQF5NubKgdEjyr45xx0/AzePrWoJSQWQ2LWsn+vhQ+UArseeGJ Tg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3kadg59c94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 19 Oct 2022 07:15:21 -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; Wed, 19 Oct 2022 07:15:19 -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; Wed, 19 Oct 2022 07:15:19 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 599483F7041; Wed, 19 Oct 2022 07:15:18 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Vidya Sagar Velumuri , Subject: [PATCH 02/13] common/cnxk: set inplace bit of lookaside IPsec Date: Wed, 19 Oct 2022 19:45:02 +0530 Message-ID: <20221019141513.1969052-3-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019141513.1969052-1-ktejasree@marvell.com> References: <20221019141513.1969052-1-ktejasree@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: L1ch5ZgJAl-JrJk8afwp1ECXlcBI2SfG X-Proofpoint-ORIG-GUID: L1ch5ZgJAl-JrJk8afwp1ECXlcBI2SfG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-19_08,2022-10-19_03,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 Set inplace bit of lookaside IPsec and remove rptr population in datapath. Signed-off-by: Tejasree Kondoj --- drivers/common/cnxk/roc_ie_on.h | 1 + drivers/common/cnxk/roc_ie_ot.h | 2 ++ drivers/crypto/cnxk/cn10k_ipsec.c | 4 ++-- drivers/crypto/cnxk/cn10k_ipsec_la_ops.h | 2 -- drivers/crypto/cnxk/cn9k_ipsec.c | 4 ++-- drivers/crypto/cnxk/cn9k_ipsec_la_ops.h | 3 +-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/common/cnxk/roc_ie_on.h b/drivers/common/cnxk/roc_ie_on.h index 961d5fc95e..5d02684e34 100644 --- a/drivers/common/cnxk/roc_ie_on.h +++ b/drivers/common/cnxk/roc_ie_on.h @@ -30,6 +30,7 @@ enum roc_ie_on_ucc_ipsec { #define ROC_IE_ON_INB_RPTR_HDR 16 #define ROC_IE_ON_MAX_IV_LEN 16 #define ROC_IE_ON_PER_PKT_IV BIT(43) +#define ROC_IE_ON_INPLACE_BIT BIT(6) enum { ROC_IE_ON_SA_ENC_NULL = 0, diff --git a/drivers/common/cnxk/roc_ie_ot.h b/drivers/common/cnxk/roc_ie_ot.h index 56a1e9f1d6..722fbc1ddc 100644 --- a/drivers/common/cnxk/roc_ie_ot.h +++ b/drivers/common/cnxk/roc_ie_ot.h @@ -18,6 +18,8 @@ #define ROC_IE_OT_CPT_TS_PKIND 54 #define ROC_IE_OT_SA_CTX_HDR_SIZE 1 +#define ROC_IE_OT_INPLACE_BIT BIT(6) + enum roc_ie_ot_ucc_ipsec { ROC_IE_OT_UCC_SUCCESS = 0x00, ROC_IE_OT_UCC_ERR_SA_INVAL = 0xb0, diff --git a/drivers/crypto/cnxk/cn10k_ipsec.c b/drivers/crypto/cnxk/cn10k_ipsec.c index ef013c8bae..1740a73c36 100644 --- a/drivers/crypto/cnxk/cn10k_ipsec.c +++ b/drivers/crypto/cnxk/cn10k_ipsec.c @@ -99,7 +99,7 @@ cn10k_ipsec_outb_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, /* pre-populate CPT INST word 4 */ inst_w4.u64 = 0; - inst_w4.s.opcode_major = ROC_IE_OT_MAJOR_OP_PROCESS_OUTBOUND_IPSEC; + inst_w4.s.opcode_major = ROC_IE_OT_MAJOR_OP_PROCESS_OUTBOUND_IPSEC | ROC_IE_OT_INPLACE_BIT; param1.u16 = 0; @@ -193,7 +193,7 @@ cn10k_ipsec_inb_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, /* pre-populate CPT INST word 4 */ inst_w4.u64 = 0; - inst_w4.s.opcode_major = ROC_IE_OT_MAJOR_OP_PROCESS_INBOUND_IPSEC; + inst_w4.s.opcode_major = ROC_IE_OT_MAJOR_OP_PROCESS_INBOUND_IPSEC | ROC_IE_OT_INPLACE_BIT; param1.u16 = 0; diff --git a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h index a75e88cb28..084198b5bb 100644 --- a/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h +++ b/drivers/crypto/cnxk/cn10k_ipsec_la_ops.h @@ -83,7 +83,6 @@ process_outb_sa(struct roc_cpt_lf *lf, struct rte_crypto_op *cop, struct cn10k_s inst->w4.u64 = inst_w4_u64 | rte_pktmbuf_pkt_len(m_src); dptr = rte_pktmbuf_mtod(m_src, uint64_t); inst->dptr = dptr; - inst->rptr = dptr; return 0; } @@ -99,7 +98,6 @@ process_inb_sa(struct rte_crypto_op *cop, struct cn10k_sec_session *sess, struct inst->w4.u64 = sess->inst.w4 | rte_pktmbuf_pkt_len(m_src); dptr = rte_pktmbuf_mtod(m_src, uint64_t); inst->dptr = dptr; - inst->rptr = dptr; return 0; } diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c index 5f3a74107b..55a13570ad 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec.c +++ b/drivers/crypto/cnxk/cn9k_ipsec.c @@ -87,7 +87,7 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp, return ret; w4.u64 = 0; - w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_OUTBOUND_IPSEC; + w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_OUTBOUND_IPSEC | ROC_IE_ON_INPLACE_BIT; w4.s.opcode_minor = ctx_len >> 3; param1.u16 = 0; @@ -174,7 +174,7 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp, return ret; w4.u64 = 0; - w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_INBOUND_IPSEC; + w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_INBOUND_IPSEC | ROC_IE_ON_INPLACE_BIT; w4.s.opcode_minor = ctx_len >> 3; param2.u16 = 0; diff --git a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h index 8b4e636c70..52618e8840 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h +++ b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h @@ -82,7 +82,6 @@ process_outb_sa(struct rte_crypto_op *cop, struct cn9k_sec_session *sess, struct /* Prepare CPT instruction */ inst->w4.u64 = sess->inst.w4 | dlen; inst->dptr = PLT_U64_CAST(hdr); - inst->rptr = PLT_U64_CAST(hdr); inst->w7.u64 = sess->inst.w7; return 0; @@ -96,7 +95,7 @@ process_inb_sa(struct rte_crypto_op *cop, struct cn9k_sec_session *sess, struct /* Prepare CPT instruction */ inst->w4.u64 = sess->inst.w4 | rte_pktmbuf_pkt_len(m_src); - inst->dptr = inst->rptr = rte_pktmbuf_mtod(m_src, uint64_t); + inst->dptr = rte_pktmbuf_mtod(m_src, uint64_t); inst->w7.u64 = sess->inst.w7; } #endif /* __CN9K_IPSEC_LA_OPS_H__ */