DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application
@ 2020-09-08  9:15 Ankur Dwivedi
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
                   ` (3 more replies)
  0 siblings, 4 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-08  9:15 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

This patch series resolves bugs in the event crypto adapter test
application.

Ankur Dwivedi (3):
  test/event_crypto_adapter: return error with unsupported mode
  test/event_crypto_adapter: fix function arguments
  test/event_crypto_adapter: free resources during exit

 app/test/test_event_crypto_adapter.c | 63 +++++++++++++++++++---------
 1 file changed, 44 insertions(+), 19 deletions(-)

-- 
2.28.0


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

* [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-08  9:15 [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
@ 2020-09-08  9:15 ` Ankur Dwivedi
  2020-09-11  7:37   ` Gujjar, Abhinandan S
  2020-10-08  9:12   ` Jerin Jacob
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-08  9:15 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The capability of a event device should be checked before creating
a event crypto adapter in a particular mode. The test case returns
error if the mode is not supported.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 30 ++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 8d42462d8..930c2a9bc 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 	uint32_t cap;
 	int ret;
 
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		return -ENOTSUP;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		return -ENOTSUP;
+
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, mode);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
-	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
-
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
@@ -813,6 +821,8 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
 			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
 					"port=%u\n", qid,
 					params.crypto_event_port_id);
+		} else {
+			return ret;
 		}
 		crypto_adapter_setup_done = 1;
 	}
@@ -845,24 +855,24 @@ static int
 test_crypto_adapter_conf_op_forward_mode(void)
 {
 	enum rte_event_crypto_adapter_mode mode;
+	int ret;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
+	ret = test_crypto_adapter_conf(mode);
 
-	return TEST_SUCCESS;
+	return ret;
 }
 
 static int
 test_crypto_adapter_conf_op_new_mode(void)
 {
 	enum rte_event_crypto_adapter_mode mode;
+	int ret;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
+	ret = test_crypto_adapter_conf(mode);
 
-	return TEST_SUCCESS;
+	return ret;
 }
 
 
-- 
2.28.0


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

* [dpdk-dev] [PATCH 2/3] test/event_crypto_adapter: fix function arguments
  2020-09-08  9:15 [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
@ 2020-09-08  9:15 ` Ankur Dwivedi
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  3 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-08  9:15 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 930c2a9bc..811710219 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
 				&cipher_xform, params.session_priv_mpool);
 		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -321,7 +321,7 @@ test_session_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
 				params.session_mpool);
 		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -460,7 +460,7 @@ test_sessionless_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -486,7 +486,7 @@ test_session_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -706,7 +706,7 @@ test_crypto_adapter_create(void)
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, 0);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
@@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-- 
2.28.0


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

* [dpdk-dev] [PATCH 3/3] test/event_crypto_adapter: free resources during exit
  2020-09-08  9:15 [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-09-08  9:15 ` Ankur Dwivedi
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  3 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-08  9:15 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 811710219..fe85a61fb 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -896,6 +896,20 @@ testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static void
+crypto_adapter_teardown(void)
+{
+	int ret;
+
+	crypto_adapter_setup_done = 0;
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
+
+	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+}
+
 static void
 crypto_teardown(void)
 {
@@ -938,6 +952,7 @@ eventdev_teardown(void)
 static void
 testsuite_teardown(void)
 {
+	crypto_adapter_teardown();
 	crypto_teardown();
 	eventdev_teardown();
 }
-- 
2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
@ 2020-09-11  7:37   ` Gujjar, Abhinandan S
  2020-09-18  7:10     ` Gujjar, Abhinandan S
  2020-10-08  9:12   ` Jerin Jacob
  1 sibling, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-09-11  7:37 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj

Acked-by: abhinandan.gujjar@intel.com (For series)

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Tuesday, September 8, 2020 2:46 PM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> <adwivedi@marvell.com>
> Subject: [PATCH 1/3] test/event_crypto_adapter: return error with
> unsupported mode
> 
> The capability of a event device should be checked before creating a event
> crypto adapter in a particular mode. The test case returns error if the mode is
> not supported.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 30 ++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 8d42462d8..930c2a9bc 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
> rte_event_crypto_adapter_mode mode)
>  	uint32_t cap;
>  	int ret;
> 
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> +		return -ENOTSUP;
> +
> +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> +		return -ENOTSUP;
> +
>  	/* Create adapter with default port creation callback */
>  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> -					      TEST_CDEV_ID,
> +					      evdev,
>  					      &conf, mode);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
> adapter\n");
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> -
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &response_info); @@ -813,6 +821,8 @@ test_crypto_adapter_conf(enum
> rte_event_crypto_adapter_mode mode)
>  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
>  					"port=%u\n", qid,
>  					params.crypto_event_port_id);
> +		} else {
> +			return ret;
>  		}
>  		crypto_adapter_setup_done = 1;
>  	}
> @@ -845,24 +855,24 @@ static int
>  test_crypto_adapter_conf_op_forward_mode(void)
>  {
>  	enum rte_event_crypto_adapter_mode mode;
> +	int ret;
> 
>  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -				"Failed to config crypto adapter");
> +	ret = test_crypto_adapter_conf(mode);
> 
> -	return TEST_SUCCESS;
> +	return ret;
>  }
> 
>  static int
>  test_crypto_adapter_conf_op_new_mode(void)
>  {
>  	enum rte_event_crypto_adapter_mode mode;
> +	int ret;
> 
>  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -				"Failed to config crypto adapter");
> +	ret = test_crypto_adapter_conf(mode);
> 
> -	return TEST_SUCCESS;
> +	return ret;
>  }
> 
> 
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-11  7:37   ` Gujjar, Abhinandan S
@ 2020-09-18  7:10     ` Gujjar, Abhinandan S
  2020-09-18 14:34       ` Ankur Dwivedi
  0 siblings, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-09-18  7:10 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj

Hi Ankur,

This patch requires minor change. Please find the comment inline.

> -----Original Message-----
> From: Gujjar, Abhinandan S
> Sent: Friday, September 11, 2020 1:07 PM
> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> Cc: jerinj@marvell.com; anoobj@marvell.com
> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
> unsupported mode
> 
> Acked-by: abhinandan.gujjar@intel.com (For series)
> 
> > -----Original Message-----
> > From: Ankur Dwivedi <adwivedi@marvell.com>
> > Sent: Tuesday, September 8, 2020 2:46 PM
> > To: dev@dpdk.org
> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> > <adwivedi@marvell.com>
> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error with
> > unsupported mode
> >
> > The capability of a event device should be checked before creating a
> > event crypto adapter in a particular mode. The test case returns error
> > if the mode is not supported.
> >
> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > ---
> >  app/test/test_event_crypto_adapter.c | 30
> > ++++++++++++++++++----------
> >  1 file changed, 20 insertions(+), 10 deletions(-)
> >
> > diff --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index 8d42462d8..930c2a9bc 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
> > rte_event_crypto_adapter_mode mode)
> >  	uint32_t cap;
> >  	int ret;
> >
> > +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> > &cap);
> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> > +
> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
> > +	    !(cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> > +		return -ENOTSUP;
> > +
> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> > +	    !(cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> > +		return -ENOTSUP;
> > +
SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test was failing here.
Could you please bypass this check for "event_sw" and repost the patch?

> >  	/* Create adapter with default port creation callback */
> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> > -					      TEST_CDEV_ID,
> > +					      evdev,
> >  					      &conf, mode);
> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
> adapter\n");
> >
> > -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> > evdev, &cap);
> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> > -
> >  	if (cap &
> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> >  		ret =
> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> > &response_info); @@ -813,6 +821,8 @@ test_crypto_adapter_conf(enum
> > rte_event_crypto_adapter_mode mode)
> >  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
> >  					"port=%u\n", qid,
> >  					params.crypto_event_port_id);
> > +		} else {
> > +			return ret;
> >  		}
> >  		crypto_adapter_setup_done = 1;
> >  	}
> > @@ -845,24 +855,24 @@ static int
> >  test_crypto_adapter_conf_op_forward_mode(void)
> >  {
> >  	enum rte_event_crypto_adapter_mode mode;
> > +	int ret;
> >
> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> > -				"Failed to config crypto adapter");
> > +	ret = test_crypto_adapter_conf(mode);
> >
> > -	return TEST_SUCCESS;
> > +	return ret;
> >  }
> >
> >  static int
> >  test_crypto_adapter_conf_op_new_mode(void)
> >  {
> >  	enum rte_event_crypto_adapter_mode mode;
> > +	int ret;
> >
> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> > -				"Failed to config crypto adapter");
> > +	ret = test_crypto_adapter_conf(mode);
> >
> > -	return TEST_SUCCESS;
> > +	return ret;
> >  }
> >
> >
> > --
> > 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-18  7:10     ` Gujjar, Abhinandan S
@ 2020-09-18 14:34       ` Ankur Dwivedi
  2020-09-18 14:42         ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-18 14:34 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,

Please see my comments inline.

Thanks
Ankur

