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 424B6A0032; Mon, 12 Sep 2022 15:18:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C2D442B94; Mon, 12 Sep 2022 15:17:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EFA2A41101 for ; Mon, 12 Sep 2022 15:16:58 +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 28CD3c1W014385 for ; Mon, 12 Sep 2022 06:16:58 -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=o080XfnkRzF9ol0LIVkmjq62hd3s7+tM233PRDeUeJU=; b=kaP9BLyLZZ+eNkFJJicgd0TVgArKWXGiB+atw6QMJCL5G4LAb1+OA/rx3Ru8jWgdYw3y mK1dELPCWEflL50e2OdfUKiIjbo+QccFjIJqvCp9VnOvGNUQw5v54dsae/gxt7AfUqE8 pj/DUmvVsgWrGwdC048F5osYTonJVoNgKgYRdq7ajh9nb9hGFUOWqmrfaFKyQhqbtbOM 6oF5ttGDFICShhbn2Zoh7wDQ/hhVCAaaffBUdarOp8kF8xDSyhUN8nlu2zj9oUDzi0mb 5z10XVvf/2ivHBvhnUC8MIHhm1hWMSqQavSUNJqWyjmRA2w4bBqiwClROAJSMPtS1+to oQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jgt3mxt83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 12 Sep 2022 06:16:58 -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.2; Mon, 12 Sep 2022 06:16:56 -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.18 via Frontend Transport; Mon, 12 Sep 2022 06:16:56 -0700 Received: from localhost.localdomain (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 0DEDE3F709A; Mon, 12 Sep 2022 06:16:53 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Vidya Sagar Velumuri Subject: [PATCH v3 29/32] net/cnxk: add support for crypto auth alg MD5 Date: Mon, 12 Sep 2022 18:44:22 +0530 Message-ID: <20220912131425.1973415-29-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912131425.1973415-1-ndabilpuram@marvell.com> References: <20220809184908.24030-1-ndabilpuram@marvell.com> <20220912131425.1973415-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: CMRLzO4XoRJXe1GS5XoyWd24wpsUNMXP X-Proofpoint-GUID: CMRLzO4XoRJXe1GS5XoyWd24wpsUNMXP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-12_08,2022-09-12_01,2022-06-22_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 From: Vidya Sagar Velumuri Add support for MD5 auth algo for security offload in inline mode. Signed-off-by: Vidya Sagar Velumuri --- drivers/common/cnxk/cnxk_security.c | 4 ++++ drivers/net/cnxk/cn9k_ethdev_sec.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c index f25df54254..55382d3129 100644 --- a/drivers/common/cnxk/cnxk_security.c +++ b/drivers/common/cnxk/cnxk_security.c @@ -852,6 +852,7 @@ cnxk_ipsec_icvlen_get(enum rte_crypto_cipher_algorithm c_algo, case RTE_CRYPTO_AUTH_NULL: icv = 0; break; + case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: icv = 12; break; @@ -1208,6 +1209,7 @@ cnxk_on_ipsec_outb_sa_create(struct rte_security_ipsec_xform *ipsec, ctx_len = offsetof(struct roc_ie_on_outb_sa, aes_gcm.template); } else { switch (ctl->auth_type) { + case ROC_IE_ON_SA_AUTH_MD5: case ROC_IE_ON_SA_AUTH_SHA1: template = &out_sa->sha1.template; ctx_len = offsetof(struct roc_ie_on_outb_sa, @@ -1306,6 +1308,7 @@ cnxk_on_ipsec_outb_sa_create(struct rte_security_ipsec_xform *ipsec, case RTE_CRYPTO_AUTH_AES_GMAC: case RTE_CRYPTO_AUTH_NULL: break; + case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: memcpy(out_sa->sha1.hmac_key, auth_key, auth_key_len); break; @@ -1354,6 +1357,7 @@ cnxk_on_ipsec_inb_sa_create(struct rte_security_ipsec_xform *ipsec, switch (auth_xform->auth.algo) { case RTE_CRYPTO_AUTH_NULL: break; + case RTE_CRYPTO_AUTH_MD5_HMAC: case RTE_CRYPTO_AUTH_SHA1_HMAC: memcpy(in_sa->sha1_or_gcm.hmac_key, auth_key, auth_key_len); diff --git a/drivers/net/cnxk/cn9k_ethdev_sec.c b/drivers/net/cnxk/cn9k_ethdev_sec.c index 27823f44ba..6a76090403 100644 --- a/drivers/net/cnxk/cn9k_ethdev_sec.c +++ b/drivers/net/cnxk/cn9k_ethdev_sec.c @@ -185,6 +185,26 @@ static struct rte_cryptodev_capabilities cn9k_eth_sec_crypto_caps[] = { }, } }, } }, + { /* MD5 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5_HMAC, + .block_size = 64, + .key_size = { + .min = 16, + .max = 16, + .increment = 0 + }, + .digest_size = { + .min = 12, + .max = 12, + .increment = 0 + }, + }, } + }, } + }, { /* SHA1 HMAC */ .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, {.sym = { -- 2.25.1