From patchwork Fri Jul 16 10:44:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 95972 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 390F1A0C52; Fri, 16 Jul 2021 11:50:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01EF14134A; Fri, 16 Jul 2021 11:50:08 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id BC5F340151 for ; Fri, 16 Jul 2021 11:50:06 +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 16G9feEN022628 for ; Fri, 16 Jul 2021 02:50:05 -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=43xw59vcKzVC9KXdUXHl3mNuEQD/9t+ttc3Fg2dnYtw=; b=lA0EjhWia+1hvVLGWA2voqh9Ri4h7ELeL9QH+BRSjTG0N3Y7RnHb1IdkVM9K9Oj7q6AH 9nebsTWmGNozjCRzPXhpDHF/QT6kTZL2KADkyV++blHxgUX2e+3QKlBBZCeB0FXUErCO 1wE5UETLyv4LKvr45ZqGoEuOffHu3EsJ/7Frko08L0/DXbn4id3TRC9qjn37H7huiWfw YRCbQvLMbeCSgXtnrcpcYtFmVkZljwtmy3UJQlnnkF+h2QoOmkchoGFuLrOhqPVDjzVj iP4cw+k8OEpnDxvcS/vHsI12Lil50kAmAO0zkLh5qotMRREXyO4jwON8+5G8sRqf7vc/ 3A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 39tw30j5m1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 16 Jul 2021 02:50:05 -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.18; Fri, 16 Jul 2021 02:50:04 -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; Fri, 16 Jul 2021 02:50:04 -0700 Received: from hyd1554T5810.caveonetworks.com.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 49C0A5B695F; Fri, 16 Jul 2021 02:50:01 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Tejasree Kondoj , Anoob Joseph , Ankur Dwivedi , Date: Fri, 16 Jul 2021 16:14:47 +0530 Message-ID: <20210716104447.5313-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210716090131.13114-1-ktejasree@marvell.com> References: <20210716090131.13114-1-ktejasree@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: bST3FqQgUkyzyWULo9zyWLvtIGdeDA_d X-Proofpoint-GUID: bST3FqQgUkyzyWULo9zyWLvtIGdeDA_d X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-16_02:2021-07-16, 2021-07-16 signatures=0 Subject: [dpdk-dev] [PATCH v2] crypto/octeontx2: fix lookaside IPsec IV pointer 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" Fixing IV pointer population in lookaside IPsec outbound instruction. Fixes: fab634eb87ca ("crypto/octeontx2: support security session data path") Signed-off-by: Tejasree Kondoj Acked-by: Akhil Goyal --- v2: * Fixed unused variable warning drivers/crypto/octeontx2/otx2_ipsec_po_ops.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h index 58b199f4f3..25ee10f342 100644 --- a/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h +++ b/drivers/crypto/octeontx2/otx2_ipsec_po_ops.h @@ -61,7 +61,6 @@ process_outb_sa(struct rte_crypto_op *cop, uint32_t dlen, rlen, extend_head, extend_tail; struct rte_crypto_sym_op *sym_op = cop->sym; struct rte_mbuf *m_src = sym_op->m_src; - struct otx2_ipsec_po_sa_ctl *ctl_wrd; struct cpt_request_info *req = NULL; struct otx2_ipsec_po_out_hdr *hdr; struct otx2_ipsec_po_out_sa *sa; @@ -70,7 +69,6 @@ process_outb_sa(struct rte_crypto_op *cop, char *mdata, *data; sa = &sess->out_sa; - ctl_wrd = &sa->ctl; hdr_len = sizeof(*hdr); dlen = rte_pktmbuf_pkt_len(m_src) + hdr_len; @@ -107,14 +105,8 @@ process_outb_sa(struct rte_crypto_op *cop, hdr = (struct otx2_ipsec_po_out_hdr *)rte_pktmbuf_adj(m_src, RTE_ETHER_HDR_LEN); - if (ctl_wrd->enc_type == OTX2_IPSEC_FP_SA_ENC_AES_GCM) { - memcpy(&hdr->iv[0], &sa->iv.gcm.nonce, 4); - memcpy(&hdr->iv[4], rte_crypto_op_ctod_offset(cop, uint8_t *, - sess->iv_offset), sess->iv_length); - } else if (ctl_wrd->auth_type == OTX2_IPSEC_PO_SA_AUTH_SHA1) { - memcpy(&hdr->iv[0], rte_crypto_op_ctod_offset(cop, uint8_t *, - sess->iv_offset), sess->iv_length); - } + memcpy(&hdr->iv[0], rte_crypto_op_ctod_offset(cop, uint8_t *, + sess->iv_offset), sess->iv_length); /* Prepare CPT instruction */ word0.u64 = sess->ucmd_w0;