>-----Original Message-----
>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>Sent: Friday, September 18, 2020 12:41 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>unsupported mode
>
>External Email
>
>----------------------------------------------------------------------
>Hi Ankur,
>
>This patch requires minor change. Please find the comment inline.
>
>> -----Original Message-----
>> From: Gujjar, Abhinandan S
>> Sent: Friday, September 11, 2020 1:07 PM
>> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>> Cc: jerinj@marvell.com; anoobj@marvell.com
>> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>> unsupported mode
>>
>> Acked-by: abhinandan.gujjar@intel.com (For series)
>>
>> > -----Original Message-----
>> > From: Ankur Dwivedi <adwivedi@marvell.com>
>> > Sent: Tuesday, September 8, 2020 2:46 PM
>> > To: dev@dpdk.org
>> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
>> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
>> > <adwivedi@marvell.com>
>> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error with
>> > unsupported mode
>> >
>> > The capability of a event device should be checked before creating a
>> > event crypto adapter in a particular mode. The test case returns
>> > error if the mode is not supported.
>> >
>> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> > ---
>> >  app/test/test_event_crypto_adapter.c | 30
>> > ++++++++++++++++++----------
>> >  1 file changed, 20 insertions(+), 10 deletions(-)
>> >
>> > diff --git a/app/test/test_event_crypto_adapter.c
>> > b/app/test/test_event_crypto_adapter.c
>> > index 8d42462d8..930c2a9bc 100644
>> > --- a/app/test/test_event_crypto_adapter.c
>> > +++ b/app/test/test_event_crypto_adapter.c
>> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
>> > rte_event_crypto_adapter_mode mode)
>> >  	uint32_t cap;
>> >  	int ret;
>> >
>> > +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> > &cap);
>> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>> > +
>> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
>> > +	    !(cap &
>> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
>> > +		return -ENOTSUP;
>> > +
>> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
>> > +	    !(cap &
>> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
>> > +		return -ENOTSUP;
>> > +
>SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test was
>failing here.
>Could you please bypass this check for "event_sw" and repost the patch?
[Ankur] I was thinking of handling this by reading rte_eventdevs[evdev].data->name.
If the name matches event_sw0(which is the default device name), I will bypass if checks.
Can the event_sw device name be anything else?
Or, if there is a better way of handling this please let me know.
>
>> >  	/* Create adapter with default port creation callback */
>> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
>> > -					      TEST_CDEV_ID,
>> > +					      evdev,
>> >  					      &conf, mode);
>> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
>> adapter\n");
>> >
>> > -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> > evdev, &cap);
>> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>> > -
>> >  	if (cap &
>> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>> >  		ret =
>> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
>> > &response_info); @@ -813,6 +821,8 @@ test_crypto_adapter_conf(enum
>> > rte_event_crypto_adapter_mode mode)
>> >  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
>> >  					"port=%u\n", qid,
>> >  					params.crypto_event_port_id);
>> > +		} else {
>> > +			return ret;
>> >  		}
>> >  		crypto_adapter_setup_done = 1;
>> >  	}
>> > @@ -845,24 +855,24 @@ static int
>> >  test_crypto_adapter_conf_op_forward_mode(void)
>> >  {
>> >  	enum rte_event_crypto_adapter_mode mode;
>> > +	int ret;
>> >
>> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
>> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>> > -				"Failed to config crypto adapter");
>> > +	ret = test_crypto_adapter_conf(mode);
>> >
>> > -	return TEST_SUCCESS;
>> > +	return ret;
>> >  }
>> >
>> >  static int
>> >  test_crypto_adapter_conf_op_new_mode(void)
>> >  {
>> >  	enum rte_event_crypto_adapter_mode mode;
>> > +	int ret;
>> >
>> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
>> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>> > -				"Failed to config crypto adapter");
>> > +	ret = test_crypto_adapter_conf(mode);
>> >
>> > -	return TEST_SUCCESS;
>> > +	return ret;
>> >  }
>> >
>> >
>> > --
>> > 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-18 14:34       ` Ankur Dwivedi
@ 2020-09-18 14:42         ` Gujjar, Abhinandan S
  2020-09-18 15:03           ` Ankur Dwivedi
  0 siblings, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-09-18 14:42 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Ankur,

Please see comments inline.

Regards
Abhinandan

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Friday, September 18, 2020 8:05 PM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>
> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
> unsupported mode
> 
> Hi Abhinandan,
> 
> Please see my comments inline.
> 
> Thanks
> Ankur
> 
> >-----Original Message-----
> >From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> >Sent: Friday, September 18, 2020 12:41 PM
> >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> >Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> ><anoobj@marvell.com>
> >Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return error
> >with unsupported mode
> >
> >External Email
> >
> >----------------------------------------------------------------------
> >Hi Ankur,
> >
> >This patch requires minor change. Please find the comment inline.
> >
> >> -----Original Message-----
> >> From: Gujjar, Abhinandan S
> >> Sent: Friday, September 11, 2020 1:07 PM
> >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> >> Cc: jerinj@marvell.com; anoobj@marvell.com
> >> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
> >> unsupported mode
> >>
> >> Acked-by: abhinandan.gujjar@intel.com (For series)
> >>
> >> > -----Original Message-----
> >> > From: Ankur Dwivedi <adwivedi@marvell.com>
> >> > Sent: Tuesday, September 8, 2020 2:46 PM
> >> > To: dev@dpdk.org
> >> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> >> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> >> > <adwivedi@marvell.com>
> >> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error with
> >> > unsupported mode
> >> >
> >> > The capability of a event device should be checked before creating
> >> > a event crypto adapter in a particular mode. The test case returns
> >> > error if the mode is not supported.
> >> >
> >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> >> > ---
> >> >  app/test/test_event_crypto_adapter.c | 30
> >> > ++++++++++++++++++----------
> >> >  1 file changed, 20 insertions(+), 10 deletions(-)
> >> >
> >> > diff --git a/app/test/test_event_crypto_adapter.c
> >> > b/app/test/test_event_crypto_adapter.c
> >> > index 8d42462d8..930c2a9bc 100644
> >> > --- a/app/test/test_event_crypto_adapter.c
> >> > +++ b/app/test/test_event_crypto_adapter.c
> >> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
> >> > rte_event_crypto_adapter_mode mode)
> >> >  	uint32_t cap;
> >> >  	int ret;
> >> >
> >> > +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> >> > &cap);
> >> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> >> > +
> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
> >> > +	    !(cap &
> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> >> > +		return -ENOTSUP;
> >> > +
> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> >> > +	    !(cap &
> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> >> > +		return -ENOTSUP;
> >> > +
> >SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test was
> >failing here.
> >Could you please bypass this check for "event_sw" and repost the patch?
> [Ankur] I was thinking of handling this by reading
> rte_eventdevs[evdev].data->name.
> If the name matches event_sw0(which is the default device name), I will
> bypass if checks.
> Can the event_sw device name be anything else?
> Or, if there is a better way of handling this please let me know.
Yes. You can also use rte_event_dev_info_get(evdev, &info) and check info.driver_name for "event_sw".

> >
> >> >  	/* Create adapter with default port creation callback */
> >> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> >> > -					      TEST_CDEV_ID,
> >> > +					      evdev,
> >> >  					      &conf, mode);
> >> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
> >> adapter\n");
> >> >
> >> > -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> >> > evdev, &cap);
> >> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> >> > -
> >> >  	if (cap &
> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> >> >  		ret =
> >> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> >> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &response_info); @@ -813,6
> >> > +821,8 @@ test_crypto_adapter_conf(enum
> >> > rte_event_crypto_adapter_mode mode)
> >> >  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
> >> >  					"port=%u\n", qid,
> >> >  					params.crypto_event_port_id);
> >> > +		} else {
> >> > +			return ret;
> >> >  		}
> >> >  		crypto_adapter_setup_done = 1;
> >> >  	}
> >> > @@ -845,24 +855,24 @@ static int
> >> >  test_crypto_adapter_conf_op_forward_mode(void)
> >> >  {
> >> >  	enum rte_event_crypto_adapter_mode mode;
> >> > +	int ret;
> >> >
> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> >> > -				"Failed to config crypto adapter");
> >> > +	ret = test_crypto_adapter_conf(mode);
> >> >
> >> > -	return TEST_SUCCESS;
> >> > +	return ret;
> >> >  }
> >> >
> >> >  static int
> >> >  test_crypto_adapter_conf_op_new_mode(void)
> >> >  {
> >> >  	enum rte_event_crypto_adapter_mode mode;
> >> > +	int ret;
> >> >
> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> >> > -				"Failed to config crypto adapter");
> >> > +	ret = test_crypto_adapter_conf(mode);
> >> >
> >> > -	return TEST_SUCCESS;
> >> > +	return ret;
> >> >  }
> >> >
> >> >
> >> > --
> >> > 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-18 14:42         ` Gujjar, Abhinandan S
@ 2020-09-18 15:03           ` Ankur Dwivedi
  2020-09-23  5:31             ` Ankur Dwivedi
  0 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-18 15:03 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,

Please see my comments inline.

Thanks
Ankur

