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 F08A3A0543; Tue, 4 Oct 2022 13:11:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E48A04282D; Tue, 4 Oct 2022 13:11:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5EBA440DFB for ; Tue, 4 Oct 2022 13:11:48 +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 2948GmAK022729; Tue, 4 Oct 2022 04:11:41 -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=4Z9LrXqfSWXtXNda/BAJ2GayG9ThMkbOX/RfSbjPH/0=; b=EFBtuD68+E8Df7qSkxH8ClBDCnPZvppA32YCHa2Sc0vrAjNYo61kFpTwadM/2o4T6g66 ISAw5sol+iklWXareS4Yh3OD0dlnMU3jlw+0JNqBqUDC1l4cu3LKkgNqB9DYI1CH3K+i TxBymbUhs6R76vpsXAp7w+rv+i8LEdIy6X3IABq6VlPghN+1rNTLWm3ki/EzIqTS5Qf6 S03M0iGvewm1zDcGkX3hg4dga0c7Av6a8nRhqYVlIJNfEqFVEvubRfBJP40Dvied0IVq rwwYU0xsqMRWpfS7Nn81F7TOkKIP0+ydEfNhey7Ug249VAmmNLVq8YWjEL2C1QdYDeIM tQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jxn2ps55u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 04 Oct 2022 04:11:41 -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; Tue, 4 Oct 2022 04:11:39 -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; Tue, 4 Oct 2022 04:11:39 -0700 Received: from localhost.localdomain (unknown [10.28.36.102]) by maili.marvell.com (Postfix) with ESMTP id 855A23F7095; Tue, 4 Oct 2022 04:11:29 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Akhil Goyal , David Coyle , Kevin O'Sullivan Subject: [PATCH v7 5/6] drivers/crypto: support security session get size op Date: Tue, 4 Oct 2022 16:40:34 +0530 Message-ID: <20221004111035.3264904-6-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221004111035.3264904-1-gakhil@marvell.com> References: <20221004111035.3264904-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: BokfRF4HsqHENXwQ9B0TEAhyE6O4DQr4 X-Proofpoint-GUID: BokfRF4HsqHENXwQ9B0TEAhyE6O4DQr4 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-10-04_04,2022-09-29_03,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 bbf2c0bdb1..67d9bb89e5 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 28a868da53..49f08f69f0 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 b1529bd1f6..0df63aaf3f 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 1aa8e935f1..6ac0407c36 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 c2efb675e1..d96122b208 100644 --- a/drivers/crypto/qat/qat_sym_session.c +++ b/drivers/crypto/qat/qat_sym_session.c @@ -2670,4 +2670,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