[v2,04/16] test/bbdev: add timeout for latency tests

Message ID 20230215170949.60569-5-hernan.vargas@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series test/bbdev: changes for 23.03 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Hernan Vargas Feb. 15, 2023, 5:09 p.m. UTC
  Add a timeout to force exit the latency tests in case dequeue never
happens.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
  

Comments

Maxime Coquelin Feb. 20, 2023, 4:32 p.m. UTC | #1
On 2/15/23 18:09, Hernan Vargas wrote:
> Add a timeout to force exit the latency tests in case dequeue never
> happens.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>   1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 19b9a5b119..dede0f900e 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -26,6 +26,7 @@
>   
>   #define MAX_QUEUES RTE_MAX_LCORE
>   #define TEST_REPETITIONS 100
> +#define TIME_OUT_POLL 1e8
>   #define WAIT_OFFLOAD_US 1000
>   
>   #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   
>   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>   		uint16_t enq = 0, deq = 0;
> +		uint32_t time_out = 0;
>   		bool first_time = true;
>   		last_time = 0;
>   
> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   				last_time = rte_rdtsc_precise() - start_time;
>   				first_time = false;
>   			}
> -		} while (unlikely(burst_sz != deq));
> +			time_out++;
> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>   
>   		*max_time = RTE_MAX(*max_time, last_time);
>   		*min_time = RTE_MIN(*min_time, last_time);
> @@ -4606,7 +4609,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   		if (extDdr)
>   			retrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);
>   
> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> +		if (burst_sz != deq) {
> +			struct rte_bbdev_info info;
> +			ret = TEST_FAILED;
> +			rte_bbdev_info_get(dev_id, &info);

What is the point of calling rte_bbdev_info_get() here and below?
info is not used afterwards.

> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>   			ret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op,
>   					vector_mask);
>   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> @@ -4632,6 +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>   
>   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>   		uint16_t enq = 0, deq = 0;
> +		uint32_t time_out = 0;
>   		bool first_time = true;
>   		last_time = 0;
>   
> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool *mempool,
>   				last_time += rte_rdtsc_precise() - start_time;
>   				first_time = false;
>   			}
> -		} while (unlikely(burst_sz != deq));
> +			time_out++;
> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>   
>   		*max_time = RTE_MAX(*max_time, last_time);
>   		*min_time = RTE_MIN(*min_time, last_time);
>   		*total_time += last_time;
> -
> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> +		if (burst_sz != deq) {
> +			struct rte_bbdev_info info;
> +			ret = TEST_FAILED;
> +			rte_bbdev_info_get(dev_id, &info);

Same here.

> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>   			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>   		}
  
Hernan Vargas Feb. 22, 2023, 9:13 p.m. UTC | #2
Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, February 20, 2023 10:33 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/15/23 18:09, Hernan Vargas wrote:
> > Add a timeout to force exit the latency tests in case dequeue never
> > happens.
> >
> > Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> > ---
> >   app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >   1 file changed, 19 insertions(+), 5 deletions(-)
> >
> > diff --git a/app/test-bbdev/test_bbdev_perf.c
> > b/app/test-bbdev/test_bbdev_perf.c
> > index 19b9a5b119..dede0f900e 100644
> > --- a/app/test-bbdev/test_bbdev_perf.c
> > +++ b/app/test-bbdev/test_bbdev_perf.c
> > @@ -26,6 +26,7 @@
> >
> >   #define MAX_QUEUES RTE_MAX_LCORE
> >   #define TEST_REPETITIONS 100
> > +#define TIME_OUT_POLL 1e8
> >   #define WAIT_OFFLOAD_US 1000
> >
> >   #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> > @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
> > *mempool,
> >
> >   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >   		uint16_t enq = 0, deq = 0;
> > +		uint32_t time_out = 0;
> >   		bool first_time = true;
> >   		last_time = 0;
> >
> > @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> *mempool,
> >   				last_time = rte_rdtsc_precise() - start_time;
> >   				first_time = false;
> >   			}
> > -		} while (unlikely(burst_sz != deq));
> > +			time_out++;
> > +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >
> >   		*max_time = RTE_MAX(*max_time, last_time);
> >   		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
> +4609,12 @@
> > latency_test_ldpc_dec(struct rte_mempool *mempool,
> >   		if (extDdr)
> >   			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> burst_sz);
> >
> > -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> > +		if (burst_sz != deq) {
> > +			struct rte_bbdev_info info;
> > +			ret = TEST_FAILED;
> > +			rte_bbdev_info_get(dev_id, &info);
> 
> What is the point of calling rte_bbdev_info_get() here and below?
> info is not used afterwards.

The reason for calling this function is to check the device status and if there is something wrong the PMD would display it to standard output.

> 
> > +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> > +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >   			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> ref_op,
> >   					vector_mask);
> >   			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
> -4632,6
> > +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >
> >   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >   		uint16_t enq = 0, deq = 0;
> > +		uint32_t time_out = 0;
> >   		bool first_time = true;
> >   		last_time = 0;
> >
> > @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> *mempool,
> >   				last_time += rte_rdtsc_precise() - start_time;
> >   				first_time = false;
> >   			}
> > -		} while (unlikely(burst_sz != deq));
> > +			time_out++;
> > +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >
> >   		*max_time = RTE_MAX(*max_time, last_time);
> >   		*min_time = RTE_MIN(*min_time, last_time);
> >   		*total_time += last_time;
> > -
> > -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> > +		if (burst_sz != deq) {
> > +			struct rte_bbdev_info info;
> > +			ret = TEST_FAILED;
> > +			rte_bbdev_info_get(dev_id, &info);
> 
> Same here.
> 
> > +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> > +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >   			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
> >   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> >   		}
  
Maxime Coquelin Feb. 23, 2023, 8:31 a.m. UTC | #3
On 2/22/23 22:13, Vargas, Hernan wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Monday, February 20, 2023 10:33 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/15/23 18:09, Hernan Vargas wrote:
>>> Add a timeout to force exit the latency tests in case dequeue never
>>> happens.
>>>
>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>> ---
>>>    app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>    1 file changed, 19 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>> b/app/test-bbdev/test_bbdev_perf.c
>>> index 19b9a5b119..dede0f900e 100644
>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>> @@ -26,6 +26,7 @@
>>>
>>>    #define MAX_QUEUES RTE_MAX_LCORE
>>>    #define TEST_REPETITIONS 100
>>> +#define TIME_OUT_POLL 1e8
>>>    #define WAIT_OFFLOAD_US 1000
>>>
>>>    #ifdef RTE_BASEBAND_FPGA_LTE_FEC
>>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
>>> *mempool,
>>>
>>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>    		uint16_t enq = 0, deq = 0;
>>> +		uint32_t time_out = 0;
>>>    		bool first_time = true;
>>>    		last_time = 0;
>>>
>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>> *mempool,
>>>    				last_time = rte_rdtsc_precise() - start_time;
>>>    				first_time = false;
>>>    			}
>>> -		} while (unlikely(burst_sz != deq));
>>> +			time_out++;
>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>
>>>    		*max_time = RTE_MAX(*max_time, last_time);
>>>    		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
>> +4609,12 @@
>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>    		if (extDdr)
>>>    			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>> burst_sz);
>>>
>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>> +		if (burst_sz != deq) {
>>> +			struct rte_bbdev_info info;
>>> +			ret = TEST_FAILED;
>>> +			rte_bbdev_info_get(dev_id, &info);
>>
>> What is the point of calling rte_bbdev_info_get() here and below?
>> info is not used afterwards.
> 
> The reason for calling this function is to check the device status and if there is something wrong the PMD would display it to standard output.

What kind of info exactly, I don't see much meaningful logs in
rte_bbdev_info_get() except printing error if dev_info == NULL.

Regards,
Maxime

>>
>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>    			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>> ref_op,
>>>    					vector_mask);
>>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
>> -4632,6
>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>
>>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>    		uint16_t enq = 0, deq = 0;
>>> +		uint32_t time_out = 0;
>>>    		bool first_time = true;
>>>    		last_time = 0;
>>>
>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>> *mempool,
>>>    				last_time += rte_rdtsc_precise() - start_time;
>>>    				first_time = false;
>>>    			}
>>> -		} while (unlikely(burst_sz != deq));
>>> +			time_out++;
>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>
>>>    		*max_time = RTE_MAX(*max_time, last_time);
>>>    		*min_time = RTE_MIN(*min_time, last_time);
>>>    		*total_time += last_time;
>>> -
>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>> +		if (burst_sz != deq) {
>>> +			struct rte_bbdev_info info;
>>> +			ret = TEST_FAILED;
>>> +			rte_bbdev_info_get(dev_id, &info);
>>
>> Same here.
>>
>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>    			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>>>    		}
>
  
Hernan Vargas Feb. 24, 2023, 4:59 p.m. UTC | #4
Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Thursday, February 23, 2023 2:32 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/22/23 22:13, Vargas, Hernan wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Sent: Monday, February 20, 2023 10:33 AM
> >> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>
> >> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >> tests
> >>
> >>
> >>
> >> On 2/15/23 18:09, Hernan Vargas wrote:
> >>> Add a timeout to force exit the latency tests in case dequeue never
> >>> happens.
> >>>
> >>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> >>> ---
> >>>    app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >>>    1 file changed, 19 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/app/test-bbdev/test_bbdev_perf.c
> >>> b/app/test-bbdev/test_bbdev_perf.c
> >>> index 19b9a5b119..dede0f900e 100644
> >>> --- a/app/test-bbdev/test_bbdev_perf.c
> >>> +++ b/app/test-bbdev/test_bbdev_perf.c
> >>> @@ -26,6 +26,7 @@
> >>>
> >>>    #define MAX_QUEUES RTE_MAX_LCORE
> >>>    #define TEST_REPETITIONS 100
> >>> +#define TIME_OUT_POLL 1e8
> >>>    #define WAIT_OFFLOAD_US 1000
> >>>
> >>>    #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> >>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
> >>> *mempool,
> >>>
> >>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>    		uint16_t enq = 0, deq = 0;
> >>> +		uint32_t time_out = 0;
> >>>    		bool first_time = true;
> >>>    		last_time = 0;
> >>>
> >>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> >> *mempool,
> >>>    				last_time = rte_rdtsc_precise() - start_time;
> >>>    				first_time = false;
> >>>    			}
> >>> -		} while (unlikely(burst_sz != deq));
> >>> +			time_out++;
> >>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>
> >>>    		*max_time = RTE_MAX(*max_time, last_time);
> >>>    		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
> >> +4609,12 @@
> >>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>    		if (extDdr)
> >>>    			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> >> burst_sz);
> >>>
> >>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>> +		if (burst_sz != deq) {
> >>> +			struct rte_bbdev_info info;
> >>> +			ret = TEST_FAILED;
> >>> +			rte_bbdev_info_get(dev_id, &info);
> >>
> >> What is the point of calling rte_bbdev_info_get() here and below?
> >> info is not used afterwards.
> >
> > The reason for calling this function is to check the device status and if there
> is something wrong the PMD would display it to standard output.
> 
> What kind of info exactly, I don't see much meaningful logs in
> rte_bbdev_info_get() except printing error if dev_info == NULL.

rte_bbdev_info_get() calls the device's info_get function that is specified in the PMD.
For example, for ACC100, acc100_dev_info_get() gets called to check the device status.

Thanks,
Hernan
> 
> Regards,
> Maxime
> 
> >>
> >>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>    			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> >> ref_op,
> >>>    					vector_mask);
> >>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
> >> -4632,6
> >>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >>>
> >>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>    		uint16_t enq = 0, deq = 0;
> >>> +		uint32_t time_out = 0;
> >>>    		bool first_time = true;
> >>>    		last_time = 0;
> >>>
> >>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> >> *mempool,
> >>>    				last_time += rte_rdtsc_precise() - start_time;
> >>>    				first_time = false;
> >>>    			}
> >>> -		} while (unlikely(burst_sz != deq));
> >>> +			time_out++;
> >>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>
> >>>    		*max_time = RTE_MAX(*max_time, last_time);
> >>>    		*min_time = RTE_MIN(*min_time, last_time);
> >>>    		*total_time += last_time;
> >>> -
> >>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>> +		if (burst_sz != deq) {
> >>> +			struct rte_bbdev_info info;
> >>> +			ret = TEST_FAILED;
> >>> +			rte_bbdev_info_get(dev_id, &info);
> >>
> >> Same here.
> >>
> >>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>    			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
> >>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> >>>    		}
> >
  