>-----Original Message-----
>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>Sent: Friday, September 18, 2020 8:13 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>unsupported mode
>
>External Email
>
>----------------------------------------------------------------------
>Hi Ankur,
>
>Please see comments inline.
>
>Regards
>Abhinandan
>
>> -----Original Message-----
>> From: Ankur Dwivedi <adwivedi@marvell.com>
>> Sent: Friday, September 18, 2020 8:05 PM
>> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
>> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
>> <anoobj@marvell.com>
>> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>> unsupported mode
>>
>> Hi Abhinandan,
>>
>> Please see my comments inline.
>>
>> Thanks
>> Ankur
>>
>> >-----Original Message-----
>> >From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>> >Sent: Friday, September 18, 2020 12:41 PM
>> >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>> >Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
>> ><anoobj@marvell.com>
>> >Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return
>> >error with unsupported mode
>> >
>> >External Email
>> >
>> >---------------------------------------------------------------------
>> >-
>> >Hi Ankur,
>> >
>> >This patch requires minor change. Please find the comment inline.
>> >
>> >> -----Original Message-----
>> >> From: Gujjar, Abhinandan S
>> >> Sent: Friday, September 11, 2020 1:07 PM
>> >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>> >> Cc: jerinj@marvell.com; anoobj@marvell.com
>> >> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error
>> >> with unsupported mode
>> >>
>> >> Acked-by: abhinandan.gujjar@intel.com (For series)
>> >>
>> >> > -----Original Message-----
>> >> > From: Ankur Dwivedi <adwivedi@marvell.com>
>> >> > Sent: Tuesday, September 8, 2020 2:46 PM
>> >> > To: dev@dpdk.org
>> >> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
>> >> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
>> >> > <adwivedi@marvell.com>
>> >> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error with
>> >> > unsupported mode
>> >> >
>> >> > The capability of a event device should be checked before
>> >> > creating a event crypto adapter in a particular mode. The test
>> >> > case returns error if the mode is not supported.
>> >> >
>> >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> >> > ---
>> >> >  app/test/test_event_crypto_adapter.c | 30
>> >> > ++++++++++++++++++----------
>> >> >  1 file changed, 20 insertions(+), 10 deletions(-)
>> >> >
>> >> > diff --git a/app/test/test_event_crypto_adapter.c
>> >> > b/app/test/test_event_crypto_adapter.c
>> >> > index 8d42462d8..930c2a9bc 100644
>> >> > --- a/app/test/test_event_crypto_adapter.c
>> >> > +++ b/app/test/test_event_crypto_adapter.c
>> >> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
>> >> > rte_event_crypto_adapter_mode mode)
>> >> >  	uint32_t cap;
>> >> >  	int ret;
>> >> >
>> >> > +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> >> > &cap);
>> >> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
>> >> > +capabilities\n");
>> >> > +
>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
>> >> > +	    !(cap &
>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
>> >> > +		return -ENOTSUP;
>> >> > +
>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
>> >> > +	    !(cap &
>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
>> >> > +		return -ENOTSUP;
>> >> > +
>> >SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test
>> >was failing here.
>> >Could you please bypass this check for "event_sw" and repost the patch?
>> [Ankur] I was thinking of handling this by reading
>> rte_eventdevs[evdev].data->name.
>> If the name matches event_sw0(which is the default device name), I
>> will bypass if checks.
>> Can the event_sw device name be anything else?
>> Or, if there is a better way of handling this please let me know.
>Yes. You can also use rte_event_dev_info_get(evdev, &info) and check
>info.driver_name for "event_sw".
[Ankur] Thanks for the suggestion. I will try this and make the required changes in v2.
>
>> >
>> >> >  	/* Create adapter with default port creation callback */
>> >> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
>> >> > -					      TEST_CDEV_ID,
>> >> > +					      evdev,
>> >> >  					      &conf, mode);
>> >> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
>> >> adapter\n");
>> >> >
>> >> > -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> >> > evdev, &cap);
>> >> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>> >> > -
>> >> >  	if (cap &
>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>> >> >  		ret =
>> >> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>> >> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
>> &response_info); @@ -813,6
>> >> > +821,8 @@ test_crypto_adapter_conf(enum
>> >> > rte_event_crypto_adapter_mode mode)
>> >> >  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
>> >> >  					"port=%u\n", qid,
>> >> >  					params.crypto_event_port_id);
>> >> > +		} else {
>> >> > +			return ret;
>> >> >  		}
>> >> >  		crypto_adapter_setup_done = 1;
>> >> >  	}
>> >> > @@ -845,24 +855,24 @@ static int
>> >> >  test_crypto_adapter_conf_op_forward_mode(void)
>> >> >  {
>> >> >  	enum rte_event_crypto_adapter_mode mode;
>> >> > +	int ret;
>> >> >
>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>> >> > -				"Failed to config crypto adapter");
>> >> > +	ret = test_crypto_adapter_conf(mode);
>> >> >
>> >> > -	return TEST_SUCCESS;
>> >> > +	return ret;
>> >> >  }
>> >> >
>> >> >  static int
>> >> >  test_crypto_adapter_conf_op_new_mode(void)
>> >> >  {
>> >> >  	enum rte_event_crypto_adapter_mode mode;
>> >> > +	int ret;
>> >> >
>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>> >> > -				"Failed to config crypto adapter");
>> >> > +	ret = test_crypto_adapter_conf(mode);
>> >> >
>> >> > -	return TEST_SUCCESS;
>> >> > +	return ret;
>> >> >  }
>> >> >
>> >> >
>> >> > --
>> >> > 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-18 15:03           ` Ankur Dwivedi
@ 2020-09-23  5:31             ` Ankur Dwivedi
  2020-09-23  7:17               ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-23  5:31 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,

Please see my comments inline.

Thanks
Ankur

>-----Original Message-----
>From: Ankur Dwivedi
>Sent: Friday, September 18, 2020 8:34 PM
>To: 'Gujjar, Abhinandan S' <abhinandan.gujjar@intel.com>; dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>unsupported mode
>
>Hi Abhinandan,
>
>Please see my comments inline.
>
>Thanks
>Ankur
>
>>-----Original Message-----
>>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>>Sent: Friday, September 18, 2020 8:13 PM
>>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
>><anoobj@marvell.com>
>>Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return error
>>with unsupported mode
>>
>>External Email
>>
>>----------------------------------------------------------------------
>>Hi Ankur,
>>
>>Please see comments inline.
>>
>>Regards
>>Abhinandan
>>
>>> -----Original Message-----
>>> From: Ankur Dwivedi <adwivedi@marvell.com>
>>> Sent: Friday, September 18, 2020 8:05 PM
>>> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
>>> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
>>> <anoobj@marvell.com>
>>> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
>>> unsupported mode
>>>
>>> Hi Abhinandan,
>>>
>>> Please see my comments inline.
>>>
>>> Thanks
>>> Ankur
>>>
>>> >-----Original Message-----
>>> >From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>>> >Sent: Friday, September 18, 2020 12:41 PM
>>> >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>>> >Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
>>> ><anoobj@marvell.com>
>>> >Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return
>>> >error with unsupported mode
>>> >
>>> >External Email
>>> >
>>> >--------------------------------------------------------------------
>>> >-
>>> >-
>>> >Hi Ankur,
>>> >
>>> >This patch requires minor change. Please find the comment inline.
>>> >
>>> >> -----Original Message-----
>>> >> From: Gujjar, Abhinandan S
>>> >> Sent: Friday, September 11, 2020 1:07 PM
>>> >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>>> >> Cc: jerinj@marvell.com; anoobj@marvell.com
>>> >> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error
>>> >> with unsupported mode
>>> >>
>>> >> Acked-by: abhinandan.gujjar@intel.com (For series)
>>> >>
>>> >> > -----Original Message-----
>>> >> > From: Ankur Dwivedi <adwivedi@marvell.com>
>>> >> > Sent: Tuesday, September 8, 2020 2:46 PM
>>> >> > To: dev@dpdk.org
>>> >> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
>>> >> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
>>> >> > <adwivedi@marvell.com>
>>> >> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error
>>> >> > with unsupported mode
>>> >> >
>>> >> > The capability of a event device should be checked before
>>> >> > creating a event crypto adapter in a particular mode. The test
>>> >> > case returns error if the mode is not supported.
>>> >> >
>>> >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>>> >> > ---
>>> >> >  app/test/test_event_crypto_adapter.c | 30
>>> >> > ++++++++++++++++++----------
>>> >> >  1 file changed, 20 insertions(+), 10 deletions(-)
>>> >> >
>>> >> > diff --git a/app/test/test_event_crypto_adapter.c
>>> >> > b/app/test/test_event_crypto_adapter.c
>>> >> > index 8d42462d8..930c2a9bc 100644
>>> >> > --- a/app/test/test_event_crypto_adapter.c
>>> >> > +++ b/app/test/test_event_crypto_adapter.c
>>> >> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
>>> >> > rte_event_crypto_adapter_mode mode)
>>> >> >  	uint32_t cap;
>>> >> >  	int ret;
>>> >> >
>>> >> > +	ret = rte_event_crypto_adapter_caps_get(evdev,
>TEST_CDEV_ID,
>>> >> > &cap);
>>> >> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
>>> >> > +capabilities\n");
>>> >> > +
>>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
>&&
>>> >> > +	    !(cap &
>>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
>>> >> > +		return -ENOTSUP;
>>> >> > +
>>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
>>> >> > +	    !(cap &
>>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
>>> >> > +		return -ENOTSUP;
>>> >> > +
>>> >SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test
>>> >was failing here.
>>> >Could you please bypass this check for "event_sw" and repost the patch?
>>> [Ankur] I was thinking of handling this by reading
>>> rte_eventdevs[evdev].data->name.
>>> If the name matches event_sw0(which is the default device name), I
>>> will bypass if checks.
>>> Can the event_sw device name be anything else?
>>> Or, if there is a better way of handling this please let me know.
>>Yes. You can also use rte_event_dev_info_get(evdev, &info) and check
>>info.driver_name for "event_sw".
>[Ankur] Thanks for the suggestion. I will try this and make the required
>changes in v2.
[Ankur] I thought of an alternative to implement the above. If the capability 
does not have any *_INTERNAL_PORT_* caps, it will be a SW PMD. Is this correct? 
In that case capability will be used to skip the if checks instead of the pmd specific
name comparison. Please let me know your thoughts on this.
>>
>>> >
>>> >> >  	/* Create adapter with default port creation callback */
>>> >> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
>>> >> > -					      TEST_CDEV_ID,
>>> >> > +					      evdev,
>>> >> >  					      &conf, mode);
>>> >> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
>>> >> adapter\n");
>>> >> >
>>> >> > -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>>> >> > evdev, &cap);
>>> >> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
>capabilities\n");
>>> >> > -
>>> >> >  	if (cap &
>>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>>> >> >  		ret =
>>> >> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>>> >> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
>>> &response_info); @@ -813,6
>>> >> > +821,8 @@ test_crypto_adapter_conf(enum
>>> >> > rte_event_crypto_adapter_mode mode)
>>> >> >  			TEST_ASSERT(ret >= 0, "Failed to link queue
>%d "
>>> >> >  					"port=%u\n", qid,
>>> >> >
>	params.crypto_event_port_id);
>>> >> > +		} else {
>>> >> > +			return ret;
>>> >> >  		}
>>> >> >  		crypto_adapter_setup_done = 1;
>>> >> >  	}
>>> >> > @@ -845,24 +855,24 @@ static int
>>> >> >  test_crypto_adapter_conf_op_forward_mode(void)
>>> >> >  {
>>> >> >  	enum rte_event_crypto_adapter_mode mode;
>>> >> > +	int ret;
>>> >> >
>>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
>>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>>> >> > -				"Failed to config crypto adapter");
>>> >> > +	ret = test_crypto_adapter_conf(mode);
>>> >> >
>>> >> > -	return TEST_SUCCESS;
>>> >> > +	return ret;
>>> >> >  }
>>> >> >
>>> >> >  static int
>>> >> >  test_crypto_adapter_conf_op_new_mode(void)
>>> >> >  {
>>> >> >  	enum rte_event_crypto_adapter_mode mode;
>>> >> > +	int ret;
>>> >> >
>>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
>>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
>>> >> > -				"Failed to config crypto adapter");
>>> >> > +	ret = test_crypto_adapter_conf(mode);
>>> >> >
>>> >> > -	return TEST_SUCCESS;
>>> >> > +	return ret;
>>> >> >  }
>>> >> >
>>> >> >
>>> >> > --
>>> >> > 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-23  5:31             ` Ankur Dwivedi
@ 2020-09-23  7:17               ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-09-23  7:17 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Ankur,

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Wednesday, September 23, 2020 11:02 AM
> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> <anoobj@marvell.com>
> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
> unsupported mode
> 
> Hi Abhinandan,
> 
> Please see my comments inline.
> 
> Thanks
> Ankur
> 
> >-----Original Message-----
> >From: Ankur Dwivedi
> >Sent: Friday, September 18, 2020 8:34 PM
> >To: 'Gujjar, Abhinandan S' <abhinandan.gujjar@intel.com>; dev@dpdk.org
> >Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> ><anoobj@marvell.com>
> >Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error with
> >unsupported mode
> >
> >Hi Abhinandan,
> >
> >Please see my comments inline.
> >
> >Thanks
> >Ankur
> >
> >>-----Original Message-----
> >>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> >>Sent: Friday, September 18, 2020 8:13 PM
> >>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> >>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> >><anoobj@marvell.com>
> >>Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return error
> >>with unsupported mode
> >>
> >>External Email
> >>
> >>----------------------------------------------------------------------
> >>Hi Ankur,
> >>
> >>Please see comments inline.
> >>
> >>Regards
> >>Abhinandan
> >>
> >>> -----Original Message-----
> >>> From: Ankur Dwivedi <adwivedi@marvell.com>
> >>> Sent: Friday, September 18, 2020 8:05 PM
> >>> To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> dev@dpdk.org
> >>> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> >>> <anoobj@marvell.com>
> >>> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error
> >>> with unsupported mode
> >>>
> >>> Hi Abhinandan,
> >>>
> >>> Please see my comments inline.
> >>>
> >>> Thanks
> >>> Ankur
> >>>
> >>> >-----Original Message-----
> >>> >From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> >>> >Sent: Friday, September 18, 2020 12:41 PM
> >>> >To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> >>> >Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
> >>> ><anoobj@marvell.com>
> >>> >Subject: [EXT] RE: [PATCH 1/3] test/event_crypto_adapter: return
> >>> >error with unsupported mode
> >>> >
> >>> >External Email
> >>> >
> >>> >-------------------------------------------------------------------
> >>> >-
> >>> >-
> >>> >-
> >>> >Hi Ankur,
> >>> >
> >>> >This patch requires minor change. Please find the comment inline.
> >>> >
> >>> >> -----Original Message-----
> >>> >> From: Gujjar, Abhinandan S
> >>> >> Sent: Friday, September 11, 2020 1:07 PM
> >>> >> To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
> >>> >> Cc: jerinj@marvell.com; anoobj@marvell.com
> >>> >> Subject: RE: [PATCH 1/3] test/event_crypto_adapter: return error
> >>> >> with unsupported mode
> >>> >>
> >>> >> Acked-by: abhinandan.gujjar@intel.com (For series)
> >>> >>
> >>> >> > -----Original Message-----
> >>> >> > From: Ankur Dwivedi <adwivedi@marvell.com>
> >>> >> > Sent: Tuesday, September 8, 2020 2:46 PM
> >>> >> > To: dev@dpdk.org
> >>> >> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> >>> >> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> >>> >> > <adwivedi@marvell.com>
> >>> >> > Subject: [PATCH 1/3] test/event_crypto_adapter: return error
> >>> >> > with unsupported mode
> >>> >> >
> >>> >> > The capability of a event device should be checked before
> >>> >> > creating a event crypto adapter in a particular mode. The test
> >>> >> > case returns error if the mode is not supported.
> >>> >> >
> >>> >> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> >>> >> > ---
> >>> >> >  app/test/test_event_crypto_adapter.c | 30
> >>> >> > ++++++++++++++++++----------
> >>> >> >  1 file changed, 20 insertions(+), 10 deletions(-)
> >>> >> >
> >>> >> > diff --git a/app/test/test_event_crypto_adapter.c
> >>> >> > b/app/test/test_event_crypto_adapter.c
> >>> >> > index 8d42462d8..930c2a9bc 100644
> >>> >> > --- a/app/test/test_event_crypto_adapter.c
> >>> >> > +++ b/app/test/test_event_crypto_adapter.c
> >>> >> > @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum
> >>> >> > rte_event_crypto_adapter_mode mode)
> >>> >> >  	uint32_t cap;
> >>> >> >  	int ret;
> >>> >> >
> >>> >> > +	ret = rte_event_crypto_adapter_caps_get(evdev,
> >TEST_CDEV_ID,
> >>> >> > &cap);
> >>> >> > +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> >>> >> > +capabilities\n");
> >>> >> > +
> >>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD)
> >&&
> >>> >> > +	    !(cap &
> >>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> >>> >> > +		return -ENOTSUP;
> >>> >> > +
> >>> >> > +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> >>> >> > +	    !(cap &
> >>> >> > RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> >>> >> > +		return -ENOTSUP;
> >>> >> > +
> >>> >SW adapter does not have *_INTERNAL_PORT_* caps. Just noticed test
> >>> >was failing here.
> >>> >Could you please bypass this check for "event_sw" and repost the
> patch?
> >>> [Ankur] I was thinking of handling this by reading
> >>> rte_eventdevs[evdev].data->name.
> >>> If the name matches event_sw0(which is the default device name), I
> >>> will bypass if checks.
> >>> Can the event_sw device name be anything else?
> >>> Or, if there is a better way of handling this please let me know.
> >>Yes. You can also use rte_event_dev_info_get(evdev, &info) and check
> >>info.driver_name for "event_sw".
> >[Ankur] Thanks for the suggestion. I will try this and make the
> >required changes in v2.
> [Ankur] I thought of an alternative to implement the above. If the capability
> does not have any *_INTERNAL_PORT_* caps, it will be a SW PMD. Is this
> correct?
> In that case capability will be used to skip the if checks instead of the pmd
> specific name comparison. Please let me know your thoughts on this.
Right now, SW has only " RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA " as caps.
See, if you can use this info and continue to execute the test without returning error.
> >>
> >>> >
> >>> >> >  	/* Create adapter with default port creation callback */
> >>> >> >  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> >>> >> > -					      TEST_CDEV_ID,
> >>> >> > +					      evdev,
> >>> >> >  					      &conf, mode);
> >>> >> >  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
> >>> >> adapter\n");
> >>> >> >
> >>> >> > -	ret =
> rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> >>> >> > evdev, &cap);
> >>> >> > -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> >capabilities\n");
> >>> >> > -
> >>> >> >  	if (cap &
> >>> >> >
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> >>> >> >  		ret =
> >>> >> > rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
> >>> >> >  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> >>> &response_info); @@ -813,6
> >>> >> > +821,8 @@ test_crypto_adapter_conf(enum
> >>> >> > rte_event_crypto_adapter_mode mode)
> >>> >> >  			TEST_ASSERT(ret >= 0, "Failed to link queue
> >%d "
> >>> >> >  					"port=%u\n", qid,
> >>> >> >
> >	params.crypto_event_port_id);
> >>> >> > +		} else {
> >>> >> > +			return ret;
> >>> >> >  		}
> >>> >> >  		crypto_adapter_setup_done = 1;
> >>> >> >  	}
> >>> >> > @@ -845,24 +855,24 @@ static int
> >>> >> >  test_crypto_adapter_conf_op_forward_mode(void)
> >>> >> >  {
> >>> >> >  	enum rte_event_crypto_adapter_mode mode;
> >>> >> > +	int ret;
> >>> >> >
> >>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> >>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> >>> >> > -				"Failed to config crypto adapter");
> >>> >> > +	ret = test_crypto_adapter_conf(mode);
> >>> >> >
> >>> >> > -	return TEST_SUCCESS;
> >>> >> > +	return ret;
> >>> >> >  }
> >>> >> >
> >>> >> >  static int
> >>> >> >  test_crypto_adapter_conf_op_new_mode(void)
> >>> >> >  {
> >>> >> >  	enum rte_event_crypto_adapter_mode mode;
> >>> >> > +	int ret;
> >>> >> >
> >>> >> >  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> >>> >> > -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> >>> >> > -				"Failed to config crypto adapter");
> >>> >> > +	ret = test_crypto_adapter_conf(mode);
> >>> >> >
> >>> >> > -	return TEST_SUCCESS;
> >>> >> > +	return ret;
> >>> >> >  }
> >>> >> >
> >>> >> >
> >>> >> > --
> >>> >> > 2.28.0


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

* [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application
  2020-09-08  9:15 [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
                   ` (2 preceding siblings ...)
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-09-25  7:28 ` Ankur Dwivedi
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
                     ` (4 more replies)
  3 siblings, 5 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

This patch series resolves bugs in the event crypto adapter test
application.

v2:
* In the "test/event_crypto_adapter: return error with unsupported mode"
  patch the following changes were done:
  - Skip mismatch of mode and capability for software eventdev.
  - In test_crypto_adapter_conf_op_new_mode() and
    test_crypto_adapter_conf_op_forward_mode(),the local variable
    for holding return of test_crypto_adapter_conf() is removed.
  - Minor change in commit message.

Ankur Dwivedi (3):
  test/event_crypto_adapter: return error with unsupported mode
  test/event_crypto_adapter: fix function arguments
  test/event_crypto_adapter: free resources during exit

 app/test/test_event_crypto_adapter.c | 66 ++++++++++++++++++++--------
 1 file changed, 47 insertions(+), 19 deletions(-)

-- 
2.28.0


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

* [dpdk-dev] [PATCH v2 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
@ 2020-09-25  7:28   ` Ankur Dwivedi
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The capability of a hardware event device should be checked before
creating a event crypto adapter in a particular mode. The test case
returns error if the mode is not supported.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 33 +++++++++++++++++++---------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 8d42462d8..3c64742b3 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -750,15 +750,30 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 	uint32_t cap;
 	int ret;
 
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	/* Skip mode and capability mismatch check for SW eventdev */
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND))
+		goto adapter_create;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		return -ENOTSUP;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		return -ENOTSUP;
+
+adapter_create:
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, mode);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
-	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
-
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
@@ -813,6 +828,8 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
 			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
 					"port=%u\n", qid,
 					params.crypto_event_port_id);
+		} else {
+			return ret;
 		}
 		crypto_adapter_setup_done = 1;
 	}
@@ -847,10 +864,8 @@ test_crypto_adapter_conf_op_forward_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 static int
@@ -859,10 +874,8 @@ test_crypto_adapter_conf_op_new_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 
-- 
2.28.0


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

* [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
@ 2020-09-25  7:28   ` Ankur Dwivedi
  2020-10-06 10:21     ` Gujjar, Abhinandan S
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 3c64742b3..572ef9c27 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
 				&cipher_xform, params.session_priv_mpool);
 		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -321,7 +321,7 @@ test_session_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
 				params.session_mpool);
 		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -460,7 +460,7 @@ test_sessionless_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -486,7 +486,7 @@ test_session_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -706,7 +706,7 @@ test_crypto_adapter_create(void)
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, 0);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
@@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-- 
2.28.0


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

* [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-09-25  7:28   ` Ankur Dwivedi
  2020-10-06 10:21     ` Gujjar, Abhinandan S
  2020-10-05  9:43   ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Jerin Jacob
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  4 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-09-25  7:28 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 572ef9c27..4b09ab3b7 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -899,6 +899,20 @@ testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static void
+crypto_adapter_teardown(void)
+{
+	int ret;
+
+	crypto_adapter_setup_done = 0;
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
+
+	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+}
+
 static void
 crypto_teardown(void)
 {
@@ -941,6 +955,7 @@ eventdev_teardown(void)
 static void
 testsuite_teardown(void)
 {
+	crypto_adapter_teardown();
 	crypto_teardown();
 	eventdev_teardown();
 }
-- 
2.28.0


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

* Re: [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
                     ` (2 preceding siblings ...)
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-10-05  9:43   ` Jerin Jacob
  2020-10-05  9:48     ` Gujjar, Abhinandan S
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  4 siblings, 1 reply; 35+ messages in thread
From: Jerin Jacob @ 2020-10-05  9:43 UTC (permalink / raw)
  To: Ankur Dwivedi; +Cc: dpdk-dev, Gujjar, Abhinandan S, Jerin Jacob, Anoob Joseph

On Fri, Sep 25, 2020 at 12:59 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> This patch series resolves bugs in the event crypto adapter test
> application.
>
> v2:
> * In the "test/event_crypto_adapter: return error with unsupported mode"
>   patch the following changes were done:
>   - Skip mismatch of mode and capability for software eventdev.
>   - In test_crypto_adapter_conf_op_new_mode() and
>     test_crypto_adapter_conf_op_forward_mode(),the local variable
>     for holding return of test_crypto_adapter_conf() is removed.
>   - Minor change in commit message.

@Gujjar, Abhinandan S ,
Could you review the v2?

>
> Ankur Dwivedi (3):
>   test/event_crypto_adapter: return error with unsupported mode
>   test/event_crypto_adapter: fix function arguments
>   test/event_crypto_adapter: free resources during exit
>
>  app/test/test_event_crypto_adapter.c | 66 ++++++++++++++++++++--------
>  1 file changed, 47 insertions(+), 19 deletions(-)
>
> --
> 2.28.0
>

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

* Re: [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application
  2020-10-05  9:43   ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Jerin Jacob
@ 2020-10-05  9:48     ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-05  9:48 UTC (permalink / raw)
  To: Jerin Jacob, Ankur Dwivedi; +Cc: dpdk-dev, Jerin Jacob, Anoob Joseph

Sure Jerin. I will send the response by tomorrow.

Regards
Abhinandan

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Monday, October 5, 2020 3:14 PM
> To: Ankur Dwivedi <adwivedi@marvell.com>
> Cc: dpdk-dev <dev@dpdk.org>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; Jerin Jacob <jerinj@marvell.com>; Anoob
> Joseph <anoobj@marvell.com>
> Subject: Re: [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test
> application
> 
> On Fri, Sep 25, 2020 at 12:59 PM Ankur Dwivedi <adwivedi@marvell.com>
> wrote:
> >
> > This patch series resolves bugs in the event crypto adapter test
> > application.
> >
> > v2:
> > * In the "test/event_crypto_adapter: return error with unsupported
> mode"
> >   patch the following changes were done:
> >   - Skip mismatch of mode and capability for software eventdev.
> >   - In test_crypto_adapter_conf_op_new_mode() and
> >     test_crypto_adapter_conf_op_forward_mode(),the local variable
> >     for holding return of test_crypto_adapter_conf() is removed.
> >   - Minor change in commit message.
> 
> @Gujjar, Abhinandan S ,
> Could you review the v2?
> 
> >
> > Ankur Dwivedi (3):
> >   test/event_crypto_adapter: return error with unsupported mode
> >   test/event_crypto_adapter: fix function arguments
> >   test/event_crypto_adapter: free resources during exit
> >
> >  app/test/test_event_crypto_adapter.c | 66
> > ++++++++++++++++++++--------
> >  1 file changed, 47 insertions(+), 19 deletions(-)
> >
> > --
> > 2.28.0
> >

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

* Re: [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-10-06 10:21     ` Gujjar, Abhinandan S
  2020-10-06 12:57       ` Ankur Dwivedi
  0 siblings, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-06 10:21 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj

Hi Ankur,

Overall, it looks good. 
You have missed out fixing caps args in one place line #299 of test_sessionless_with_op_forward_mode().

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Friday, September 25, 2020 12:59 PM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> <adwivedi@marvell.com>
> Subject: [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments
> 
> The arguments passed to rte_event_crypto_adapter_caps_get() and
> rte_event_crypto_adapter_create() are incorrect.
> 
> In the rte_event_crypto_adapter_caps_get(), event device id should be the
> first argument and cryptodev id should be the second argument.
> In the rte_event_crypto_adapter_create(), the event device id should be
> the second argument.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 3c64742b3..572ef9c27 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
>  				&cipher_xform,
> params.session_priv_mpool);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
> 
> -		ret =
> rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> -							evdev, &cap);
> +		ret = rte_event_crypto_adapter_caps_get(evdev,
> TEST_CDEV_ID,
> +							&cap);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> capabilities\n");
> 
>  		if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -321,7
> +321,7 @@ test_session_with_op_forward_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
>  				params.session_mpool);
>  		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
> 
> -		ret =
> rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> -							evdev, &cap);
> +		ret = rte_event_crypto_adapter_caps_get(evdev,
> TEST_CDEV_ID,
> +							&cap);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> capabilities\n");
> 
>  		if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -460,7
> +460,7 @@ test_sessionless_with_op_new_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 486,7 +486,7 @@ test_session_with_op_new_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 706,7 +706,7 @@ test_crypto_adapter_create(void)
> 
>  	/* Create adapter with default port creation callback */
>  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> -					      TEST_CDEV_ID,
> +					      evdev,
>  					      &conf, 0);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto
> adapter\n");
> 
> @@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> evdev, &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit
  2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-10-06 10:21     ` Gujjar, Abhinandan S
  2020-10-06 10:29       ` Gujjar, Abhinandan S
  0 siblings, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-06 10:21 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj

Hi Ankur,

Please see comment below.

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Friday, September 25, 2020 12:59 PM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> <adwivedi@marvell.com>
> Subject: [PATCH v2 3/3] test/event_crypto_adapter: free resources during
> exit
> 
> The resources held by crypto adapter should be freed when the test suite
> exits.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 572ef9c27..4b09ab3b7 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -899,6 +899,20 @@ testsuite_setup(void)
>  	return TEST_SUCCESS;
>  }
> 
> +static void
> +crypto_adapter_teardown(void)
> +{
> +	int ret;
> +
> +	crypto_adapter_setup_done = 0;
Call rte_event_crypto_adapter_stop() here?
> +	ret =
> rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
> +					TEST_CDEV_ID, TEST_CDEV_QP_ID);
> +	if (ret < 0)
> +		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
> +
> +	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
> +}
> +
>  static void
>  crypto_teardown(void)
>  {
> @@ -941,6 +955,7 @@ eventdev_teardown(void)  static void
>  testsuite_teardown(void)
>  {
> +	crypto_adapter_teardown();
>  	crypto_teardown();
>  	eventdev_teardown();
>  }
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit
  2020-10-06 10:21     ` Gujjar, Abhinandan S
@ 2020-10-06 10:29       ` Gujjar, Abhinandan S
  2020-10-06 13:00         ` Ankur Dwivedi
  0 siblings, 1 reply; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-06 10:29 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj



> -----Original Message-----
> From: Gujjar, Abhinandan S
> Sent: Tuesday, October 6, 2020 3:52 PM
> To: 'Ankur Dwivedi' <adwivedi@marvell.com>; dev@dpdk.org
> Cc: jerinj@marvell.com; anoobj@marvell.com
> Subject: RE: [PATCH v2 3/3] test/event_crypto_adapter: free resources
> during exit
> 
> Hi Ankur,
> 
> Please see comment below.
> 
> > -----Original Message-----
> > From: Ankur Dwivedi <adwivedi@marvell.com>
> > Sent: Friday, September 25, 2020 12:59 PM
> > To: dev@dpdk.org
> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
> > <adwivedi@marvell.com>
> > Subject: [PATCH v2 3/3] test/event_crypto_adapter: free resources
> > during exit
> >
> > The resources held by crypto adapter should be freed when the test
> > suite exits.
> >
> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> > ---
> >  app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index 572ef9c27..4b09ab3b7 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -899,6 +899,20 @@ testsuite_setup(void)
> >  	return TEST_SUCCESS;
> >  }
> >
> > +static void
> > +crypto_adapter_teardown(void)
> > +{
> > +	int ret;
> > +

Below APIs could return error. So, set this flag at the end?
> > +	crypto_adapter_setup_done = 0; 

> Call rte_event_crypto_adapter_stop() here?
> > +	ret =
> > rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
> > +					TEST_CDEV_ID, TEST_CDEV_QP_ID);
> > +	if (ret < 0)
> > +		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
> > +
> > +	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
> > +}
> > +
> >  static void
> >  crypto_teardown(void)
> >  {
> > @@ -941,6 +955,7 @@ eventdev_teardown(void)  static void
> >  testsuite_teardown(void)
> >  {
> > +	crypto_adapter_teardown();
> >  	crypto_teardown();
> >  	eventdev_teardown();
> >  }
> > --
> > 2.28.0


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

* Re: [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments
  2020-10-06 10:21     ` Gujjar, Abhinandan S
@ 2020-10-06 12:57       ` Ankur Dwivedi
  0 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-06 12:57 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,

Please see my comments inline.

Thanks
Ankur

>-----Original Message-----
>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>Sent: Tuesday, October 6, 2020 3:52 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: [EXT] RE: [PATCH v2 2/3] test/event_crypto_adapter: fix function
>arguments
>
>External Email
>
>----------------------------------------------------------------------
>Hi Ankur,
>
>Overall, it looks good.
>You have missed out fixing caps args in one place line #299 of
>test_sessionless_with_op_forward_mode().
[Ankur] I will fix this in v3.
>
>> -----Original Message-----
>> From: Ankur Dwivedi <adwivedi@marvell.com>
>> Sent: Friday, September 25, 2020 12:59 PM
>> To: dev@dpdk.org
>> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
>> jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
>> <adwivedi@marvell.com>
>> Subject: [PATCH v2 2/3] test/event_crypto_adapter: fix function
>> arguments
>>
>> The arguments passed to rte_event_crypto_adapter_caps_get() and
>> rte_event_crypto_adapter_create() are incorrect.
>>
>> In the rte_event_crypto_adapter_caps_get(), event device id should be
>> the first argument and cryptodev id should be the second argument.
>> In the rte_event_crypto_adapter_create(), the event device id should
>> be the second argument.
>>
>> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> ---
>>  app/test/test_event_crypto_adapter.c | 18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/app/test/test_event_crypto_adapter.c
>> b/app/test/test_event_crypto_adapter.c
>> index 3c64742b3..572ef9c27 100644
>> --- a/app/test/test_event_crypto_adapter.c
>> +++ b/app/test/test_event_crypto_adapter.c
>> @@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
>>  				&cipher_xform,
>> params.session_priv_mpool);
>>  		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
>>
>> -		ret =
>> rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> -							evdev, &cap);
>> +		ret = rte_event_crypto_adapter_caps_get(evdev,
>> TEST_CDEV_ID,
>> +							&cap);
>>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
>capabilities\n");
>>
>>  		if (cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -321,7
>> +321,7 @@ test_session_with_op_forward_mode(void)
>>  	uint32_t cap;
>>  	int ret;
>>
>> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> evdev, &cap);
>> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> &cap);
>>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>>
>>  	if (!(cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
>> 410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
>>  				params.session_mpool);
>>  		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
>>
>> -		ret =
>> rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> -							evdev, &cap);
>> +		ret = rte_event_crypto_adapter_caps_get(evdev,
>> TEST_CDEV_ID,
>> +							&cap);
>>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
>capabilities\n");
>>
>>  		if (cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -460,7
>> +460,7 @@ test_sessionless_with_op_new_mode(void)
>>  	uint32_t cap;
>>  	int ret;
>>
>> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> evdev, &cap);
>> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> &cap);
>>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>>
>>  	if (!(cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
>> 486,7 +486,7 @@ test_session_with_op_new_mode(void)
>>  	uint32_t cap;
>>  	int ret;
>>
>> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> evdev, &cap);
>> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> &cap);
>>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>>
>>  	if (!(cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
>> 706,7 +706,7 @@ test_crypto_adapter_create(void)
>>
>>  	/* Create adapter with default port creation callback */
>>  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
>> -					      TEST_CDEV_ID,
>> +					      evdev,
>>  					      &conf, 0);
>>  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
>>
>> @@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
>>  	uint32_t cap;
>>  	int ret;
>>
>> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
>> evdev, &cap);
>> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
>> &cap);
>>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
>>
>>  	if (cap &
>> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>> --
>> 2.28.0


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

* Re: [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit
  2020-10-06 10:29       ` Gujjar, Abhinandan S
@ 2020-10-06 13:00         ` Ankur Dwivedi
  0 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-06 13:00 UTC (permalink / raw)
  To: Gujjar, Abhinandan S, dev; +Cc: Jerin Jacob Kollanukkaran, Anoob Joseph

Hi Abhinandan,

Please see my comments inline.

Thanks
Ankur

>-----Original Message-----
>From: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
>Sent: Tuesday, October 6, 2020 4:00 PM
>To: Ankur Dwivedi <adwivedi@marvell.com>; dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Anoob Joseph
><anoobj@marvell.com>
>Subject: [EXT] RE: [PATCH v2 3/3] test/event_crypto_adapter: free resources
>during exit
>
>External Email
>
>----------------------------------------------------------------------
>
>
>> -----Original Message-----
>> From: Gujjar, Abhinandan S
>> Sent: Tuesday, October 6, 2020 3:52 PM
>> To: 'Ankur Dwivedi' <adwivedi@marvell.com>; dev@dpdk.org
>> Cc: jerinj@marvell.com; anoobj@marvell.com
>> Subject: RE: [PATCH v2 3/3] test/event_crypto_adapter: free resources
>> during exit
>>
>> Hi Ankur,
>>
>> Please see comment below.
>>
>> > -----Original Message-----
>> > From: Ankur Dwivedi <adwivedi@marvell.com>
>> > Sent: Friday, September 25, 2020 12:59 PM
>> > To: dev@dpdk.org
>> > Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>;
>> > jerinj@marvell.com; anoobj@marvell.com; Ankur Dwivedi
>> > <adwivedi@marvell.com>
>> > Subject: [PATCH v2 3/3] test/event_crypto_adapter: free resources
>> > during exit
>> >
>> > The resources held by crypto adapter should be freed when the test
>> > suite exits.
>> >
>> > Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
>> > ---
>> >  app/test/test_event_crypto_adapter.c | 15 +++++++++++++++
>> >  1 file changed, 15 insertions(+)
>> >
>> > diff --git a/app/test/test_event_crypto_adapter.c
>> > b/app/test/test_event_crypto_adapter.c
>> > index 572ef9c27..4b09ab3b7 100644
>> > --- a/app/test/test_event_crypto_adapter.c
>> > +++ b/app/test/test_event_crypto_adapter.c
>> > @@ -899,6 +899,20 @@ testsuite_setup(void)
>> >  	return TEST_SUCCESS;
>> >  }
>> >
>> > +static void
>> > +crypto_adapter_teardown(void)
>> > +{
>> > +	int ret;
>> > +
>
>Below APIs could return error. So, set this flag at the end?
[Ankur] Will make the change in v3.
>> > +	crypto_adapter_setup_done = 0;
>
>> Call rte_event_crypto_adapter_stop() here?
[Ankur] Will make the change in v3.
>> > +	ret =
>> > rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
>> > +					TEST_CDEV_ID, TEST_CDEV_QP_ID);
>> > +	if (ret < 0)
>> > +		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
>> > +
>> > +	rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
>> > +}
>> > +
>> >  static void
>> >  crypto_teardown(void)
>> >  {
>> > @@ -941,6 +955,7 @@ eventdev_teardown(void)  static void
>> >  testsuite_teardown(void)
>> >  {
>> > +	crypto_adapter_teardown();
>> >  	crypto_teardown();
>> >  	eventdev_teardown();
>> >  }
>> > --
>> > 2.28.0


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

* [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test
  2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
                     ` (3 preceding siblings ...)
  2020-10-05  9:43   ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Jerin Jacob
@ 2020-10-07  5:26   ` Ankur Dwivedi
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
                       ` (3 more replies)
  4 siblings, 4 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-07  5:26 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

This patch series resolves bugs in the event crypto adapter test
application.

v3:
* In the "test/event_crypto_adapter: fix function arguments" patch,
  fixed arguments of rte_event_crypto_adapter_caps_get().
* In the "test/event_crypto_adapter: free resources during exit" patch,
  the following changes were done:
  - Added rte_event_crypto_adapter_stop() in crypto_adapter_teardown().
  - Checking the return value of rte_event_crypto_adapter_free().
  - Moved crypto_adapter_setup_done flag to the end.

v2:
* In the "test/event_crypto_adapter: return error with unsupported mode"
  patch the following changes were done:
  - Skip mismatch of mode and capability for software eventdev.
  - In test_crypto_adapter_conf_op_new_mode() and
    test_crypto_adapter_conf_op_forward_mode(),the local variable
    for holding return of test_crypto_adapter_conf() is removed.
  - Minor change in commit message.

Ankur Dwivedi (3):
  test/event_crypto_adapter: return error with unsupported mode
  test/event_crypto_adapter: fix function arguments
  test/event_crypto_adapter: free resources during exit

 app/test/test_event_crypto_adapter.c | 75 ++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 20 deletions(-)

-- 
2.28.0


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

* [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
@ 2020-10-07  5:26     ` Ankur Dwivedi
  2020-10-08  7:25       ` Gujjar, Abhinandan S
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-07  5:26 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The capability of a hardware event device should be checked before
creating a event crypto adapter in a particular mode. The test case
returns error if the mode is not supported.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 33 +++++++++++++++++++---------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 8d42462d8..3c64742b3 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -750,15 +750,30 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 	uint32_t cap;
 	int ret;
 
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	/* Skip mode and capability mismatch check for SW eventdev */
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND))
+		goto adapter_create;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		return -ENOTSUP;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		return -ENOTSUP;
+
+adapter_create:
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, mode);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
-	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
-
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
@@ -813,6 +828,8 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
 			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
 					"port=%u\n", qid,
 					params.crypto_event_port_id);
+		} else {
+			return ret;
 		}
 		crypto_adapter_setup_done = 1;
 	}
@@ -847,10 +864,8 @@ test_crypto_adapter_conf_op_forward_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 static int
@@ -859,10 +874,8 @@ test_crypto_adapter_conf_op_new_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 
-- 
2.28.0


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

* [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
@ 2020-10-07  5:26     ` Ankur Dwivedi
  2020-10-08  7:26       ` Gujjar, Abhinandan S
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  3 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-07  5:26 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 3c64742b3..87a67139d 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
 				&cipher_xform, params.session_priv_mpool);
 		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -296,7 +296,7 @@ test_sessionless_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -321,7 +321,7 @@ test_session_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
 				params.session_mpool);
 		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -460,7 +460,7 @@ test_sessionless_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -486,7 +486,7 @@ test_session_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -706,7 +706,7 @@ test_crypto_adapter_create(void)
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, 0);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
@@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-- 
2.28.0


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

