From patchwork Sat Apr 30 05:36:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vamsi Krishna Attunuru X-Patchwork-Id: 110539 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 C2A68A0505; Sat, 30 Apr 2022 07:37:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1AD44069D; Sat, 30 Apr 2022 07:37:12 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 81B284014F for ; Sat, 30 Apr 2022 07:37:10 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23U4xeK7031275 for ; Fri, 29 Apr 2022 22:37:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=yoZx+CTrqklW60h///ZLtBT8oeEk02+RmE6NkHXtnjk=; b=CDgcdY6ozbrlGpebB8o4L+3XzRhLuwDQ2qqk6wpZorlVfbPz4V9MqE6wghwYbA0xd1gh fskd8Kqn/cl6ihXC3pOMJnwSZRPAwg+54up4cxiO+HYMj0xi17ZO5mvo7zZT4HcVTVmP RA0XAP8pp9vQVVW2RhF3VtRj4bx0scnYde3Vqqg5L/PcmNWdsq6MJA/7a2ZCWSotq5Ce Hp4Jy2vpwUnpHQshmw1pNEc1+Mtp5g5Z9XBVjw2/oy/An9xSJSgKCzd0DzIzFQKQ2AF6 Z2Jr+TRwlqqNsAez+Og2+RRjm8DhN66sVkzoVQVIYv4ZmrW3rdfVaAT/e1OMK9X8Agza HQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3frva7r9sc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 29 Apr 2022 22:37:09 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 29 Apr 2022 22:37:07 -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; Fri, 29 Apr 2022 22:37:07 -0700 Received: from localhost.localdomain (unknown [10.28.48.51]) by maili.marvell.com (Postfix) with ESMTP id 206733F7044; Fri, 29 Apr 2022 22:37:05 -0700 (PDT) From: Vamsi Attunuru To: CC: , , Subject: [PATCH 1/1] crypto/cnxk: enable 3des-cbc secure capability Date: Sat, 30 Apr 2022 11:06:37 +0530 Message-ID: <20220430053637.2065578-1-vattunuru@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: VuttVijMU59IAYRpGbwd10W-utOYRZvW X-Proofpoint-ORIG-GUID: VuttVijMU59IAYRpGbwd10W-utOYRZvW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-30_01,2022-04-28_01,2022-02-23_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 Patch enables 3DES-CBC secure capability of crypto device. Signed-off-by: Vamsi Attunuru Acked-by: Akhil Goyal --- drivers/crypto/cnxk/cnxk_cryptodev.h | 2 +- .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 24 +++++++++++++++++++ drivers/crypto/cnxk/cnxk_ipsec.h | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_cryptodev.h b/drivers/crypto/cnxk/cnxk_cryptodev.h index b75d681185..8870021725 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev.h +++ b/drivers/crypto/cnxk/cnxk_cryptodev.h @@ -11,7 +11,7 @@ #include "roc_cpt.h" #define CNXK_CPT_MAX_CAPS 35 -#define CNXK_SEC_CRYPTO_MAX_CAPS 12 +#define CNXK_SEC_CRYPTO_MAX_CAPS 13 #define CNXK_SEC_MAX_CAPS 9 #define CNXK_AE_EC_ID_MAX 8 /** diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c index 98b002d93a..ba9eaf2325 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c +++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c @@ -862,6 +862,29 @@ static const struct rte_cryptodev_capabilities sec_caps_aes[] = { }, }; +static const struct rte_cryptodev_capabilities sec_caps_des[] = { + { /* 3DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size = 8, + .key_size = { + .min = 24, + .max = 24, + .increment = 0 + }, + .iv_size = { + .min = 8, + .max = 16, + .increment = 8 + } + }, } + }, } + } +}; + static const struct rte_cryptodev_capabilities sec_caps_sha1_sha2[] = { { /* SHA1 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, @@ -1195,6 +1218,7 @@ sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[], int cur_pos = 0; SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, aes); + SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, des); SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, sha1_sha2); if (roc_model_is_cn10k()) diff --git a/drivers/crypto/cnxk/cnxk_ipsec.h b/drivers/crypto/cnxk/cnxk_ipsec.h index 171ea2774e..7c7833ac1b 100644 --- a/drivers/crypto/cnxk/cnxk_ipsec.h +++ b/drivers/crypto/cnxk/cnxk_ipsec.h @@ -24,7 +24,8 @@ ipsec_xform_cipher_verify(struct rte_crypto_sym_xform *crypto_xform) return 0; if (crypto_xform->cipher.algo == RTE_CRYPTO_CIPHER_AES_CBC || - crypto_xform->cipher.algo == RTE_CRYPTO_CIPHER_AES_CTR) { + crypto_xform->cipher.algo == RTE_CRYPTO_CIPHER_AES_CTR || + crypto_xform->cipher.algo == RTE_CRYPTO_CIPHER_3DES_CBC) { switch (crypto_xform->cipher.key.length) { case 16: case 24: