* [PATCH v2 0/3] test/bbdev: fix build issues with optional build flag @ 2022-12-06 19:14 Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 1/3] test/bbdev: fix build issue " Nicolas Chautru ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Nicolas Chautru @ 2022-12-06 19:14 UTC (permalink / raw) To: dev, maxime.coquelin; +Cc: hernan.vargas, Vipin.Varghese, Nicolas Chautru v2: add check in offload test function for error during allocation suggested by Maxime. Fixing compilation errors in bbdev-test application on rc4 when the optional flag RTE_BBDEV_OFFLOAD_COST is set manually. This was raised by Vipin. Nicolas Chautru (3): test/bbdev: fix build issue with optional build flag test/bbdev: fix build issue with optional build flag test/bbdev: explicit check for allocation failure app/test-bbdev/test_bbdev_perf.c | 93 ++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 4 deletions(-) -- 2.37.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/3] test/bbdev: fix build issue with optional build flag 2022-12-06 19:14 [PATCH v2 0/3] test/bbdev: fix build issues with optional build flag Nicolas Chautru @ 2022-12-06 19:14 ` Nicolas Chautru 2022-12-07 8:38 ` Maxime Coquelin 2022-12-06 19:14 ` [PATCH v2 2/3] " Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 3/3] test/bbdev: explicit check for allocation failure Nicolas Chautru 2 siblings, 1 reply; 9+ messages in thread From: Nicolas Chautru @ 2022-12-06 19:14 UTC (permalink / raw) To: dev, maxime.coquelin; +Cc: hernan.vargas, Vipin.Varghese, Nicolas Chautru Incorrect bbdev member name used in test code under RTE_BBDEV_OFFLOAD_COST build flag. Fixes: 4f08028c5e24 ("bbdev: expose queue related warning and status") Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> --- app/test-bbdev/test_bbdev_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index b285d3f3a7..1859952901 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4933,8 +4933,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; - stats->enqueue_warning_count = q_stats->enqueue_warning_count; - stats->dequeue_warning_count = q_stats->dequeue_warning_count; + stats->enqueue_warn_count = q_stats->enqueue_warn_count; + stats->dequeue_warn_count = q_stats->dequeue_warn_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles; return 0; -- 2.37.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/3] test/bbdev: fix build issue with optional build flag 2022-12-06 19:14 ` [PATCH v2 1/3] test/bbdev: fix build issue " Nicolas Chautru @ 2022-12-07 8:38 ` Maxime Coquelin 0 siblings, 0 replies; 9+ messages in thread From: Maxime Coquelin @ 2022-12-07 8:38 UTC (permalink / raw) To: Nicolas Chautru, dev, stable; +Cc: hernan.vargas, Vipin.Varghese On 12/6/22 20:14, Nicolas Chautru wrote: > Incorrect bbdev member name used in test code under > RTE_BBDEV_OFFLOAD_COST build flag. > > Fixes: 4f08028c5e24 ("bbdev: expose queue related warning and status") You missed to cc stable@dpdk.org. Added it now. > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> > --- > app/test-bbdev/test_bbdev_perf.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index b285d3f3a7..1859952901 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -4933,8 +4933,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, > stats->dequeued_count = q_stats->dequeued_count; > stats->enqueue_err_count = q_stats->enqueue_err_count; > stats->dequeue_err_count = q_stats->dequeue_err_count; > - stats->enqueue_warning_count = q_stats->enqueue_warning_count; > - stats->dequeue_warning_count = q_stats->dequeue_warning_count; > + stats->enqueue_warn_count = q_stats->enqueue_warn_count; > + stats->dequeue_warn_count = q_stats->dequeue_warn_count; > stats->acc_offload_cycles = q_stats->acc_offload_cycles; > > return 0; Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Thanks, Maxime ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] test/bbdev: fix build issue with optional build flag 2022-12-06 19:14 [PATCH v2 0/3] test/bbdev: fix build issues with optional build flag Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 1/3] test/bbdev: fix build issue " Nicolas Chautru @ 2022-12-06 19:14 ` Nicolas Chautru 2022-12-07 8:39 ` Maxime Coquelin 2022-12-06 19:14 ` [PATCH v2 3/3] test/bbdev: explicit check for allocation failure Nicolas Chautru 2 siblings, 1 reply; 9+ messages in thread From: Nicolas Chautru @ 2022-12-06 19:14 UTC (permalink / raw) To: dev, maxime.coquelin; +Cc: hernan.vargas, Vipin.Varghese, Nicolas Chautru Missing implementation for offload test with FFT. Only build when the optional build flag RTE_BBDEV_OFFLOAD_COST is set. Fixes: 0acdb9866756 ("test/bbdev: add FFT operations cases") Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> --- app/test-bbdev/test_bbdev_perf.c | 82 ++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 1859952901..b2e536b5e3 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4940,6 +4940,88 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, return 0; } +static int +offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, + struct rte_bbdev_fft_op *ref_op, uint16_t dev_id, + uint16_t queue_id, const uint16_t num_to_process, + uint16_t burst_sz, struct test_time_stats *time_st) +{ + int i, dequeued, ret; + struct rte_bbdev_fft_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST]; + uint64_t enq_start_time, deq_start_time; + uint64_t enq_sw_last_time, deq_last_time; + struct rte_bbdev_stats stats; + + for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) { + uint16_t enq = 0, deq = 0; + + if (unlikely(num_to_process - dequeued < burst_sz)) + burst_sz = num_to_process - dequeued; + + rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); + if (test_vector.op_type != RTE_BBDEV_OP_NONE) + copy_reference_fft_op(ops_enq, burst_sz, dequeued, + bufs->inputs, + bufs->hard_outputs, bufs->soft_outputs, + ref_op); + + /* Start time meas for enqueue function offload latency */ + enq_start_time = rte_rdtsc_precise(); + do { + enq += rte_bbdev_enqueue_fft_ops(dev_id, queue_id, + &ops_enq[enq], burst_sz - enq); + } while (unlikely(burst_sz != enq)); + + ret = get_bbdev_queue_stats(dev_id, queue_id, &stats); + TEST_ASSERT_SUCCESS(ret, + "Failed to get stats for queue (%u) of device (%u)", + queue_id, dev_id); + + enq_sw_last_time = rte_rdtsc_precise() - enq_start_time - + stats.acc_offload_cycles; + time_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time, + enq_sw_last_time); + time_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time, + enq_sw_last_time); + time_st->enq_sw_total_time += enq_sw_last_time; + + time_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time, + stats.acc_offload_cycles); + time_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time, + stats.acc_offload_cycles); + time_st->enq_acc_total_time += stats.acc_offload_cycles; + + /* give time for device to process ops */ + rte_delay_us(WAIT_OFFLOAD_US); + + /* Start time meas for dequeue function offload latency */ + deq_start_time = rte_rdtsc_precise(); + /* Dequeue one operation */ + do { + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, + &ops_deq[deq], enq); + } while (unlikely(deq == 0)); + + deq_last_time = rte_rdtsc_precise() - deq_start_time; + time_st->deq_max_time = RTE_MAX(time_st->deq_max_time, + deq_last_time); + time_st->deq_min_time = RTE_MIN(time_st->deq_min_time, + deq_last_time); + time_st->deq_total_time += deq_last_time; + + /* Dequeue remaining operations if needed*/ + while (burst_sz != deq) + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, + &ops_deq[deq], burst_sz - deq); + + rte_bbdev_fft_op_free_bulk(ops_enq, deq); + dequeued += deq; + } + + return i; +} + + static int offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op, uint16_t dev_id, -- 2.37.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] test/bbdev: fix build issue with optional build flag 2022-12-06 19:14 ` [PATCH v2 2/3] " Nicolas Chautru @ 2022-12-07 8:39 ` Maxime Coquelin 0 siblings, 0 replies; 9+ messages in thread From: Maxime Coquelin @ 2022-12-07 8:39 UTC (permalink / raw) To: Nicolas Chautru, dev, stable; +Cc: hernan.vargas, Vipin.Varghese On 12/6/22 20:14, Nicolas Chautru wrote: > Missing implementation for offload test with FFT. > Only build when the optional build flag RTE_BBDEV_OFFLOAD_COST > is set. > > Fixes: 0acdb9866756 ("test/bbdev: add FFT operations cases") Same here, adding stable@dpdk.org. > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> > --- > app/test-bbdev/test_bbdev_perf.c | 82 ++++++++++++++++++++++++++++++++ > 1 file changed, 82 insertions(+) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index 1859952901..b2e536b5e3 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -4940,6 +4940,88 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, > return 0; > } > > +static int > +offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, > + struct rte_bbdev_fft_op *ref_op, uint16_t dev_id, > + uint16_t queue_id, const uint16_t num_to_process, > + uint16_t burst_sz, struct test_time_stats *time_st) > +{ > + int i, dequeued, ret; > + struct rte_bbdev_fft_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST]; > + uint64_t enq_start_time, deq_start_time; > + uint64_t enq_sw_last_time, deq_last_time; > + struct rte_bbdev_stats stats; > + > + for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) { > + uint16_t enq = 0, deq = 0; > + > + if (unlikely(num_to_process - dequeued < burst_sz)) > + burst_sz = num_to_process - dequeued; > + > + rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); > + if (test_vector.op_type != RTE_BBDEV_OP_NONE) > + copy_reference_fft_op(ops_enq, burst_sz, dequeued, > + bufs->inputs, > + bufs->hard_outputs, bufs->soft_outputs, > + ref_op); > + > + /* Start time meas for enqueue function offload latency */ > + enq_start_time = rte_rdtsc_precise(); > + do { > + enq += rte_bbdev_enqueue_fft_ops(dev_id, queue_id, > + &ops_enq[enq], burst_sz - enq); > + } while (unlikely(burst_sz != enq)); > + > + ret = get_bbdev_queue_stats(dev_id, queue_id, &stats); > + TEST_ASSERT_SUCCESS(ret, > + "Failed to get stats for queue (%u) of device (%u)", > + queue_id, dev_id); > + > + enq_sw_last_time = rte_rdtsc_precise() - enq_start_time - > + stats.acc_offload_cycles; > + time_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time, > + enq_sw_last_time); > + time_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time, > + enq_sw_last_time); > + time_st->enq_sw_total_time += enq_sw_last_time; > + > + time_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time, > + stats.acc_offload_cycles); > + time_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time, > + stats.acc_offload_cycles); > + time_st->enq_acc_total_time += stats.acc_offload_cycles; > + > + /* give time for device to process ops */ > + rte_delay_us(WAIT_OFFLOAD_US); > + > + /* Start time meas for dequeue function offload latency */ > + deq_start_time = rte_rdtsc_precise(); > + /* Dequeue one operation */ > + do { > + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, > + &ops_deq[deq], enq); > + } while (unlikely(deq == 0)); > + > + deq_last_time = rte_rdtsc_precise() - deq_start_time; > + time_st->deq_max_time = RTE_MAX(time_st->deq_max_time, > + deq_last_time); > + time_st->deq_min_time = RTE_MIN(time_st->deq_min_time, > + deq_last_time); > + time_st->deq_total_time += deq_last_time; > + > + /* Dequeue remaining operations if needed*/ > + while (burst_sz != deq) > + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, > + &ops_deq[deq], burst_sz - deq); > + > + rte_bbdev_fft_op_free_bulk(ops_enq, deq); > + dequeued += deq; > + } > + > + return i; > +} > + > + > static int > offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, > struct rte_bbdev_dec_op *ref_op, uint16_t dev_id, Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Thanks, Maxime ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] test/bbdev: explicit check for allocation failure 2022-12-06 19:14 [PATCH v2 0/3] test/bbdev: fix build issues with optional build flag Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 1/3] test/bbdev: fix build issue " Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 2/3] " Nicolas Chautru @ 2022-12-06 19:14 ` Nicolas Chautru 2022-12-07 8:40 ` Maxime Coquelin 2 siblings, 1 reply; 9+ messages in thread From: Nicolas Chautru @ 2022-12-06 19:14 UTC (permalink / raw) To: dev, maxime.coquelin; +Cc: hernan.vargas, Vipin.Varghese, Nicolas Chautru Adding check for error on return of the rte_bbdev_*_op_alloc_bulk calls in bbdev-test. Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> --- app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index b2e536b5e3..a922d69ada 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, if (unlikely(num_to_process - dequeued < burst_sz)) burst_sz = num_to_process - dequeued; - rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_fft_op(ops_enq, burst_sz, dequeued, bufs->inputs, @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, if (unlikely(num_to_process - dequeued < burst_sz)) burst_sz = num_to_process - dequeued; - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_dec_op(ops_enq, burst_sz, dequeued, bufs->inputs, @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool, if (unlikely(num_to_process - dequeued < burst_sz)) burst_sz = num_to_process - dequeued; - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued, bufs->inputs, -- 2.37.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure 2022-12-06 19:14 ` [PATCH v2 3/3] test/bbdev: explicit check for allocation failure Nicolas Chautru @ 2022-12-07 8:40 ` Maxime Coquelin 2022-12-07 15:33 ` Chautru, Nicolas 0 siblings, 1 reply; 9+ messages in thread From: Maxime Coquelin @ 2022-12-07 8:40 UTC (permalink / raw) To: Nicolas Chautru, dev; +Cc: hernan.vargas, Vipin.Varghese On 12/6/22 20:14, Nicolas Chautru wrote: > Adding check for error on return of the > rte_bbdev_*_op_alloc_bulk calls in bbdev-test. > > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> > --- > app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index b2e536b5e3..a922d69ada 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, > if (unlikely(num_to_process - dequeued < burst_sz)) > burst_sz = num_to_process - dequeued; > > - rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); > + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > copy_reference_fft_op(ops_enq, burst_sz, dequeued, > bufs->inputs, > @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, > if (unlikely(num_to_process - dequeued < burst_sz)) > burst_sz = num_to_process - dequeued; > > - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); > + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > copy_reference_dec_op(ops_enq, burst_sz, dequeued, > bufs->inputs, > @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool, > if (unlikely(num_to_process - dequeued < burst_sz)) > burst_sz = num_to_process - dequeued; > > - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); > + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued, > bufs->inputs, You need to add Fixes tag and cc stable. Maxime ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure 2022-12-07 8:40 ` Maxime Coquelin @ 2022-12-07 15:33 ` Chautru, Nicolas 2022-12-09 10:35 ` Maxime Coquelin 0 siblings, 1 reply; 9+ messages in thread From: Chautru, Nicolas @ 2022-12-07 15:33 UTC (permalink / raw) To: Maxime Coquelin, dev; +Cc: Vargas, Hernan, Vipin.Varghese Hi Maxime, I don’t believe this constitutes a fix, just adding more error check to be more comprehensive. Not required for stable branch really. Let me know if you disagree. Can this be applied? Thanks Nic > -----Original Message----- > From: Maxime Coquelin <maxime.coquelin@redhat.com> > Sent: Wednesday, December 7, 2022 12:40 AM > To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org > Cc: Vargas, Hernan <hernan.vargas@intel.com>; Vipin.Varghese@amd.com > Subject: Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure > > > > On 12/6/22 20:14, Nicolas Chautru wrote: > > Adding check for error on return of the rte_bbdev_*_op_alloc_bulk > > calls in bbdev-test. > > > > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> > > --- > > app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > diff --git a/app/test-bbdev/test_bbdev_perf.c > > b/app/test-bbdev/test_bbdev_perf.c > > index b2e536b5e3..a922d69ada 100644 > > --- a/app/test-bbdev/test_bbdev_perf.c > > +++ b/app/test-bbdev/test_bbdev_perf.c > > @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool > *mempool, struct test_buffers *bufs, > > if (unlikely(num_to_process - dequeued < burst_sz)) > > burst_sz = num_to_process - dequeued; > > > > - rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); > > + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, > burst_sz); > > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", > ops_enq); > > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > > copy_reference_fft_op(ops_enq, burst_sz, > dequeued, > > bufs->inputs, > > @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool > *mempool, struct test_buffers *bufs, > > if (unlikely(num_to_process - dequeued < burst_sz)) > > burst_sz = num_to_process - dequeued; > > > > - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, > burst_sz); > > + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, > burst_sz); > > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", > ops_enq); > > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > > copy_reference_dec_op(ops_enq, burst_sz, > dequeued, > > bufs->inputs, > > @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct > rte_mempool *mempool, > > if (unlikely(num_to_process - dequeued < burst_sz)) > > burst_sz = num_to_process - dequeued; > > > > - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, > burst_sz); > > + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, > burst_sz); > > + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", > ops_enq); > > if (test_vector.op_type != RTE_BBDEV_OP_NONE) > > copy_reference_ldpc_dec_op(ops_enq, burst_sz, > dequeued, > > bufs->inputs, > > You need to add Fixes tag and cc stable. > > Maxime ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure 2022-12-07 15:33 ` Chautru, Nicolas @ 2022-12-09 10:35 ` Maxime Coquelin 0 siblings, 0 replies; 9+ messages in thread From: Maxime Coquelin @ 2022-12-09 10:35 UTC (permalink / raw) To: Chautru, Nicolas, dev; +Cc: Vargas, Hernan, Vipin.Varghese Hi Nicolas, On 12/7/22 16:33, Chautru, Nicolas wrote: > Hi Maxime, > > I don’t believe this constitutes a fix, just adding more error check to be more comprehensive. Not required for stable branch really. Let me know if you disagree. I think we should backport it since it constitutes a fix. Without it, user could face a segfault, so it fixes a potential segfault. > Can this be applied? Yes, with fixes tags. I can add them while applying if you agree. Regards, Maxime > Thanks > Nic > >> -----Original Message----- >> From: Maxime Coquelin <maxime.coquelin@redhat.com> >> Sent: Wednesday, December 7, 2022 12:40 AM >> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org >> Cc: Vargas, Hernan <hernan.vargas@intel.com>; Vipin.Varghese@amd.com >> Subject: Re: [PATCH v2 3/3] test/bbdev: explicit check for allocation failure >> >> >> >> On 12/6/22 20:14, Nicolas Chautru wrote: >>> Adding check for error on return of the rte_bbdev_*_op_alloc_bulk >>> calls in bbdev-test. >>> >>> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com> >>> --- >>> app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- >>> 1 file changed, 6 insertions(+), 3 deletions(-) >>> >>> diff --git a/app/test-bbdev/test_bbdev_perf.c >>> b/app/test-bbdev/test_bbdev_perf.c >>> index b2e536b5e3..a922d69ada 100644 >>> --- a/app/test-bbdev/test_bbdev_perf.c >>> +++ b/app/test-bbdev/test_bbdev_perf.c >>> @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool >> *mempool, struct test_buffers *bufs, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); >>> + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_fft_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >>> @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool >> *mempool, struct test_buffers *bufs, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_dec_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >>> @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct >> rte_mempool *mempool, >>> if (unlikely(num_to_process - dequeued < burst_sz)) >>> burst_sz = num_to_process - dequeued; >>> >>> - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, >> burst_sz); >>> + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", >> ops_enq); >>> if (test_vector.op_type != RTE_BBDEV_OP_NONE) >>> copy_reference_ldpc_dec_op(ops_enq, burst_sz, >> dequeued, >>> bufs->inputs, >> >> You need to add Fixes tag and cc stable. >> >> Maxime > ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-12-09 10:35 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-12-06 19:14 [PATCH v2 0/3] test/bbdev: fix build issues with optional build flag Nicolas Chautru 2022-12-06 19:14 ` [PATCH v2 1/3] test/bbdev: fix build issue " Nicolas Chautru 2022-12-07 8:38 ` Maxime Coquelin 2022-12-06 19:14 ` [PATCH v2 2/3] " Nicolas Chautru 2022-12-07 8:39 ` Maxime Coquelin 2022-12-06 19:14 ` [PATCH v2 3/3] test/bbdev: explicit check for allocation failure Nicolas Chautru 2022-12-07 8:40 ` Maxime Coquelin 2022-12-07 15:33 ` Chautru, Nicolas 2022-12-09 10:35 ` Maxime Coquelin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).