* [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-10-07  5:26     ` Ankur Dwivedi
  2020-10-08  7:26       ` Gujjar, Abhinandan S
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  3 siblings, 1 reply; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-07  5:26 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 87a67139d..d6fbbfdde 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -899,6 +899,27 @@ testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static void
+crypto_adapter_teardown(void)
+{
+	int ret;
+
+	ret = rte_event_crypto_adapter_stop(TEST_ADAPTER_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to stop adapter!");
+
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
+
+	ret = rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to free adapter!");
+
+	crypto_adapter_setup_done = 0;
+}
+
 static void
 crypto_teardown(void)
 {
@@ -941,6 +962,7 @@ eventdev_teardown(void)
 static void
 testsuite_teardown(void)
 {
+	crypto_adapter_teardown();
 	crypto_teardown();
 	eventdev_teardown();
 }
-- 
2.28.0


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

* Re: [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
@ 2020-10-08  7:25       ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-08  7:25 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj

acked-by: abhinandan.gujjar@intel.com

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Wednesday, October 7, 2020 10:56 AM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; jerinj@marvell.com;
> anoobj@marvell.com; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: [PATCH v3 1/3] test/event_crypto_adapter: return error with
> unsupported mode
> 
> The capability of a hardware event device should be checked before creating a
> event crypto adapter in a particular mode. The test case returns error if the
> mode is not supported.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 33 +++++++++++++++++++---------
>  1 file changed, 23 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 8d42462d8..3c64742b3 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -750,15 +750,30 @@ configure_event_crypto_adapter(enum
> rte_event_crypto_adapter_mode mode)
>  	uint32_t cap;
>  	int ret;
> 
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
> +	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +	/* Skip mode and capability mismatch check for SW eventdev */
> +	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND))
> +		goto adapter_create;
> +
> +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> +		return -ENOTSUP;
> +
> +	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> +	    !(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> +		return -ENOTSUP;
> +
> +adapter_create:
>  	/* Create adapter with default port creation callback */
>  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> -					      TEST_CDEV_ID,
> +					      evdev,
>  					      &conf, mode);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> -	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> -
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>  		ret =
> rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>  				TEST_CDEV_ID, TEST_CDEV_QP_ID,
> &response_info); @@ -813,6 +828,8 @@ test_crypto_adapter_conf(enum
> rte_event_crypto_adapter_mode mode)
>  			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
>  					"port=%u\n", qid,
>  					params.crypto_event_port_id);
> +		} else {
> +			return ret;
>  		}
>  		crypto_adapter_setup_done = 1;
>  	}
> @@ -847,10 +864,8 @@ test_crypto_adapter_conf_op_forward_mode(void)
>  	enum rte_event_crypto_adapter_mode mode;
> 
>  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -				"Failed to config crypto adapter");
> 
> -	return TEST_SUCCESS;
> +	return test_crypto_adapter_conf(mode);
>  }
> 
>  static int
> @@ -859,10 +874,8 @@ test_crypto_adapter_conf_op_new_mode(void)
>  	enum rte_event_crypto_adapter_mode mode;
> 
>  	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> -	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -				"Failed to config crypto adapter");
> 
> -	return TEST_SUCCESS;
> +	return test_crypto_adapter_conf(mode);
>  }
> 
> 
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-10-08  7:26       ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-08  7:26 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj, Vangati, Narender

acked-by: abhinandan.gujjar@intel.com

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Wednesday, October 7, 2020 10:56 AM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; jerinj@marvell.com;
> anoobj@marvell.com; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments
> 
> The arguments passed to rte_event_crypto_adapter_caps_get() and
> rte_event_crypto_adapter_create() are incorrect.
> 
> In the rte_event_crypto_adapter_caps_get(), event device id should be the first
> argument and cryptodev id should be the second argument.
> In the rte_event_crypto_adapter_create(), the event device id should be the
> second argument.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 3c64742b3..87a67139d 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
>  				&cipher_xform, params.session_priv_mpool);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
> 
> -		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> -							evdev, &cap);
> +		ret = rte_event_crypto_adapter_caps_get(evdev,
> TEST_CDEV_ID,
> +							&cap);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> capabilities\n");
> 
>  		if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -296,7
> +296,7 @@ test_sessionless_with_op_forward_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 321,7 +321,7 @@ test_session_with_op_forward_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
>  				params.session_mpool);
>  		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
> 
> -		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
> -							evdev, &cap);
> +		ret = rte_event_crypto_adapter_caps_get(evdev,
> TEST_CDEV_ID,
> +							&cap);
>  		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter
> capabilities\n");
> 
>  		if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -460,7
> +460,7 @@ test_sessionless_with_op_new_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 486,7 +486,7 @@ test_session_with_op_new_mode(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (!(cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -
> 706,7 +706,7 @@ test_crypto_adapter_create(void)
> 
>  	/* Create adapter with default port creation callback */
>  	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> -					      TEST_CDEV_ID,
> +					      evdev,
>  					      &conf, 0);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
> 
> @@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
>  	uint32_t cap;
>  	int ret;
> 
> -	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev,
> &cap);
> +	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
> &cap);
>  	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> 
>  	if (cap &
> RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-10-08  7:26       ` Gujjar, Abhinandan S
  0 siblings, 0 replies; 35+ messages in thread
From: Gujjar, Abhinandan S @ 2020-10-08  7:26 UTC (permalink / raw)
  To: Ankur Dwivedi, dev; +Cc: jerinj, anoobj, Vangati, Narender

acked-by: abhinandan.gujjar@intel.com

> -----Original Message-----
> From: Ankur Dwivedi <adwivedi@marvell.com>
> Sent: Wednesday, October 7, 2020 10:56 AM
> To: dev@dpdk.org
> Cc: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; jerinj@marvell.com;
> anoobj@marvell.com; Ankur Dwivedi <adwivedi@marvell.com>
> Subject: [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit
> 
> The resources held by crypto adapter should be freed when the test suite exits.
> 
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 87a67139d..d6fbbfdde 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -899,6 +899,27 @@ testsuite_setup(void)
>  	return TEST_SUCCESS;
>  }
> 
> +static void
> +crypto_adapter_teardown(void)
> +{
> +	int ret;
> +
> +	ret = rte_event_crypto_adapter_stop(TEST_ADAPTER_ID);
> +	if (ret < 0)
> +		RTE_LOG(ERR, USER1, "Failed to stop adapter!");
> +
> +	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
> +					TEST_CDEV_ID, TEST_CDEV_QP_ID);
> +	if (ret < 0)
> +		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
> +
> +	ret = rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
> +	if (ret < 0)
> +		RTE_LOG(ERR, USER1, "Failed to free adapter!");
> +
> +	crypto_adapter_setup_done = 0;
> +}
> +
>  static void
>  crypto_teardown(void)
>  {
> @@ -941,6 +962,7 @@ eventdev_teardown(void)  static void
>  testsuite_teardown(void)
>  {
> +	crypto_adapter_teardown();
>  	crypto_teardown();
>  	eventdev_teardown();
>  }
> --
> 2.28.0


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

* Re: [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode
  2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
  2020-09-11  7:37   ` Gujjar, Abhinandan S
@ 2020-10-08  9:12   ` Jerin Jacob
  1 sibling, 0 replies; 35+ messages in thread
From: Jerin Jacob @ 2020-10-08  9:12 UTC (permalink / raw)
  To: Ankur Dwivedi; +Cc: dpdk-dev, Gujjar, Abhinandan S, Jerin Jacob, Anoob Joseph

On Tue, Sep 8, 2020 at 2:48 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> The capability of a event device should be checked before creating
> a event crypto adapter in a particular mode. The test case returns
> error if the mode is not supported.
>
> Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>

Hi Ankur,

Please fix git-log.sh error[1] the following in this series and send
the version.

Headline too long:
        test/event_crypto_adapter: return error with unsupported mode
Wrong tag:
        acked-by: abhinandan.gujjar@intel.com
        acked-by: abhinandan.gujjar@intel.com
        acked-by: abhinandan.gujjar@intel.com
Missing 'Fixes' tag:
        test/event_crypto_adapter: fix function arguments

[1]
./devtools/check-git-log.sh -n 3
./devtools/checkpatches.sh -n 3


> ---
>  app/test/test_event_crypto_adapter.c | 30 ++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
>
> diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
> index 8d42462d8..930c2a9bc 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -750,15 +750,23 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
>         uint32_t cap;
>         int ret;
>
> +       ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
> +       TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> +
> +       if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
> +           !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
> +               return -ENOTSUP;
> +
> +       if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
> +           !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
> +               return -ENOTSUP;
> +
>         /* Create adapter with default port creation callback */
>         ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
> -                                             TEST_CDEV_ID,
> +                                             evdev,
>                                               &conf, mode);
>         TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
>
> -       ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
> -       TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
> -
>         if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
>                 ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
>                                 TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
> @@ -813,6 +821,8 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
>                         TEST_ASSERT(ret >= 0, "Failed to link queue %d "
>                                         "port=%u\n", qid,
>                                         params.crypto_event_port_id);
> +               } else {
> +                       return ret;
>                 }
>                 crypto_adapter_setup_done = 1;
>         }
> @@ -845,24 +855,24 @@ static int
>  test_crypto_adapter_conf_op_forward_mode(void)
>  {
>         enum rte_event_crypto_adapter_mode mode;
> +       int ret;
>
>         mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
> -       TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -                               "Failed to config crypto adapter");
> +       ret = test_crypto_adapter_conf(mode);
>
> -       return TEST_SUCCESS;
> +       return ret;
>  }
>
>  static int
>  test_crypto_adapter_conf_op_new_mode(void)
>  {
>         enum rte_event_crypto_adapter_mode mode;
> +       int ret;
>
>         mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
> -       TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
> -                               "Failed to config crypto adapter");
> +       ret = test_crypto_adapter_conf(mode);
>
> -       return TEST_SUCCESS;
> +       return ret;
>  }
>
>
> --
> 2.28.0
>

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

* [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test
  2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
                       ` (2 preceding siblings ...)
  2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-10-08 12:52     ` Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 1/3] test/event_crypto_adapter: return error for unsupported mode Ankur Dwivedi
                         ` (3 more replies)
  3 siblings, 4 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-08 12:52 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

This patch series resolves bugs in the event crypto adapter test
application.

v4:
The following check-git-log.sh errors were resolved:
* Resolved wrong acked by tag in all the 3 patches.
* In the "test/event_crypto_adapter: return error for unsupported mode"
  patch, resolved "Headline too long" error.
* In the "test/event_crypto_adapter: fix function arguments" patch,
  added Fixes tag.

v3:
* In the "test/event_crypto_adapter: fix function arguments" patch,
  fixed arguments of rte_event_crypto_adapter_caps_get().
* In the "test/event_crypto_adapter: free resources during exit" patch,
  the following changes were done:
  - Added rte_event_crypto_adapter_stop() in crypto_adapter_teardown().
  - Checking the return value of rte_event_crypto_adapter_free().
  - Moved crypto_adapter_setup_done flag to the end.

v2:
* In the "test/event_crypto_adapter: return error with unsupported mode"
  patch the following changes were done:
  - Skip mismatch of mode and capability for software eventdev.
  - In test_crypto_adapter_conf_op_new_mode() and
    test_crypto_adapter_conf_op_forward_mode(),the local variable
    for holding return of test_crypto_adapter_conf() is removed.
  - Minor change in commit message.

Ankur Dwivedi (3):
  test/event_crypto_adapter: return error for unsupported mode
  test/event_crypto_adapter: fix function arguments
  test/event_crypto_adapter: free resources during exit

 app/test/test_event_crypto_adapter.c | 75 ++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 20 deletions(-)

-- 
2.28.0


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

* [dpdk-dev] [PATCH v4 1/3] test/event_crypto_adapter: return error for unsupported mode
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
@ 2020-10-08 12:52       ` Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-08 12:52 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The capability of a hardware event device should be checked before
creating a event crypto adapter in a particular mode. The test case
returns error if the mode is not supported.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 app/test/test_event_crypto_adapter.c | 33 +++++++++++++++++++---------
 1 file changed, 23 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 8d42462d8..3c64742b3 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -750,15 +750,30 @@ configure_event_crypto_adapter(enum rte_event_crypto_adapter_mode mode)
 	uint32_t cap;
 	int ret;
 
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
+	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
+
+	/* Skip mode and capability mismatch check for SW eventdev */
+	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND))
+		goto adapter_create;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+		return -ENOTSUP;
+
+	if ((mode == RTE_EVENT_CRYPTO_ADAPTER_OP_NEW) &&
+	    !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+		return -ENOTSUP;
+
+adapter_create:
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, mode);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
-	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
-
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
 		ret = rte_event_crypto_adapter_queue_pair_add(TEST_ADAPTER_ID,
 				TEST_CDEV_ID, TEST_CDEV_QP_ID, &response_info);
@@ -813,6 +828,8 @@ test_crypto_adapter_conf(enum rte_event_crypto_adapter_mode mode)
 			TEST_ASSERT(ret >= 0, "Failed to link queue %d "
 					"port=%u\n", qid,
 					params.crypto_event_port_id);
+		} else {
+			return ret;
 		}
 		crypto_adapter_setup_done = 1;
 	}
@@ -847,10 +864,8 @@ test_crypto_adapter_conf_op_forward_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 static int
@@ -859,10 +874,8 @@ test_crypto_adapter_conf_op_new_mode(void)
 	enum rte_event_crypto_adapter_mode mode;
 
 	mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
-	TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
-				"Failed to config crypto adapter");
 
-	return TEST_SUCCESS;
+	return test_crypto_adapter_conf(mode);
 }
 
 
-- 
2.28.0


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

* [dpdk-dev] [PATCH v4 2/3] test/event_crypto_adapter: fix function arguments
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 1/3] test/event_crypto_adapter: return error for unsupported mode Ankur Dwivedi
@ 2020-10-08 12:52       ` Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
  2020-10-08 15:00       ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Jerin Jacob
  3 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-08 12:52 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The arguments passed to rte_event_crypto_adapter_caps_get() and
rte_event_crypto_adapter_create() are incorrect.

In the rte_event_crypto_adapter_caps_get(), event device id should
be the first argument and cryptodev id should be the second argument.
In the rte_event_crypto_adapter_create(), the event device id should
be the second argument.

Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 app/test/test_event_crypto_adapter.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 3c64742b3..87a67139d 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -209,8 +209,8 @@ test_op_forward_mode(uint8_t session_less)
 				&cipher_xform, params.session_priv_mpool);
 		TEST_ASSERT_SUCCESS(ret, "Failed to init session\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -296,7 +296,7 @@ test_sessionless_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -321,7 +321,7 @@ test_session_with_op_forward_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -410,8 +410,8 @@ test_op_new_mode(uint8_t session_less)
 				params.session_mpool);
 		TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n");
 