Maxime Coquelin Feb. 27, 2023, 9:44 a.m. UTC | #5
On 2/24/23 17:59, Vargas, Hernan wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Thursday, February 23, 2023 2:32 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/22/23 22:13, Vargas, Hernan wrote:
>>> Hi Maxime,
>>>
>>>> -----Original Message-----
>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>> Sent: Monday, February 20, 2023 10:33 AM
>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>> <qi.z.zhang@intel.com>
>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>> tests
>>>>
>>>>
>>>>
>>>> On 2/15/23 18:09, Hernan Vargas wrote:
>>>>> Add a timeout to force exit the latency tests in case dequeue never
>>>>> happens.
>>>>>
>>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>>>> ---
>>>>>     app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>>>     1 file changed, 19 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>>>> b/app/test-bbdev/test_bbdev_perf.c
>>>>> index 19b9a5b119..dede0f900e 100644
>>>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>>>> @@ -26,6 +26,7 @@
>>>>>
>>>>>     #define MAX_QUEUES RTE_MAX_LCORE
>>>>>     #define TEST_REPETITIONS 100
>>>>> +#define TIME_OUT_POLL 1e8
>>>>>     #define WAIT_OFFLOAD_US 1000
>>>>>
>>>>>     #ifdef RTE_BASEBAND_FPGA_LTE_FEC
>>>>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
>>>>> *mempool,
>>>>>
>>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>     		uint16_t enq = 0, deq = 0;
>>>>> +		uint32_t time_out = 0;
>>>>>     		bool first_time = true;
>>>>>     		last_time = 0;
>>>>>
>>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>>>> *mempool,
>>>>>     				last_time = rte_rdtsc_precise() - start_time;
>>>>>     				first_time = false;
>>>>>     			}
>>>>> -		} while (unlikely(burst_sz != deq));
>>>>> +			time_out++;
>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>
>>>>>     		*max_time = RTE_MAX(*max_time, last_time);
>>>>>     		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
>>>> +4609,12 @@
>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>     		if (extDdr)
>>>>>     			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>>>> burst_sz);
>>>>>
>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>> +		if (burst_sz != deq) {
>>>>> +			struct rte_bbdev_info info;
>>>>> +			ret = TEST_FAILED;
>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>
>>>> What is the point of calling rte_bbdev_info_get() here and below?
>>>> info is not used afterwards.
>>>
>>> The reason for calling this function is to check the device status and if there
>> is something wrong the PMD would display it to standard output.
>>
>> What kind of info exactly, I don't see much meaningful logs in
>> rte_bbdev_info_get() except printing error if dev_info == NULL.
> 
> rte_bbdev_info_get() calls the device's info_get function that is specified in the PMD.
> For example, for ACC100, acc100_dev_info_get() gets called to check the device status.

Ok, I looked at this function and it might be more relevant to mention 
vrb1 than acc100, because acc100 does not support device status:

	/* Check the status of device */
	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;

Also, this dev_info->device_status field is set by all the drivers but
never read (neither by the driver, nor library nor apps).

So if this is the only reason rte_bbdev_info_get() is called, that is
quite useless. Am I missing someting?

Thanks,
Maxime

> Thanks,
> Hernan
>>
>> Regards,
>> Maxime
>>
>>>>
>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>     			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>>>> ref_op,
>>>>>     					vector_mask);
>>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
>>>> -4632,6
>>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>>>
>>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>     		uint16_t enq = 0, deq = 0;
>>>>> +		uint32_t time_out = 0;
>>>>>     		bool first_time = true;
>>>>>     		last_time = 0;
>>>>>
>>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>>>> *mempool,
>>>>>     				last_time += rte_rdtsc_precise() - start_time;
>>>>>     				first_time = false;
>>>>>     			}
>>>>> -		} while (unlikely(burst_sz != deq));
>>>>> +			time_out++;
>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>
>>>>>     		*max_time = RTE_MAX(*max_time, last_time);
>>>>>     		*min_time = RTE_MIN(*min_time, last_time);
>>>>>     		*total_time += last_time;
>>>>> -
>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>> +		if (burst_sz != deq) {
>>>>> +			struct rte_bbdev_info info;
>>>>> +			ret = TEST_FAILED;
>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>
>>>> Same here.
>>>>
>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>     			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>>>>>     		}
>>>
>
  
