[v2,2/3] test/event_crypto_adapter: fix function arguments
diff mbox series

Message ID 20200925072841.17578-3-adwivedi@marvell.com
State Superseded
Delegated to: Jerin Jacob
Headers show
Series
  • Bug fixes in event crypto adapter test application
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ankur Dwivedi Sept. 25, 2020, 7:28 a.m. UTC
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(-)

Comments

Gujjar, Abhinandan S Oct. 6, 2020, 10:21 a.m. UTC | #1
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
Ankur Dwivedi Oct. 6, 2020, 12:57 p.m. UTC | #2
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

Patch
diff mbox series

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