-		ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID,
-							evdev, &cap);
+		ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID,
+							&cap);
 		TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
@@ -460,7 +460,7 @@ test_sessionless_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -486,7 +486,7 @@ test_session_with_op_new_mode(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
@@ -706,7 +706,7 @@ test_crypto_adapter_create(void)
 
 	/* Create adapter with default port creation callback */
 	ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID,
-					      TEST_CDEV_ID,
+					      evdev,
 					      &conf, 0);
 	TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n");
 
@@ -719,7 +719,7 @@ test_crypto_adapter_qp_add_del(void)
 	uint32_t cap;
 	int ret;
 
-	ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
+	ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
 
 	if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) {
-- 
2.28.0


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

* [dpdk-dev] [PATCH v4 3/3] test/event_crypto_adapter: free resources during exit
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 1/3] test/event_crypto_adapter: return error for unsupported mode Ankur Dwivedi
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
@ 2020-10-08 12:52       ` Ankur Dwivedi
  2020-10-08 15:00       ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Jerin Jacob
  3 siblings, 0 replies; 35+ messages in thread
From: Ankur Dwivedi @ 2020-10-08 12:52 UTC (permalink / raw)
  To: dev; +Cc: abhinandan.gujjar, jerinj, anoobj, Ankur Dwivedi

The resources held by crypto adapter should be freed when the
test suite exits.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
---
 app/test/test_event_crypto_adapter.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 87a67139d..d6fbbfdde 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -899,6 +899,27 @@ testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static void
+crypto_adapter_teardown(void)
+{
+	int ret;
+
+	ret = rte_event_crypto_adapter_stop(TEST_ADAPTER_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to stop adapter!");
+
+	ret = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
+					TEST_CDEV_ID, TEST_CDEV_QP_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to delete queue pair!");
+
+	ret = rte_event_crypto_adapter_free(TEST_ADAPTER_ID);
+	if (ret < 0)
+		RTE_LOG(ERR, USER1, "Failed to free adapter!");
+
+	crypto_adapter_setup_done = 0;
+}
+
 static void
 crypto_teardown(void)
 {
@@ -941,6 +962,7 @@ eventdev_teardown(void)
 static void
 testsuite_teardown(void)
 {
+	crypto_adapter_teardown();
 	crypto_teardown();
 	eventdev_teardown();
 }
-- 
2.28.0


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

* Re: [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test
  2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
                         ` (2 preceding siblings ...)
  2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
@ 2020-10-08 15:00       ` Jerin Jacob
  3 siblings, 0 replies; 35+ messages in thread
From: Jerin Jacob @ 2020-10-08 15:00 UTC (permalink / raw)
  To: Ankur Dwivedi; +Cc: dpdk-dev, Gujjar, Abhinandan S, Jerin Jacob, Anoob Joseph

On Thu, Oct 8, 2020 at 6:22 PM Ankur Dwivedi <adwivedi@marvell.com> wrote:
>
> This patch series resolves bugs in the event crypto adapter test
> application.
>
> v4:
> The following check-git-log.sh errors were resolved:
> * Resolved wrong acked by tag in all the 3 patches.
> * In the "test/event_crypto_adapter: return error for unsupported mode"
>   patch, resolved "Headline too long" error.
> * In the "test/event_crypto_adapter: fix function arguments" patch,
>   added Fixes tag.
>
> v3:
> * In the "test/event_crypto_adapter: fix function arguments" patch,
>   fixed arguments of rte_event_crypto_adapter_caps_get().
> * In the "test/event_crypto_adapter: free resources during exit" patch,
>   the following changes were done:
>   - Added rte_event_crypto_adapter_stop() in crypto_adapter_teardown().
>   - Checking the return value of rte_event_crypto_adapter_free().
>   - Moved crypto_adapter_setup_done flag to the end.
>
> v2:
> * In the "test/event_crypto_adapter: return error with unsupported mode"
>   patch the following changes were done:
>   - Skip mismatch of mode and capability for software eventdev.
>   - In test_crypto_adapter_conf_op_new_mode() and
>     test_crypto_adapter_conf_op_forward_mode(),the local variable
>     for holding return of test_crypto_adapter_conf() is removed.
>   - Minor change in commit message.
>
> Ankur Dwivedi (3):
>   test/event_crypto_adapter: return error for unsupported mode
>   test/event_crypto_adapter: fix function arguments
>   test/event_crypto_adapter: free resources during exit


Series applied to dpdk-next-eventdev/for-main. Thanks.




>
>  app/test/test_event_crypto_adapter.c | 75 ++++++++++++++++++++--------
>  1 file changed, 55 insertions(+), 20 deletions(-)
>
> --
> 2.28.0
>

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

end of thread, back to index

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08  9:15 [dpdk-dev] [PATCH 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
2020-09-08  9:15 ` [dpdk-dev] [PATCH 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
2020-09-11  7:37   ` Gujjar, Abhinandan S
2020-09-18  7:10     ` Gujjar, Abhinandan S
2020-09-18 14:34       ` Ankur Dwivedi
2020-09-18 14:42         ` Gujjar, Abhinandan S
2020-09-18 15:03           ` Ankur Dwivedi
2020-09-23  5:31             ` Ankur Dwivedi
2020-09-23  7:17               ` Gujjar, Abhinandan S
2020-10-08  9:12   ` Jerin Jacob
2020-09-08  9:15 ` [dpdk-dev] [PATCH 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
2020-09-08  9:15 ` [dpdk-dev] [PATCH 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
2020-09-25  7:28 ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Ankur Dwivedi
2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
2020-10-06 10:21     ` Gujjar, Abhinandan S
2020-10-06 12:57       ` Ankur Dwivedi
2020-09-25  7:28   ` [dpdk-dev] [PATCH v2 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
2020-10-06 10:21     ` Gujjar, Abhinandan S
2020-10-06 10:29       ` Gujjar, Abhinandan S
2020-10-06 13:00         ` Ankur Dwivedi
2020-10-05  9:43   ` [dpdk-dev] [PATCH v2 0/3] Bug fixes in event crypto adapter test application Jerin Jacob
2020-10-05  9:48     ` Gujjar, Abhinandan S
2020-10-07  5:26   ` [dpdk-dev] [PATCH v3 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 1/3] test/event_crypto_adapter: return error with unsupported mode Ankur Dwivedi
2020-10-08  7:25       ` Gujjar, Abhinandan S
2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
2020-10-08  7:26       ` Gujjar, Abhinandan S
2020-10-07  5:26     ` [dpdk-dev] [PATCH v3 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
2020-10-08  7:26       ` Gujjar, Abhinandan S
2020-10-08 12:52     ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Ankur Dwivedi
2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 1/3] test/event_crypto_adapter: return error for unsupported mode Ankur Dwivedi
2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 2/3] test/event_crypto_adapter: fix function arguments Ankur Dwivedi
2020-10-08 12:52       ` [dpdk-dev] [PATCH v4 3/3] test/event_crypto_adapter: free resources during exit Ankur Dwivedi
2020-10-08 15:00       ` [dpdk-dev] [PATCH v4 0/3] Bug fixes in event crypto adapter test Jerin Jacob

DPDK patches and discussions

Archives are clonable:
	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox