diff mbox series

test/crypto: fix compilation issue without security

Message ID 20191018075613.2784-1-hemant.agrawal@nxp.com
State Accepted
Commit 52dcc63d09a0fa103738ac6a258d84247585cf78
Headers show
Series test/crypto: fix compilation issue without security | expand

Commit Message

Hemant Agrawal Oct. 18, 2019, 7:56 a.m. UTC
This patch fixes the compilation issue in test_cryptodev.c
when RTE_LIBRTE_SECURITY is disabled.
Fixes: d883e6e7131b ("test/crypto: add PDCP C-Plane encap cases")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 app/test/test_cryptodev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.1

Comments

Thierry Herbelot Oct. 18, 2019, 8:07 a.m. UTC | #1
On 10/18/19 9:56 AM, Hemant Agrawal wrote:
> This patch fixes the compilation issue in test_cryptodev.c

> when RTE_LIBRTE_SECURITY is disabled.

> Fixes: d883e6e7131b ("test/crypto: add PDCP C-Plane encap cases")

> 

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---

>   app/test/test_cryptodev.c | 9 ++++++++-

>   1 file changed, 8 insertions(+), 1 deletion(-)

> 

> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c

> index 65d80837a..c4d593f34 100644

> --- a/app/test/test_cryptodev.c

> +++ b/app/test/test_cryptodev.c

> @@ -71,9 +71,13 @@ struct crypto_unittest_params {

>   

>   	union {

>   		struct rte_cryptodev_sym_session *sess;

> +#ifdef RTE_LIBRTE_SECURITY

>   		struct rte_security_session *sec_session;

> +#endif

>   	};

> +#ifdef RTE_LIBRTE_SECURITY

>   	enum rte_security_session_action_type type;

> +#endif

>   	struct rte_crypto_op *op;

>   

>   	struct rte_mbuf *obuf, *ibuf;

> @@ -573,6 +577,7 @@ ut_teardown(void)

>   	struct rte_cryptodev_stats stats;

>   

>   	/* free crypto session structure */

> +#ifdef RTE_LIBRTE_SECURITY

>   	if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {

>   		if (ut_params->sec_session) {

>   			rte_security_session_destroy(rte_cryptodev_get_sec_ctx

> @@ -580,7 +585,9 @@ ut_teardown(void)

>   						ut_params->sec_session);

>   			ut_params->sec_session = NULL;

>   		}

> -	} else {

> +	} else

> +#endif

> +	{

>   		if (ut_params->sess) {

>   			rte_cryptodev_sym_session_clear(

>   					ts_params->valid_devs[0],

> 


Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>


-- 
Thierry Herbelot
6WIND
Senior Software Engineer
Akhil Goyal Oct. 23, 2019, 2:48 p.m. UTC | #2
> On 10/18/19 9:56 AM, Hemant Agrawal wrote:

> > This patch fixes the compilation issue in test_cryptodev.c

> > when RTE_LIBRTE_SECURITY is disabled.

> > Fixes: d883e6e7131b ("test/crypto: add PDCP C-Plane encap cases")

> >

> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> > ---

> >   app/test/test_cryptodev.c | 9 ++++++++-

> >   1 file changed, 8 insertions(+), 1 deletion(-)

> >

> 

> Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>

> 

Acked-by: Akhil Goyal <akhil.goyal@nxp.com>


Applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 65d80837a..c4d593f34 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -71,9 +71,13 @@  struct crypto_unittest_params {
 
 	union {
 		struct rte_cryptodev_sym_session *sess;
+#ifdef RTE_LIBRTE_SECURITY
 		struct rte_security_session *sec_session;
+#endif
 	};
+#ifdef RTE_LIBRTE_SECURITY
 	enum rte_security_session_action_type type;
+#endif
 	struct rte_crypto_op *op;
 
 	struct rte_mbuf *obuf, *ibuf;
@@ -573,6 +577,7 @@  ut_teardown(void)
 	struct rte_cryptodev_stats stats;
 
 	/* free crypto session structure */
+#ifdef RTE_LIBRTE_SECURITY
 	if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
 		if (ut_params->sec_session) {
 			rte_security_session_destroy(rte_cryptodev_get_sec_ctx
@@ -580,7 +585,9 @@  ut_teardown(void)
 						ut_params->sec_session);
 			ut_params->sec_session = NULL;
 		}
-	} else {
+	} else
+#endif
+	{
 		if (ut_params->sess) {
 			rte_cryptodev_sym_session_clear(
 					ts_params->valid_devs[0],