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 77D874263E; Tue, 26 Sep 2023 08:00:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2F03240ED3; Tue, 26 Sep 2023 07:59:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B1EC840ED3 for ; Tue, 26 Sep 2023 07:59:28 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38PKQ3Vv003945 for ; Mon, 25 Sep 2023 22:59:27 -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=Zr+0qqZ7PmkSuAhYc/bvSyUNWlvdmvl9Ftl/GLFf0rI=; b=eIH+O34LMmW8jg2xtTo7m0uNvLxX147jWSj2ieSq9Di/VBzx4gNrqvKCH1VWfAPLvHdW WfkBo2265Kj6Pwm4vlpPPetIzo9rcJ5ntKj6UFa5PYP82KoiGMjrF1cd3QKpw/rR3lq2 MteapV4J3S88nO1tk6EAtmwsnb1+xjbNM20HnezJoF+b2Ri8wWRs1z0IcJxmy/QSoq/w jdN7tyrxBCQRb8WVQsPTNPIOzkvVvLFz3vOcrTbBA9L+I0emwIxmVsVcV7Qi6PLbbaRJ MeJv5QyUH8AK61ouqEpnXv7/ficqNqgT/cnQ/Pc8DRmzgNbxp3wGJPHbDiGYT5VVvh+K MA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t9wcqr1vf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 25 Sep 2023 22:59:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 25 Sep 2023 22:59:26 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 25 Sep 2023 22:59:26 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 1EDA73F7070; Mon, 25 Sep 2023 22:59:23 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Vidya Sagar Velumuri , Anoob Joseph , Aakash Sasidharan , Gowrishankar Muthukrishnan , Subject: [PATCH v2 14/15] crypto/cnxk: update the iv from proper param for gmac Date: Tue, 26 Sep 2023 11:28:46 +0530 Message-ID: <20230926055847.2707473-15-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230926055847.2707473-1-ktejasree@marvell.com> References: <20230926055847.2707473-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: j1n72dcbnNMb6kzYizEMRoeNdL5I0aag X-Proofpoint-GUID: j1n72dcbnNMb6kzYizEMRoeNdL5I0aag X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-26_04,2023-09-25_01,2023-05-22_02 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 In raw crypto, aad and auth iv are provided in same param. Update the auth_iv from proper param in case of GMAC. Skip the raw for SM ciphers and auths Signed-off-by: Vidya Sagar Velumuri --- drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 6 +++--- drivers/crypto/cnxk/cnxk_se.h | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c index 4b0becce0e..5f181e8839 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c @@ -1485,7 +1485,8 @@ cn10k_sym_configure_raw_dp_ctx(struct rte_cryptodev *dev, uint16_t qp_id, if ((sess->dp_thr_type == CPT_DP_THREAD_TYPE_PDCP) || (sess->dp_thr_type == CPT_DP_THREAD_TYPE_PDCP_CHAIN) || - (sess->dp_thr_type == CPT_DP_THREAD_TYPE_KASUMI)) + (sess->dp_thr_type == CPT_DP_THREAD_TYPE_KASUMI) || + (sess->dp_thr_type == CPT_DP_THREAD_TYPE_SM)) return -ENOTSUP; if ((sess->dp_thr_type == CPT_DP_THREAD_AUTH_ONLY) && @@ -1493,8 +1494,7 @@ cn10k_sym_configure_raw_dp_ctx(struct rte_cryptodev *dev, uint16_t qp_id, (sess->roc_se_ctx.fc_type == ROC_SE_PDCP))) return -ENOTSUP; - if ((sess->roc_se_ctx.hash_type == ROC_SE_GMAC_TYPE) || - (sess->roc_se_ctx.hash_type == ROC_SE_SHA1_TYPE)) + if (sess->roc_se_ctx.hash_type == ROC_SE_SHA1_TYPE) return -ENOTSUP; dp_ctx = (struct cnxk_sym_dp_ctx *)raw_dp_ctx->drv_ctx_data; diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index f05c5078d6..5d138163f0 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -3499,14 +3499,23 @@ fill_raw_fc_params(struct cnxk_iov *iov, struct cnxk_se_sess *sess, struct cpt_q fc_params.mac_buf.vaddr = 0; fc_params.iv_buf = NULL; - if (likely(is_kasumi || sess->iv_length)) { + if (likely(sess->iv_length)) { flags |= ROC_SE_VALID_IV_BUF; - fc_params.iv_buf = iov->iv_buf; - if (sess->short_iv) { - memcpy((uint8_t *)iv_buf, iov->iv_buf, 12); - iv_buf[3] = rte_cpu_to_be_32(0x1); - fc_params.iv_buf = iv_buf; + if (sess->is_gmac) { + fc_params.iv_buf = iov->aad_buf; + if (sess->short_iv) { + memcpy((void *)iv_buf, iov->aad_buf, 12); + iv_buf[3] = rte_cpu_to_be_32(0x1); + fc_params.iv_buf = iv_buf; + } + } else { + fc_params.iv_buf = iov->iv_buf; + if (sess->short_iv) { + memcpy((void *)iv_buf, iov->iv_buf, 12); + iv_buf[3] = rte_cpu_to_be_32(0x1); + fc_params.iv_buf = iv_buf; + } } if (sess->aes_ccm) { -- 2.25.1