Chautru, Nicolas Feb. 28, 2023, 10:37 p.m. UTC | #6
Hi Maxime, 

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, February 27, 2023 1:45 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/24/23 17:59, Vargas, Hernan wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Sent: Thursday, February 23, 2023 2:32 AM
> >> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>
> >> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >> tests
> >>
> >>
> >>
> >> On 2/22/23 22:13, Vargas, Hernan wrote:
> >>> Hi Maxime,
> >>>
> >>>> -----Original Message-----
> >>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>>> Sent: Monday, February 20, 2023 10:33 AM
> >>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >>>> <qi.z.zhang@intel.com>
> >>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >>>> tests
> >>>>
> >>>>
> >>>>
> >>>> On 2/15/23 18:09, Hernan Vargas wrote:
> >>>>> Add a timeout to force exit the latency tests in case dequeue
> >>>>> never happens.
> >>>>>
> >>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> >>>>> ---
> >>>>>     app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >>>>>     1 file changed, 19 insertions(+), 5 deletions(-)
> >>>>>
> >>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
> >>>>> b/app/test-bbdev/test_bbdev_perf.c
> >>>>> index 19b9a5b119..dede0f900e 100644
> >>>>> --- a/app/test-bbdev/test_bbdev_perf.c
> >>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
> >>>>> @@ -26,6 +26,7 @@
> >>>>>
> >>>>>     #define MAX_QUEUES RTE_MAX_LCORE
> >>>>>     #define TEST_REPETITIONS 100
> >>>>> +#define TIME_OUT_POLL 1e8
> >>>>>     #define WAIT_OFFLOAD_US 1000
> >>>>>
> >>>>>     #ifdef RTE_BASEBAND_FPGA_LTE_FEC @@ -4546,6 +4547,7 @@
> >>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>>>
> >>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>>>     		uint16_t enq = 0, deq = 0;
> >>>>> +		uint32_t time_out = 0;
> >>>>>     		bool first_time = true;
> >>>>>     		last_time = 0;
> >>>>>
> >>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> >>>> *mempool,
> >>>>>     				last_time = rte_rdtsc_precise() -
> start_time;
> >>>>>     				first_time = false;
> >>>>>     			}
> >>>>> -		} while (unlikely(burst_sz != deq));
> >>>>> +			time_out++;
> >>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>>>
> >>>>>     		*max_time = RTE_MAX(*max_time, last_time);
> >>>>>     		*min_time = RTE_MIN(*min_time, last_time); @@ -
> 4606,7
> >>>> +4609,12 @@
> >>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>>>     		if (extDdr)
> >>>>>     			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> >>>> burst_sz);
> >>>>>
> >>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>> +		if (burst_sz != deq) {
> >>>>> +			struct rte_bbdev_info info;
> >>>>> +			ret = TEST_FAILED;
> >>>>> +			rte_bbdev_info_get(dev_id, &info);
> >>>>
> >>>> What is the point of calling rte_bbdev_info_get() here and below?
> >>>> info is not used afterwards.
> >>>
> >>> The reason for calling this function is to check the device status
> >>> and if there
> >> is something wrong the PMD would display it to standard output.
> >>
> >> What kind of info exactly, I don't see much meaningful logs in
> >> rte_bbdev_info_get() except printing error if dev_info == NULL.
> >
> > rte_bbdev_info_get() calls the device's info_get function that is specified in
> the PMD.
> > For example, for ACC100, acc100_dev_info_get() gets called to check the
> device status.
> 
> Ok, I looked at this function and it might be more relevant to mention
> vrb1 than acc100, because acc100 does not support device status:
> 
> 	/* Check the status of device */
> 	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;
> 
> Also, this dev_info->device_status field is set by all the drivers but never read
> (neither by the driver, nor library nor apps).
> 
> So if this is the only reason rte_bbdev_info_get() is called, that is quite useless.
> Am I missing someting?

Note the device status is printed in the bbdev-test app in that other patchset in the series https://patches.dpdk.org/project/dpdk/patch/20230215170949.60569-7-hernan.vargas@intel.com/
Also calling that function then exercise interaction with underlying HW and PF driver which is valuable and the expected usecase.  
This is indeed relevant from vrb1 in term of current  intel PMD implementation, but the bbdev-test is HW agnostic. 
Let us know if unclear, 
Thanks, 
Nic


> 
> Thanks,
> Maxime
> 
> > Thanks,
> > Hernan
> >>
> >> Regards,
> >> Maxime
> >>
> >>>>
> >>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>>     			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> >>>> ref_op,
> >>>>>     					vector_mask);
> >>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation
> failed!"); @@
> >>>> -4632,6
> >>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >>>>>
> >>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>>>     		uint16_t enq = 0, deq = 0;
> >>>>> +		uint32_t time_out = 0;
> >>>>>     		bool first_time = true;
> >>>>>     		last_time = 0;
> >>>>>
> >>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> >>>> *mempool,
> >>>>>     				last_time += rte_rdtsc_precise() -
> start_time;
> >>>>>     				first_time = false;
> >>>>>     			}
> >>>>> -		} while (unlikely(burst_sz != deq));
> >>>>> +			time_out++;
> >>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>>>
> >>>>>     		*max_time = RTE_MAX(*max_time, last_time);
> >>>>>     		*min_time = RTE_MIN(*min_time, last_time);
> >>>>>     		*total_time += last_time;
> >>>>> -
> >>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>> +		if (burst_sz != deq) {
> >>>>> +			struct rte_bbdev_info info;
> >>>>> +			ret = TEST_FAILED;
> >>>>> +			rte_bbdev_info_get(dev_id, &info);
> >>>>
> >>>> Same here.
> >>>>
> >>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>>     			ret = validate_enc_op(ops_deq, burst_sz,
> ref_op);
> >>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation
> failed!");
> >>>>>     		}
> >>>
> >
  
