DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size
@ 2018-09-07  5:55 Anoob Joseph
  2018-09-25 10:52 ` Joseph, Anoob
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anoob Joseph @ 2018-09-07  5:55 UTC (permalink / raw)
  To: Akhil Goyal, Pablo de Lara, Radu Nicolau
  Cc: Anoob Joseph, Jerin Jacob, Narayana Prasad, dev, Archana Muniganti

Crypto devices, which support lookaside protocol, exposes security
session size in addition to the crypto private symmetric session data
size. For applications using the security capabilities, both these
sizes need to be considered.

Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Archana Muniganti <muniganti.archana@caviumnetworks.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index b45b87b..47ac26a 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -1392,9 +1392,27 @@ cryptodevs_init(void)
 
 	uint32_t max_sess_sz = 0, sess_sz;
 	for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
+		void *sec_ctx;
+
+		/* Get crypto priv session size */
 		sess_sz = rte_cryptodev_sym_get_private_session_size(cdev_id);
 		if (sess_sz > max_sess_sz)
 			max_sess_sz = sess_sz;
+
+		/*
+		 * If crypto device is security capable, need to check the
+		 * size of security session as well.
+		 */
+
+		/* Get security context of the crypto device */
+		sec_ctx = rte_cryptodev_get_sec_ctx(cdev_id);
+		if (sec_ctx == NULL)
+			continue;
+
+		/* Get size of security session */
+		sess_sz = rte_security_session_get_size(sec_ctx);
+		if (sess_sz > max_sess_sz)
+			max_sess_sz = sess_sz;
 	}
 	RTE_ETH_FOREACH_DEV(port_id) {
 		void *sec_ctx;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size
  2018-09-07  5:55 [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size Anoob Joseph
@ 2018-09-25 10:52 ` Joseph, Anoob
  2018-09-25 11:01 ` Akhil Goyal
  2018-09-26 12:26 ` Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Joseph, Anoob @ 2018-09-25 10:52 UTC (permalink / raw)
  To: Akhil Goyal, Radu Nicolau
  Cc: Pablo de Lara, Jerin Jacob, Narayana Prasad, dev, Archana Muniganti

Hi Akhil, Radu,

Can you please review this patch and let me know your thoughts?

Anoob

On 07-09-2018 11:25, Anoob Joseph wrote:
> Crypto devices, which support lookaside protocol, exposes security
> session size in addition to the crypto private symmetric session data
> size. For applications using the security capabilities, both these
> sizes need to be considered.
>
> Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Signed-off-by: Archana Muniganti <muniganti.archana@caviumnetworks.com>
> ---
>   examples/ipsec-secgw/ipsec-secgw.c | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
> index b45b87b..47ac26a 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.c
> +++ b/examples/ipsec-secgw/ipsec-secgw.c
> @@ -1392,9 +1392,27 @@ cryptodevs_init(void)
>   
>   	uint32_t max_sess_sz = 0, sess_sz;
>   	for (cdev_id = 0; cdev_id < rte_cryptodev_count(); cdev_id++) {
> +		void *sec_ctx;
> +
> +		/* Get crypto priv session size */
>   		sess_sz = rte_cryptodev_sym_get_private_session_size(cdev_id);
>   		if (sess_sz > max_sess_sz)
>   			max_sess_sz = sess_sz;
> +
> +		/*
> +		 * If crypto device is security capable, need to check the
> +		 * size of security session as well.
> +		 */
> +
> +		/* Get security context of the crypto device */
> +		sec_ctx = rte_cryptodev_get_sec_ctx(cdev_id);
> +		if (sec_ctx == NULL)
> +			continue;
> +
> +		/* Get size of security session */
> +		sess_sz = rte_security_session_get_size(sec_ctx);
> +		if (sess_sz > max_sess_sz)
> +			max_sess_sz = sess_sz;
>   	}
>   	RTE_ETH_FOREACH_DEV(port_id) {
>   		void *sec_ctx;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size
  2018-09-07  5:55 [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size Anoob Joseph
  2018-09-25 10:52 ` Joseph, Anoob
@ 2018-09-25 11:01 ` Akhil Goyal
  2018-09-26 12:26 ` Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2018-09-25 11:01 UTC (permalink / raw)
  To: Anoob Joseph, Pablo de Lara, Radu Nicolau
  Cc: Jerin Jacob, Narayana Prasad, dev, Archana Muniganti



On 9/7/2018 11:25 AM, Anoob Joseph wrote:
> Crypto devices, which support lookaside protocol, exposes security
> session size in addition to the crypto private symmetric session data
> size. For applications using the security capabilities, both these
> sizes need to be considered.
>
> Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Signed-off-by: Archana Muniganti <muniganti.archana@caviumnetworks.com>
> ---
>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size
  2018-09-07  5:55 [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size Anoob Joseph
  2018-09-25 10:52 ` Joseph, Anoob
  2018-09-25 11:01 ` Akhil Goyal
@ 2018-09-26 12:26 ` Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2018-09-26 12:26 UTC (permalink / raw)
  To: Anoob Joseph, Pablo de Lara, Radu Nicolau
  Cc: Jerin Jacob, Narayana Prasad, dev, Archana Muniganti, stable



On 9/7/2018 11:25 AM, Anoob Joseph wrote:
> Crypto devices, which support lookaside protocol, exposes security
> session size in addition to the crypto private symmetric session data
> size. For applications using the security capabilities, both these
> sizes need to be considered.
>
> Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
>
> Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
> Signed-off-by: Archana Muniganti <muniganti.archana@caviumnetworks.com>
> ---
>   examples/ipsec-secgw/ipsec-secgw.c | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
cc: stable@dpdk.org
Applied to dpdk-next-crypto

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-26 12:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07  5:55 [dpdk-dev] [PATCH] examples/ipsec-secgw: fix wrong session size Anoob Joseph
2018-09-25 10:52 ` Joseph, Anoob
2018-09-25 11:01 ` Akhil Goyal
2018-09-26 12:26 ` Akhil Goyal

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).