[v1] test/event_crypto_adapter: fix runtime parameter test

Message ID 056734d7f296b5f6d8db11c3d1fb1b6fda11231b.1681752950.git.sthotton@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1] test/event_crypto_adapter: fix runtime parameter test |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing warning Testing issues
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Shijith Thotton April 17, 2023, 5:52 p.m. UTC
  The runtime parameters for the crypto adapter are applicable only for
devices without an internal port. To accommodate this, the UT has been
updated to skip the test for checking the runtime parameters if the API
to set runtime parameters is not supported.

Fixes: 04ed18cd41f1 ("eventdev/crypto: support runtime set/get parameters")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
---
 app/test/test_event_crypto_adapter.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Comments

Anoob Joseph April 18, 2023, 2:43 a.m. UTC | #1
> 
> The runtime parameters for the crypto adapter are applicable only for
> devices without an internal port. To accommodate this, the UT has been
> updated to skip the test for checking the runtime parameters if the API to set
> runtime parameters is not supported.
> 
> Fixes: 04ed18cd41f1 ("eventdev/crypto: support runtime set/get
> parameters")
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> ---
>  app/test/test_event_crypto_adapter.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

Acked-by: Anoob Joseph <anoobj@marvell.com>
  
Gujjar, Abhinandan S April 18, 2023, 3:11 a.m. UTC | #2
> -----Original Message-----
> From: Shijith Thotton <sthotton@marvell.com>
> Sent: Monday, April 17, 2023 11:22 PM
> To: jerinj@marvell.com; Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> pbhagavatula@marvell.com; stable@dpdk.org; anoobj@marvell.com; Gujjar,
> Abhinandan S <abhinandan.gujjar@intel.com>
> Subject: [PATCH v1] test/event_crypto_adapter: fix runtime parameter test
> 
> The runtime parameters for the crypto adapter are applicable only for devices
> without an internal port. To accommodate this, the UT has been updated to
> skip the test for checking the runtime parameters if the API to set runtime
> parameters is not supported.
> 
> Fixes: 04ed18cd41f1 ("eventdev/crypto: support runtime set/get
> parameters")
> 
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> ---

Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

>  app/test/test_event_crypto_adapter.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_event_crypto_adapter.c
> b/app/test/test_event_crypto_adapter.c
> index 264d6f731e..24f66be69f 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -275,7 +275,7 @@ test_crypto_adapter_stats(void)  static int
>  test_crypto_adapter_params(void)
>  {
> -	int err;
> +	int err, rc;
>  	struct rte_event_crypto_adapter_runtime_params in_params;
>  	struct rte_event_crypto_adapter_runtime_params out_params;
>  	uint32_t cap;
> @@ -303,6 +303,10 @@ test_crypto_adapter_params(void)
>  	/* Case 1: Get the default value of mbufs processed by adapter */
>  	err =
> rte_event_crypto_adapter_runtime_params_get(TEST_ADAPTER_ID,
>  							  &out_params);
> +	if (err == -ENOTSUP) {
> +		rc = TEST_SKIPPED;
> +		goto queue_pair_del;
> +	}
>  	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> 
>  	/* Case 2: Set max_nb = 32 (=BATCH_SEIZE) */ @@ -370,11 +374,13
> @@ test_crypto_adapter_params(void)
>  	TEST_ASSERT(in_params.max_nb == out_params.max_nb, "Expected
> %u got %u",
>  		    in_params.max_nb, out_params.max_nb);
> 
> +	rc = TEST_SUCCESS;
> +queue_pair_del:
>  	err = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
>  					TEST_CDEV_ID, TEST_CDEV_QP_ID);
>  	TEST_ASSERT_SUCCESS(err, "Failed to delete add queue pair\n");
> 
> -	return TEST_SUCCESS;
> +	return rc;
>  }
> 
>  static int
> --
> 2.25.1
  
Jerin Jacob May 18, 2023, 7:15 a.m. UTC | #3
On Tue, Apr 18, 2023 at 8:41 AM Gujjar, Abhinandan S
<abhinandan.gujjar@intel.com> wrote:
>
>
> > -----Original Message-----
> > From: Shijith Thotton <sthotton@marvell.com>
> > Sent: Monday, April 17, 2023 11:22 PM
> > To: jerinj@marvell.com; Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> > Cc: Shijith Thotton <sthotton@marvell.com>; dev@dpdk.org;
> > pbhagavatula@marvell.com; stable@dpdk.org; anoobj@marvell.com; Gujjar,
> > Abhinandan S <abhinandan.gujjar@intel.com>
> > Subject: [PATCH v1] test/event_crypto_adapter: fix runtime parameter test
> >
> > The runtime parameters for the crypto adapter are applicable only for devices
> > without an internal port. To accommodate this, the UT has been updated to
> > skip the test for checking the runtime parameters if the API to set runtime
> > parameters is not supported.
> >
> > Fixes: 04ed18cd41f1 ("eventdev/crypto: support runtime set/get
> > parameters")
> >
> > Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> > ---
>
> Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>


Applied to dpdk-next-net-eventdev/for-main. Thanks

>
> >  app/test/test_event_crypto_adapter.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/app/test/test_event_crypto_adapter.c
> > b/app/test/test_event_crypto_adapter.c
> > index 264d6f731e..24f66be69f 100644
> > --- a/app/test/test_event_crypto_adapter.c
> > +++ b/app/test/test_event_crypto_adapter.c
> > @@ -275,7 +275,7 @@ test_crypto_adapter_stats(void)  static int
> >  test_crypto_adapter_params(void)
> >  {
> > -     int err;
> > +     int err, rc;
> >       struct rte_event_crypto_adapter_runtime_params in_params;
> >       struct rte_event_crypto_adapter_runtime_params out_params;
> >       uint32_t cap;
> > @@ -303,6 +303,10 @@ test_crypto_adapter_params(void)
> >       /* Case 1: Get the default value of mbufs processed by adapter */
> >       err =
> > rte_event_crypto_adapter_runtime_params_get(TEST_ADAPTER_ID,
> >                                                         &out_params);
> > +     if (err == -ENOTSUP) {
> > +             rc = TEST_SKIPPED;
> > +             goto queue_pair_del;
> > +     }
> >       TEST_ASSERT(err == 0, "Expected 0 got %d", err);
> >
> >       /* Case 2: Set max_nb = 32 (=BATCH_SEIZE) */ @@ -370,11 +374,13
> > @@ test_crypto_adapter_params(void)
> >       TEST_ASSERT(in_params.max_nb == out_params.max_nb, "Expected
> > %u got %u",
> >                   in_params.max_nb, out_params.max_nb);
> >
> > +     rc = TEST_SUCCESS;
> > +queue_pair_del:
> >       err = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
> >                                       TEST_CDEV_ID, TEST_CDEV_QP_ID);
> >       TEST_ASSERT_SUCCESS(err, "Failed to delete add queue pair\n");
> >
> > -     return TEST_SUCCESS;
> > +     return rc;
> >  }
> >
> >  static int
> > --
> > 2.25.1
>
  

Patch

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 264d6f731e..24f66be69f 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -275,7 +275,7 @@  test_crypto_adapter_stats(void)
 static int
 test_crypto_adapter_params(void)
 {
-	int err;
+	int err, rc;
 	struct rte_event_crypto_adapter_runtime_params in_params;
 	struct rte_event_crypto_adapter_runtime_params out_params;
 	uint32_t cap;
@@ -303,6 +303,10 @@  test_crypto_adapter_params(void)
 	/* Case 1: Get the default value of mbufs processed by adapter */
 	err = rte_event_crypto_adapter_runtime_params_get(TEST_ADAPTER_ID,
 							  &out_params);
+	if (err == -ENOTSUP) {
+		rc = TEST_SKIPPED;
+		goto queue_pair_del;
+	}
 	TEST_ASSERT(err == 0, "Expected 0 got %d", err);
 
 	/* Case 2: Set max_nb = 32 (=BATCH_SEIZE) */
@@ -370,11 +374,13 @@  test_crypto_adapter_params(void)
 	TEST_ASSERT(in_params.max_nb == out_params.max_nb, "Expected %u got %u",
 		    in_params.max_nb, out_params.max_nb);
 
+	rc = TEST_SUCCESS;
+queue_pair_del:
 	err = rte_event_crypto_adapter_queue_pair_del(TEST_ADAPTER_ID,
 					TEST_CDEV_ID, TEST_CDEV_QP_ID);
 	TEST_ASSERT_SUCCESS(err, "Failed to delete add queue pair\n");
 
-	return TEST_SUCCESS;
+	return rc;
 }
 
 static int