[v5,2/7] app/bbdev: add explicit check for counters

Message ID 1603496581-35966-3-git-send-email-nicolas.chautru@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series BBDEV test updates |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chautru, Nicolas Oct. 23, 2020, 11:42 p.m. UTC
  Adding explicit check in ut that the stats counters
have the expect values. Was missing for coverage.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
---
 app/test-bbdev/test_bbdev_perf.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Comments

Tom Rix Oct. 26, 2020, 1:05 p.m. UTC | #1
On 10/23/20 4:42 PM, Nicolas Chautru wrote:
> Adding explicit check in ut that the stats counters
> have the expect values. Was missing for coverage.

missing from coverage

?

>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
> Acked-by: Dave Burley <dave.burley@accelercomm.com>
> ---
>  app/test-bbdev/test_bbdev_perf.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 3554a77..b62848e 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -4840,6 +4840,23 @@ typedef int (test_case_function)(struct active_device *ad,
>  			(double)(time_st.deq_max_time * 1000000) /
>  			rte_get_tsc_hz());
>  
> +	struct rte_bbdev_stats stats = {0};
Other calls to get_bbdev_queue_stats do not initialize stats and likely should
> +	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
Should check the return here.
> +	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {

This logic seems off.

Do you mean to check only enc stats with an enc op ?

Similar for dec.

> +		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
> +				"Mismatch in enqueue count %10"PRIu64" %d",
> +				stats.enqueued_count, num_to_process);
> +		TEST_ASSERT_SUCCESS(stats.dequeued_count != num_to_process,
> +				"Mismatch in dequeue count %10"PRIu64" %d",
> +				stats.dequeued_count, num_to_process);
> +	}
> +	TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
> +			"Enqueue count Error %10"PRIu64"",
> +			stats.enqueue_err_count);
> +	TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
> +			"Dequeue count Error (%10"PRIu64"",
> +			stats.dequeue_err_count);
> +
>  	return TEST_SUCCESS;
>  #endif
>  }
  
Chautru, Nicolas Oct. 26, 2020, 4:29 p.m. UTC | #2
> -----Original Message-----
> From: Tom Rix <trix@redhat.com>
> Sent: Monday, October 26, 2020 6:06 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> akhil.goyal@nxp.com
> Cc: david.marchand@redhat.com
> Subject: Re: [PATCH v5 2/7] app/bbdev: add explicit check for counters
> 
> 
> On 10/23/20 4:42 PM, Nicolas Chautru wrote:
> > Adding explicit check in ut that the stats counters have the expect
> > values. Was missing for coverage.
> 
> missing from coverage
> 
> ?

This was causing code coverage gap. 

> 
> >
> > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> > Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
> > Acked-by: Dave Burley <dave.burley@accelercomm.com>
> > ---
> >  app/test-bbdev/test_bbdev_perf.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/app/test-bbdev/test_bbdev_perf.c
> > b/app/test-bbdev/test_bbdev_perf.c
> > index 3554a77..b62848e 100644
> > --- a/app/test-bbdev/test_bbdev_perf.c
> > +++ b/app/test-bbdev/test_bbdev_perf.c
> > @@ -4840,6 +4840,23 @@ typedef int (test_case_function)(struct
> active_device *ad,
> >  			(double)(time_st.deq_max_time * 1000000) /
> >  			rte_get_tsc_hz());
> >
> > +	struct rte_bbdev_stats stats = {0};
> Other calls to get_bbdev_queue_stats do not initialize stats and likely should
> > +	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
> Should check the return here.
> > +	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
> 
> This logic seems off.
> 
> Do you mean to check only enc stats with an enc op ?
> 
> Similar for dec.

No that is intentional. That check would not be relavent for the LDPC_DEC tests as this may run more operations for the sake of HARQ preloading/retrieve. 

> 
> > +		TEST_ASSERT_SUCCESS(stats.enqueued_count !=
> num_to_process,
> > +				"Mismatch in enqueue count %10"PRIu64"
> %d",
> > +				stats.enqueued_count, num_to_process);
> > +		TEST_ASSERT_SUCCESS(stats.dequeued_count !=
> num_to_process,
> > +				"Mismatch in dequeue count %10"PRIu64"
> %d",
> > +				stats.dequeued_count, num_to_process);
> > +	}
> > +	TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
> > +			"Enqueue count Error %10"PRIu64"",
> > +			stats.enqueue_err_count);
> > +	TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
> > +			"Dequeue count Error (%10"PRIu64"",
> > +			stats.dequeue_err_count);
> > +
> >  	return TEST_SUCCESS;
> >  #endif
> >  }
  
