From patchwork Tue Sep 26 05:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 131922 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 4D8B94263D; Tue, 26 Sep 2023 07:59:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1932A406A2; Tue, 26 Sep 2023 07:59:02 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id F0BF24069F for ; Tue, 26 Sep 2023 07:59:00 +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 38PKhxL8027224 for ; Mon, 25 Sep 2023 22:59:00 -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=Wa1WRyViqLBj+NdawijHlaFQjCxmKRroI0wCSi+LrmM=; b=GlCZwgL/zua2bx6KOxILmdhgrlZsmdhsnwiMtWYBmV+dCcdRfBQBGHXk7ZDNRhab+fx/ MRjW5adpYGjhkGDaV5udqS4BPdwGHEEudUCgYUqrUljjr/nQeB+n02VrGkPEjCNQL/JT xM7Fu6FlvUmTvYfKxyYsyea2Yt12CRRN+HE9UvOu65/S2xMfaBNGki30Fua99sw8fnLI r7vPJirMEPs1vVGQbNyaM3KsjyA+OwyUqFRQnt/Bf3APTjlgkISGOktQ6d3mi8VVVNl2 RXGssRzpdm/sBWpt4Rx76LHCHsX8TLxy9MSQ32nIJznLFwTL23zivn4WQgwm8KKrNnLu sg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t9wcqr1tw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 25 Sep 2023 22:58:59 -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.48; Mon, 25 Sep 2023 22:58:58 -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.48 via Frontend Transport; Mon, 25 Sep 2023 22:58:58 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 4EFEF3F7070; Mon, 25 Sep 2023 22:58:56 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Aakash Sasidharan , Gowrishankar Muthukrishnan , Vidya Sagar Velumuri , Subject: [PATCH v2 03/15] common/cnxk: set cipher key only for non-null cipher Date: Tue, 26 Sep 2023 11:28:35 +0530 Message-ID: <20230926055847.2707473-4-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 X-Proofpoint-ORIG-GUID: XpVMCY3BjmP2kvBO4loyLd2_ugARryk0 X-Proofpoint-GUID: XpVMCY3BjmP2kvBO4loyLd2_ugARryk0 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: Anoob Joseph Set cipher key only for non-NULL cipher algorithms only. Signed-off-by: Anoob Joseph --- drivers/common/cnxk/roc_se.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/common/cnxk/roc_se.c b/drivers/common/cnxk/roc_se.c index 2662297315..6ced4ef789 100644 --- a/drivers/common/cnxk/roc_se.c +++ b/drivers/common/cnxk/roc_se.c @@ -58,9 +58,6 @@ cpt_ciph_type_set(roc_se_cipher_type type, struct roc_se_ctx *ctx, uint16_t key_ int fc_type = 0; switch (type) { - case ROC_SE_PASSTHROUGH: - fc_type = ROC_SE_FC_GEN; - break; case ROC_SE_DES3_CBC: case ROC_SE_DES3_ECB: case ROC_SE_DES_DOCSISBPI: @@ -526,6 +523,10 @@ roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type, const ui uint8_t *ci_key; int i, ret; + /* For NULL cipher, no processing required. */ + if (type == ROC_SE_PASSTHROUGH) + return 0; + zs_ch_ctx = &se_ctx->se_ctx.zs_ch_ctx; if (roc_model_is_cn9k()) { @@ -555,10 +556,6 @@ roc_se_ciph_key_set(struct roc_se_ctx *se_ctx, roc_se_cipher_type type, const ui } switch (type) { - case ROC_SE_PASSTHROUGH: - se_ctx->enc_cipher = 0; - fctx->enc.enc_cipher = 0; - goto success; case ROC_SE_DES3_CBC: /* CPT performs DES using 3DES with the 8B DES-key * replicated 2 more times to match the 24B 3DES-key.