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 4C4D1A0542; Sat, 24 Sep 2022 18:36:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D24D842C2E; Sat, 24 Sep 2022 18:36:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 1AD2942C28 for ; Sat, 24 Sep 2022 18:36:44 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28OFMjs6015390; Sat, 24 Sep 2022 09:36:39 -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=TWoq+KqLpvu/dvEsRo3V7h66tNCB0nBDvwhE+5R3WgQ=; b=kgcVSW/YZTZwThmLzep+uy5UdeKiqjpJAIJukrorRMCF/ibCZrNu5+7TjTYxVvYfw4s5 EsSKcpL40woj90ZhxbPQTnzY4aLHkuB6GuclAQ/jNZOHTkwbUR9lni31wvoT9Gi82Of4 zQjWR5lW/q4kfha22W8Aj56QF6Wcog0VwEch8O+ycpKAyW+EvAUlDfFXPXm0sjTRrhIF GWU3oDEf3EB79nnl0tw3bLD2rbXw+2McnhiVC4/BN+2+PlKkPRsrxPF6VyzBNk60vWsO IlLfrglFd2ixULBPGekh4C9Eepmhxi1/uvOEms9tLrzUCK3WpuJxrgfan8or/N4fCFP0 Sg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jsy8r0u9k-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 24 Sep 2022 09:36:39 -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; Sat, 24 Sep 2022 09:36:37 -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; Sat, 24 Sep 2022 09:36:37 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 1B4A83F7055; Sat, 24 Sep 2022 09:36:28 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , Akhil Goyal , Kai Ji , David Coyle , Kevin O'Sullivan Subject: [PATCH v3 5/6] drivers/crypto: support security session get size op Date: Sat, 24 Sep 2022 22:05:41 +0530 Message-ID: <20220924163542.4159562-6-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220924163542.4159562-1-gakhil@marvell.com> References: <20220921150258.2061702-1-gakhil@marvell.com> <20220924163542.4159562-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: KbmaOPtUu54Jq_O3eLQo7IU2dRvLjFCh X-Proofpoint-ORIG-GUID: KbmaOPtUu54Jq_O3eLQo7IU2dRvLjFCh 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-24_07,2022-09-22_02,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 Added the support for rte_security_op.session_get_size() in all the PMDs which support rte_security sessions and the op was not supported. Signed-off-by: Akhil Goyal Acked-by: Kai Ji Tested-by: Gagandeep Singh Tested-by: David Coyle Tested-by: Kevin O'Sullivan --- drivers/crypto/caam_jr/caam_jr.c | 6 ++++++ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 7 +++++++ drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++++++++ drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 7 +++++++ drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 7 +++++++ drivers/crypto/qat/dev/qat_sym_pmd_gen1.c | 1 + drivers/crypto/qat/qat_sym_session.c | 6 ++++++ drivers/crypto/qat/qat_sym_session.h | 2 ++ 8 files changed, 44 insertions(+) diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index 7891254d78..a6d3a494e6 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -1937,6 +1937,11 @@ caam_jr_security_session_destroy(void *dev __rte_unused, return 0; } +static unsigned int +caam_jr_security_session_get_size(void *device __rte_unused) +{ + return sizeof(struct caam_jr_session); +} static int caam_jr_dev_configure(struct rte_cryptodev *dev, @@ -2031,6 +2036,7 @@ static struct rte_cryptodev_ops caam_jr_ops = { static struct rte_security_ops caam_jr_security_ops = { .session_create = caam_jr_security_session_create, .session_update = NULL, + .session_get_size = caam_jr_security_session_get_size, .session_stats_get = NULL, .session_destroy = caam_jr_security_session_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 563ba79418..3c51913dd8 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3733,6 +3733,12 @@ dpaa2_sec_security_session_destroy(void *dev __rte_unused, } return 0; } + +static unsigned int +dpaa2_sec_security_session_get_size(void *device __rte_unused) +{ + return sizeof(dpaa2_sec_session); +} #endif static int dpaa2_sec_sym_session_configure(struct rte_cryptodev *dev __rte_unused, @@ -4184,6 +4190,7 @@ dpaa2_sec_capabilities_get(void *device __rte_unused) static const struct rte_security_ops dpaa2_sec_security_ops = { .session_create = dpaa2_sec_security_session_create, .session_update = NULL, + .session_get_size = dpaa2_sec_security_session_get_size, .session_stats_get = NULL, .session_destroy = dpaa2_sec_security_session_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c2216987ca..72b848fd49 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -3289,6 +3289,13 @@ dpaa_sec_security_session_destroy(void *dev __rte_unused, } return 0; } + +static unsigned int +dpaa_sec_security_session_get_size(void *device __rte_unused) +{ + return sizeof(dpaa_sec_session); +} + #endif static int dpaa_sec_dev_configure(struct rte_cryptodev *dev __rte_unused, @@ -3547,6 +3554,7 @@ dpaa_sec_capabilities_get(void *device __rte_unused) static const struct rte_security_ops dpaa_sec_security_ops = { .session_create = dpaa_sec_security_session_create, .session_update = NULL, + .session_get_size = dpaa_sec_security_session_get_size, .session_stats_get = NULL, .session_destroy = dpaa_sec_security_session_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c index 76cb1c543a..fc9ee01124 100644 --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c @@ -2130,6 +2130,12 @@ aesni_mb_pmd_sec_sess_destroy(void *dev __rte_unused, return 0; } +static unsigned int +aesni_mb_pmd_sec_sess_get_size(void *device __rte_unused) +{ + return sizeof(struct aesni_mb_session); +} + /** Get security capabilities for aesni multi-buffer */ static const struct rte_security_capability * aesni_mb_pmd_sec_capa_get(void *device __rte_unused) @@ -2140,6 +2146,7 @@ aesni_mb_pmd_sec_capa_get(void *device __rte_unused) static struct rte_security_ops aesni_mb_pmd_sec_ops = { .session_create = aesni_mb_pmd_sec_sess_create, .session_update = NULL, + .session_get_size = aesni_mb_pmd_sec_sess_get_size, .session_stats_get = NULL, .session_destroy = aesni_mb_pmd_sec_sess_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c index 98a5d7ee2f..c6e9ab03fe 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c @@ -907,6 +907,12 @@ mrvl_crypto_pmd_security_session_destroy(void *dev __rte_unused, return 0; } +static unsigned int +mrvl_crypto_pmd_security_session_create(void *device __rte_unused) +{ + return sizeof(struct mrvl_crypto_session); +} + static const struct rte_security_capability mrvl_crypto_pmd_sec_security_cap[] = { { /* IPsec Lookaside Protocol offload ESP Tunnel Egress */ @@ -971,6 +977,7 @@ mrvl_crypto_pmd_security_capabilities_get(void *device __rte_unused) struct rte_security_ops mrvl_sec_security_pmd_ops = { .session_create = mrvl_crypto_pmd_security_session_create, .session_update = NULL, + .session_get_size = mrvl_crypto_pmd_security_session_get_size, .session_stats_get = NULL, .session_destroy = mrvl_crypto_pmd_security_session_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/qat/dev/qat_sym_pmd_gen1.c b/drivers/crypto/qat/dev/qat_sym_pmd_gen1.c index 99f5a22a06..462c1a722f 100644 --- a/drivers/crypto/qat/dev/qat_sym_pmd_gen1.c +++ b/drivers/crypto/qat/dev/qat_sym_pmd_gen1.c @@ -428,6 +428,7 @@ qat_security_cap_get_gen1(void *dev __rte_unused) struct rte_security_ops security_qat_ops_gen1 = { .session_create = qat_security_session_create, .session_update = NULL, + .session_get_size = qat_security_session_get_size, .session_stats_get = NULL, .session_destroy = qat_security_session_destroy, .set_pkt_metadata = NULL, diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c index 7ff3aff4d3..dce185d424 100644 --- a/drivers/crypto/qat/qat_sym_session.c +++ b/drivers/crypto/qat/qat_sym_session.c @@ -2641,4 +2641,10 @@ qat_security_session_destroy(void *dev __rte_unused, # endif return 0; } + +unsigned int +qat_security_session_get_size(void *device __rte_unused) +{ + return sizeof(struct qat_sym_session); +} #endif diff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h index ac57e0b240..6322d7e3bc 100644 --- a/drivers/crypto/qat/qat_sym_session.h +++ b/drivers/crypto/qat/qat_sym_session.h @@ -180,6 +180,8 @@ qat_security_session_create(void *dev, struct rte_security_session_conf *conf, struct rte_security_session *sess); int qat_security_session_destroy(void *dev, struct rte_security_session *sess); +unsigned int +qat_security_session_get_size(void *dev __rte_unused); #endif #endif /* _QAT_SYM_SESSION_H_ */ -- 2.25.1