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 80A0A425FF; Thu, 21 Sep 2023 13:48:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D540140E7C; Thu, 21 Sep 2023 13:48:35 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 82F4840E78 for ; Thu, 21 Sep 2023 13:48:34 +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 38L77TDD001448 for ; Thu, 21 Sep 2023 04:48:33 -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=L6Xq/vE6szzLfsTdUQQeOFRWfjcnUotGajjSqzCxm7I1hA54qTn6OtnoRze+x2+xVTwT vAj6I6LDYbMHVBGnK10Hu4LBcErVhRvvcfqbNh+B61B6rIPpVAmho5ash+v6Zn38D04y mkMruabVtvRmHHi5HHUo30WcF4Efmi7BBcrVql0yXkcHRye4SzBu7fXkisbTMWOhit3b HSN3/VabYT1xw+9ksrtZi0L8a1i9/+mGMaayvsx+nLzsJP26HmSG4NNBXV4x6caI3/Y7 L0LJkkgr3ZZInJUgEpPbOQb4hDC83R3Sm21JCPEH5R+P8s+9JylWnIsEjO2aOjOUO/as vw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3t7u4ddv8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 21 Sep 2023 04:48:33 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 21 Sep 2023 04:48:31 -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; Thu, 21 Sep 2023 04:48:31 -0700 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 6B1965B693B; Thu, 21 Sep 2023 04:48:29 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal CC: Anoob Joseph , Aakash Sasidharan , Gowrishankar Muthukrishnan , Vidya Sagar Velumuri , Subject: [PATCH 03/15] common/cnxk: set cipher key only for non-null cipher Date: Thu, 21 Sep 2023 17:18:08 +0530 Message-ID: <20230921114820.2526810-4-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230921114820.2526810-1-ktejasree@marvell.com> References: <20230921114820.2526810-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Dn264rS8A5dfYm5B7R2NbP8FO3y2Ga1K X-Proofpoint-GUID: Dn264rS8A5dfYm5B7R2NbP8FO3y2Ga1K 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-21_09,2023-09-21_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. -- 2.25.1