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 A017F43CAE; Thu, 14 Mar 2024 09:39:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2847742E57; Thu, 14 Mar 2024 09:39:22 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id A287B40DCE for ; Thu, 14 Mar 2024 09:39:15 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42DN4rCR016398 for ; Thu, 14 Mar 2024 01:39:15 -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=XwLcrs0R+uw3clPq5T0fNsPv/5qqOOekueKE8gFSDtg=; b=QM1 c/55EpZ96Ady4nk51yLCF63ckwy/jnOVIOz+m+c07agcscE9O0jUJonVDipyj14G ER84bn2F9qaDHX6QbCHyZev9Ja0ibYAVROt/gT40EezhcQsitn+jj7TJwNoEsXzX oA1GcA8eF3pEfrhjQ40ZrD3M7JvLl3UTmcQTK4LIMPq3JXoa86GY3+mCrkgYHvne UIGoiu46sXMR/7SegbqC9BK9IqcUjwhk3Mk1oKn/2Pcwi3OplsCVdJkEnUWIiDm+ 4i7jHxMLpwpsFU0vl648Hlb+xwuUTYgPSGQb6/hMH6cQfFZPmLq7gtsnwyU/jjsd OMoh32lVHCRhXE7n37g== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wucg2uwt8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Mar 2024 01:39:14 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Thu, 14 Mar 2024 01:39:11 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Thu, 14 Mar 2024 01:39:11 -0700 Received: from localhost.localdomain (unknown [10.28.36.179]) by maili.marvell.com (Postfix) with ESMTP id 7A91A5B6929; Thu, 14 Mar 2024 01:39:08 -0700 (PDT) From: Vidya Sagar Velumuri To: Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj CC: , , , , Subject: [PATCH 03/12] crypto/cnxk: add support for session update for TLS Date: Thu, 14 Mar 2024 01:38:35 -0700 Message-ID: <20240314083844.3319506-4-vvelumuri@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240314083844.3319506-1-vvelumuri@marvell.com> References: <20240314083844.3319506-1-vvelumuri@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: yb6GIWvsSNVB_pOSYOGXz-WOpT7Ak-Ah X-Proofpoint-GUID: yb6GIWvsSNVB_pOSYOGXz-WOpT7Ak-Ah X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-14_07,2024-03-13_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 Add session update support for TLS Signed-off-by: Vidya Sagar Velumuri --- drivers/crypto/cnxk/cn10k_cryptodev_sec.c | 3 +++ drivers/crypto/cnxk/cn10k_tls.c | 17 +++++++++++++++++ drivers/crypto/cnxk/cn10k_tls.h | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_sec.c b/drivers/crypto/cnxk/cn10k_cryptodev_sec.c index cb013986c4..775104b765 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_sec.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_sec.c @@ -116,6 +116,9 @@ cn10k_sec_session_update(void *dev, struct rte_security_session *sec_sess, if (cn10k_sec_sess->proto == RTE_SECURITY_PROTOCOL_IPSEC) return cn10k_ipsec_session_update(vf, qp, cn10k_sec_sess, conf); + if (conf->protocol == RTE_SECURITY_PROTOCOL_TLS_RECORD) + return cn10k_tls_record_session_update(vf, qp, cn10k_sec_sess, conf); + return -ENOTSUP; } diff --git a/drivers/crypto/cnxk/cn10k_tls.c b/drivers/crypto/cnxk/cn10k_tls.c index 3e306c248b..a15c95f74c 100644 --- a/drivers/crypto/cnxk/cn10k_tls.c +++ b/drivers/crypto/cnxk/cn10k_tls.c @@ -769,6 +769,23 @@ cn10k_tls_write_sa_create(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf, return ret; } +int +cn10k_tls_record_session_update(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, + struct cn10k_sec_session *sess, + struct rte_security_session_conf *conf) +{ + struct roc_cpt *roc_cpt; + int ret; + + if (conf->tls_record.type == RTE_SECURITY_TLS_SESS_TYPE_READ) + return -ENOTSUP; + + roc_cpt = &vf->cpt; + ret = cn10k_tls_write_sa_create(roc_cpt, &qp->lf, &conf->tls_record, conf->crypto_xform, + (struct cn10k_sec_session *)sess); + return ret; +} + int cn10k_tls_record_session_create(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, struct rte_security_tls_record_xform *tls_xfrm, diff --git a/drivers/crypto/cnxk/cn10k_tls.h b/drivers/crypto/cnxk/cn10k_tls.h index 19772655da..9635bdd4c9 100644 --- a/drivers/crypto/cnxk/cn10k_tls.h +++ b/drivers/crypto/cnxk/cn10k_tls.h @@ -25,6 +25,10 @@ struct cn10k_tls_record { }; } __rte_aligned(ROC_ALIGN); +int cn10k_tls_record_session_update(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, + struct cn10k_sec_session *sess, + struct rte_security_session_conf *conf); + int cn10k_tls_record_session_create(struct cnxk_cpt_vf *vf, struct cnxk_cpt_qp *qp, struct rte_security_tls_record_xform *tls_xfrm, struct rte_crypto_sym_xform *crypto_xfrm, -- 2.25.1