From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <david.marchand@redhat.com>,
<hemant.agrawal@nxp.com>, <vattunuru@marvell.com>,
<ferruh.yigit@xilinx.com>, <andrew.rybchenko@oktetlabs.ru>,
<konstantin.v.ananyev@yandex.ru>, <jiawenwu@trustnetic.com>,
<yisen.zhuang@huawei.com>, <irusskikh@marvell.com>,
<jerinj@marvell.com>, <adwivedi@marvell.com>,
<maxime.coquelin@redhat.com>, <chandu@amd.com>,
<ruifeng.wang@arm.com>, <ajit.khaparde@broadcom.com>,
<anoobj@marvell.com>, <pablo.de.lara.guarch@intel.com>,
<matan@nvidia.com>, <g.singh@nxp.com>, <qiming.yang@intel.com>,
<wenjun1.wu@intel.com>, <jianwang@trustnetic.com>,
<jingjing.wu@intel.com>, <beilei.xing@intel.com>,
<ndabilpuram@marvell.com>, <roy.fan.zhang@intel.com>,
<lironh@marvell.com>, <royzhang1980@gmail.com>,
<sunilprakashrao.uttarwar@amd.com>, <kai.ji@intel.com>,
<rnagadheeraj@marvell.com>, <jianjay.zhou@huawei.com>,
<radu.nicolau@intel.com>, Akhil Goyal <gakhil@marvell.com>,
David Coyle <david.coyle@intel.com>,
Kevin O'Sullivan <kevin.osullivan@intel.com>
Subject: [PATCH v8 5/6] drivers/crypto: support security session get size op
Date: Tue, 4 Oct 2022 23:07:08 +0530 [thread overview]
Message-ID: <20221004173709.3482250-6-gakhil@marvell.com> (raw)
In-Reply-To: <20221004173709.3482250-1-gakhil@marvell.com>
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 <gakhil@marvell.com>
Acked-by: Kai Ji <kai.ji@intel.com>
Tested-by: Gagandeep Singh <g.singh@nxp.com>
Tested-by: David Coyle <david.coyle@intel.com>
Tested-by: Kevin O'Sullivan <kevin.osullivan@intel.com>
---
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
next prev parent reply other threads:[~2022-10-04 17:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-04 11:10 [PATCH v7 0/6] crypto/security session framework rework Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 1/6] cryptodev: rework session framework Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 2/6] crypto/scheduler: use unified session Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 3/6] cryptodev: hide sym session structure Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 4/6] security: remove priv mempool usage Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 5/6] drivers/crypto: support security session get size op Akhil Goyal
2022-10-04 11:10 ` [PATCH v7 6/6] security: hide session structure Akhil Goyal
2022-10-04 17:37 ` [PATCH v8 0/6] crypto/security session framework rework Akhil Goyal
2022-10-04 17:37 ` [PATCH v8 1/6] cryptodev: rework session framework Akhil Goyal
2022-10-04 17:37 ` [PATCH v8 2/6] crypto/scheduler: use unified session Akhil Goyal
2022-10-04 17:37 ` [PATCH v8 3/6] cryptodev: hide sym session structure Akhil Goyal
2022-10-04 17:37 ` [PATCH v8 4/6] security: remove priv mempool usage Akhil Goyal
2022-10-04 17:37 ` Akhil Goyal [this message]
2022-10-04 17:37 ` [PATCH v8 6/6] security: hide session structure Akhil Goyal
2022-10-04 20:48 ` [PATCH v8 0/6] crypto/security session framework rework Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221004173709.3482250-6-gakhil@marvell.com \
--to=gakhil@marvell.com \
--cc=adwivedi@marvell.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=anoobj@marvell.com \
--cc=beilei.xing@intel.com \
--cc=chandu@amd.com \
--cc=david.coyle@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@xilinx.com \
--cc=g.singh@nxp.com \
--cc=hemant.agrawal@nxp.com \
--cc=irusskikh@marvell.com \
--cc=jerinj@marvell.com \
--cc=jianjay.zhou@huawei.com \
--cc=jianwang@trustnetic.com \
--cc=jiawenwu@trustnetic.com \
--cc=jingjing.wu@intel.com \
--cc=kai.ji@intel.com \
--cc=kevin.osullivan@intel.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=lironh@marvell.com \
--cc=matan@nvidia.com \
--cc=maxime.coquelin@redhat.com \
--cc=ndabilpuram@marvell.com \
--cc=pablo.de.lara.guarch@intel.com \
--cc=qiming.yang@intel.com \
--cc=radu.nicolau@intel.com \
--cc=rnagadheeraj@marvell.com \
--cc=roy.fan.zhang@intel.com \
--cc=royzhang1980@gmail.com \
--cc=ruifeng.wang@arm.com \
--cc=sunilprakashrao.uttarwar@amd.com \
--cc=thomas@monjalon.net \
--cc=vattunuru@marvell.com \
--cc=wenjun1.wu@intel.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).