Maxime Coquelin March 2, 2023, 10:12 a.m. UTC | #7
On 2/28/23 23:37, Chautru, Nicolas wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Monday, February 27, 2023 1:45 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/24/23 17:59, Vargas, Hernan wrote:
>>> Hi Maxime,
>>>
>>>> -----Original Message-----
>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>> Sent: Thursday, February 23, 2023 2:32 AM
>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>> <qi.z.zhang@intel.com>
>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>> tests
>>>>
>>>>
>>>>
>>>> On 2/22/23 22:13, Vargas, Hernan wrote:
>>>>> Hi Maxime,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>>> Sent: Monday, February 20, 2023 10:33 AM
>>>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>>>> <qi.z.zhang@intel.com>
>>>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>>>> tests
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2/15/23 18:09, Hernan Vargas wrote:
>>>>>>> Add a timeout to force exit the latency tests in case dequeue
>>>>>>> never happens.
>>>>>>>
>>>>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>>>>>> ---
>>>>>>>      app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>>>>>      1 file changed, 19 insertions(+), 5 deletions(-)
>>>>>>>
>>>>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>>>>>> b/app/test-bbdev/test_bbdev_perf.c
>>>>>>> index 19b9a5b119..dede0f900e 100644
>>>>>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>>>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>>>>>> @@ -26,6 +26,7 @@
>>>>>>>
>>>>>>>      #define MAX_QUEUES RTE_MAX_LCORE
>>>>>>>      #define TEST_REPETITIONS 100
>>>>>>> +#define TIME_OUT_POLL 1e8
>>>>>>>      #define WAIT_OFFLOAD_US 1000
>>>>>>>
>>>>>>>      #ifdef RTE_BASEBAND_FPGA_LTE_FEC @@ -4546,6 +4547,7 @@
>>>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>>>
>>>>>>>      	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>>>      		uint16_t enq = 0, deq = 0;
>>>>>>> +		uint32_t time_out = 0;
>>>>>>>      		bool first_time = true;
>>>>>>>      		last_time = 0;
>>>>>>>
>>>>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>>>>>> *mempool,
>>>>>>>      				last_time = rte_rdtsc_precise() -
>> start_time;
>>>>>>>      				first_time = false;
>>>>>>>      			}
>>>>>>> -		} while (unlikely(burst_sz != deq));
>>>>>>> +			time_out++;
>>>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>>>
>>>>>>>      		*max_time = RTE_MAX(*max_time, last_time);
>>>>>>>      		*min_time = RTE_MIN(*min_time, last_time); @@ -
>> 4606,7
>>>>>> +4609,12 @@
>>>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>>>      		if (extDdr)
>>>>>>>      			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>>>>>> burst_sz);
>>>>>>>
>>>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>> +		if (burst_sz != deq) {
>>>>>>> +			struct rte_bbdev_info info;
>>>>>>> +			ret = TEST_FAILED;
>>>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>>>
>>>>>> What is the point of calling rte_bbdev_info_get() here and below?
>>>>>> info is not used afterwards.
>>>>>
>>>>> The reason for calling this function is to check the device status
>>>>> and if there
>>>> is something wrong the PMD would display it to standard output.
>>>>
>>>> What kind of info exactly, I don't see much meaningful logs in
>>>> rte_bbdev_info_get() except printing error if dev_info == NULL.
>>>
>>> rte_bbdev_info_get() calls the device's info_get function that is specified in
>> the PMD.
>>> For example, for ACC100, acc100_dev_info_get() gets called to check the
>> device status.
>>
>> Ok, I looked at this function and it might be more relevant to mention
>> vrb1 than acc100, because acc100 does not support device status:
>>
>> 	/* Check the status of device */
>> 	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;
>>
>> Also, this dev_info->device_status field is set by all the drivers but never read
>> (neither by the driver, nor library nor apps).
>>
>> So if this is the only reason rte_bbdev_info_get() is called, that is quite useless.
>> Am I missing someting?
> 
> Note the device status is printed in the bbdev-test app in that other patchset in the series https://patches.dpdk.org/project/dpdk/patch/20230215170949.60569-7-hernan.vargas@intel.com/

Not related to this patch, but maybe you should use an assert in the
patch you link above. Indeed, what is the point of continuing the init
if the device status is "FATAL_ERR"?

> Also calling that function then exercise interaction with underlying HW and PF driver which is valuable and the expected usecase.
> This is indeed relevant from vrb1 in term of current  intel PMD implementation, but the bbdev-test is HW agnostic.
> Let us know if unclear,

OK, that's clearer.

For this patch:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

> Thanks,
> Nic
> 
> 
>>
>> Thanks,
>> Maxime
>>
>>> Thanks,
>>> Hernan
>>>>
>>>> Regards,
>>>> Maxime
>>>>
>>>>>>
>>>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>>      			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>>>>>> ref_op,
>>>>>>>      					vector_mask);
>>>>>>>      			TEST_ASSERT_SUCCESS(ret, "Validation
>> failed!"); @@
>>>>>> -4632,6
>>>>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>>>>>
>>>>>>>      	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>>>      		uint16_t enq = 0, deq = 0;
>>>>>>> +		uint32_t time_out = 0;
>>>>>>>      		bool first_time = true;
>>>>>>>      		last_time = 0;
>>>>>>>
>>>>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>>>>>> *mempool,
>>>>>>>      				last_time += rte_rdtsc_precise() -
>> start_time;
>>>>>>>      				first_time = false;
>>>>>>>      			}
>>>>>>> -		} while (unlikely(burst_sz != deq));
>>>>>>> +			time_out++;
>>>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>>>
>>>>>>>      		*max_time = RTE_MAX(*max_time, last_time);
>>>>>>>      		*min_time = RTE_MIN(*min_time, last_time);
>>>>>>>      		*total_time += last_time;
>>>>>>> -
>>>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>> +		if (burst_sz != deq) {
>>>>>>> +			struct rte_bbdev_info info;
>>>>>>> +			ret = TEST_FAILED;
>>>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>>>
>>>>>> Same here.
>>>>>>
>>>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>>      			ret = validate_enc_op(ops_deq, burst_sz,
>> ref_op);
>>>>>>>      			TEST_ASSERT_SUCCESS(ret, "Validation
>> failed!");
>>>>>>>      		}
>>>>>
>>>
>
  

Patch

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 19b9a5b119..dede0f900e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -26,6 +26,7 @@ 
 
 #define MAX_QUEUES RTE_MAX_LCORE
 #define TEST_REPETITIONS 100
+#define TIME_OUT_POLL 1e8
 #define WAIT_OFFLOAD_US 1000
 
 #ifdef RTE_BASEBAND_FPGA_LTE_FEC
@@ -4546,6 +4547,7 @@  latency_test_ldpc_dec(struct rte_mempool *mempool,
 
 	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
 		uint16_t enq = 0, deq = 0;
+		uint32_t time_out = 0;
 		bool first_time = true;
 		last_time = 0;
 
@@ -4597,7 +4599,8 @@  latency_test_ldpc_dec(struct rte_mempool *mempool,
 				last_time = rte_rdtsc_precise() - start_time;
 				first_time = false;
 			}
-		} while (unlikely(burst_sz != deq));
+			time_out++;
+		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
 
 		*max_time = RTE_MAX(*max_time, last_time);
 		*min_time = RTE_MIN(*min_time, last_time);
@@ -4606,7 +4609,12 @@  latency_test_ldpc_dec(struct rte_mempool *mempool,
 		if (extDdr)
 			retrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);
 
-		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
+		if (burst_sz != deq) {
+			struct rte_bbdev_info info;
+			ret = TEST_FAILED;
+			rte_bbdev_info_get(dev_id, &info);
+			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
+		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
 			ret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op,
 					vector_mask);
 			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
@@ -4632,6 +4640,7 @@  latency_test_enc(struct rte_mempool *mempool,
 
 	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
 		uint16_t enq = 0, deq = 0;
+		uint32_t time_out = 0;
 		bool first_time = true;
 		last_time = 0;
 
@@ -4667,13 +4676,18 @@  latency_test_enc(struct rte_mempool *mempool,
 				last_time += rte_rdtsc_precise() - start_time;
 				first_time = false;
 			}
-		} while (unlikely(burst_sz != deq));
+			time_out++;
+		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
 
 		*max_time = RTE_MAX(*max_time, last_time);
 		*min_time = RTE_MIN(*min_time, last_time);
 		*total_time += last_time;
-
-		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
+		if (burst_sz != deq) {
+			struct rte_bbdev_info info;
+			ret = TEST_FAILED;
+			rte_bbdev_info_get(dev_id, &info);
+			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
+		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
 			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
 			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
 		}