Tom Rix Oct. 28, 2020, 8:31 p.m. UTC | #3
On 10/26/20 9:29 AM, Chautru, Nicolas wrote:
>> -----Original Message-----
>> From: Tom Rix <trix@redhat.com>
>> Sent: Monday, October 26, 2020 6:06 AM
>> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
>> akhil.goyal@nxp.com
>> Cc: david.marchand@redhat.com
>> Subject: Re: [PATCH v5 2/7] app/bbdev: add explicit check for counters
>>
>>
>> On 10/23/20 4:42 PM, Nicolas Chautru wrote:
>>> Adding explicit check in ut that the stats counters have the expect
>>> values. Was missing for coverage.
>> missing from coverage
>>
>> ?
> This was causing code coverage gap. 

Add 'code ' to make the context better.

>
>>> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
>>> Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
>>> Acked-by: Dave Burley <dave.burley@accelercomm.com>
>>> ---
>>>  app/test-bbdev/test_bbdev_perf.c | 17 +++++++++++++++++
>>>  1 file changed, 17 insertions(+)
>>>
>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>> b/app/test-bbdev/test_bbdev_perf.c
>>> index 3554a77..b62848e 100644
>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>> @@ -4840,6 +4840,23 @@ typedef int (test_case_function)(struct
>> active_device *ad,
>>>  			(double)(time_st.deq_max_time * 1000000) /
>>>  			rte_get_tsc_hz());
>>>
>>> +	struct rte_bbdev_stats stats = {0};
>> Other calls to get_bbdev_queue_stats do not initialize stats and likely should
>>> +	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
>> Should check the return here.
>>> +	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
>> This logic seems off.
>>
>> Do you mean to check only enc stats with an enc op ?
>>
>> Similar for dec.
> No that is intentional. That check would not be relavent for the LDPC_DEC tests as this may run more operations for the sake of HARQ preloading/retrieve. 
ok
>
>>> +		TEST_ASSERT_SUCCESS(stats.enqueued_count !=
>> num_to_process,
>>> +				"Mismatch in enqueue count %10"PRIu64"
>> %d",
>>> +				stats.enqueued_count, num_to_process);
>>> +		TEST_ASSERT_SUCCESS(stats.dequeued_count !=
>> num_to_process,
>>> +				"Mismatch in dequeue count %10"PRIu64"
>> %d",
>>> +				stats.dequeued_count, num_to_process);
>>> +	}
>>> +	TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
>>> +			"Enqueue count Error %10"PRIu64"",
>>> +			stats.enqueue_err_count);
>>> +	TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
>>> +			"Dequeue count Error (%10"PRIu64"",
>>> +			stats.dequeue_err_count);
>>> +
>>>  	return TEST_SUCCESS;
>>>  #endif
>>>  }
  

Patch

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 3554a77..b62848e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -4840,6 +4840,23 @@  typedef int (test_case_function)(struct active_device *ad,
 			(double)(time_st.deq_max_time * 1000000) /
 			rte_get_tsc_hz());
 
+	struct rte_bbdev_stats stats = {0};
+	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
+		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
+				"Mismatch in enqueue count %10"PRIu64" %d",
+				stats.enqueued_count, num_to_process);
+		TEST_ASSERT_SUCCESS(stats.dequeued_count != num_to_process,
+				"Mismatch in dequeue count %10"PRIu64" %d",
+				stats.dequeued_count, num_to_process);
+	}
+	TEST_ASSERT_SUCCESS(stats.enqueue_err_count != 0,
+			"Enqueue count Error %10"PRIu64"",
+			stats.enqueue_err_count);
+	TEST_ASSERT_SUCCESS(stats.dequeue_err_count != 0,
+			"Dequeue count Error (%10"PRIu64"",
+			stats.dequeue_err_count);
+
 	return TEST_SUCCESS;
 #endif
 }