test/crypto: fix compilation issue without security

Message ID 20191018075613.2784-1-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/crypto: fix compilation issue without security |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

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

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

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],