Hi Maxime, 

> -----Original Message-----
> From: Maxime Coquelin <maxime.coque...@redhat.com>
> Sent: Wednesday, June 12, 2024 4:11 AM
> To: Vargas, Hernan <hernan.var...@intel.com>; dev@dpdk.org;
> gak...@marvell.com; t...@redhat.com
> Cc: Chautru, Nicolas <nicolas.chau...@intel.com>; Zhang, Qi Z
> <qi.z.zh...@intel.com>
> Subject: Re: [PATCH v1 7/9] test/bbdev: check assumptions on fft window
> 
> 
> 
> On 4/22/24 21:07, Hernan Vargas wrote:
> > Add check for FFT window width.
> >
> > Signed-off-by: Hernan Vargas <hernan.var...@intel.com>
> > ---
> >   app/test-bbdev/test_bbdev_perf.c   | 26 ++++++++++++++++++++++----
> >   app/test-bbdev/test_bbdev_vector.c | 14 ++++++++++++++
> >   app/test-bbdev/test_bbdev_vector.h |  2 ++
> >   3 files changed, 38 insertions(+), 4 deletions(-)
> >
> > diff --git a/app/test-bbdev/test_bbdev_perf.c
> > b/app/test-bbdev/test_bbdev_perf.c
> > index 28d78e73a9c1..57b21730cab2 100644
> > --- a/app/test-bbdev/test_bbdev_perf.c
> > +++ b/app/test-bbdev/test_bbdev_perf.c
> > @@ -106,6 +106,8 @@ static int ldpc_llr_decimals;
> >   static int ldpc_llr_size;
> >   /* Keep track of the LDPC decoder device capability flag */
> >   static uint32_t ldpc_cap_flags;
> > +/* FFT window width predefined on device and on vector. */ static int
> > +fft_window_width_dev;
> >
> >   /* Represents tested active devices */
> >   static struct active_device {
> > @@ -881,6 +883,13 @@ add_bbdev_dev(uint8_t dev_id, struct
> rte_bbdev_info *info,
> >     rte_bbdev_info_get(dev_id, info);
> >     if (info->drv.device_status == RTE_BBDEV_DEV_FATAL_ERR)
> >             printf("Device Status %s\n",
> > rte_bbdev_device_status_str(info->drv.device_status));
> > +   if (info->drv.fft_window_width != NULL)
> > +           fft_window_width_dev = info->drv.fft_window_width[0];
> > +   else
> > +           fft_window_width_dev = 0;
> > +   if (fft_window_width_dev != 0)
> > +           printf("  FFT Window0 width %d\n", fft_window_width_dev);
> 
> Why not print the value systematically?

It would only be zero if the application was not able to get that information, 
hence that would be irrelevant. 

> 
> > +
> >     nb_queues = RTE_MIN(rte_lcore_count(), info-
> >drv.max_num_queues);
> >     nb_queues = RTE_MIN(nb_queues, (unsigned int) MAX_QUEUES);
> >
> > @@ -2583,7 +2592,8 @@ validate_ldpc_enc_op(struct rte_bbdev_enc_op
> **ops, const uint16_t n,
> >   }
> >
> >   static inline int
> > -validate_op_fft_chain(struct rte_bbdev_op_data *op, struct
> > op_data_entries *orig_op)
> > +validate_op_fft_chain(struct rte_bbdev_op_data *op, struct
> op_data_entries *orig_op,
> > +           bool skip_validate_output)
> >   {
> >     struct rte_mbuf *m = op->data;
> >     uint8_t i, nb_dst_segments = orig_op->nb_segments; @@ -2613,7
> > +2623,7 @@ validate_op_fft_chain(struct rte_bbdev_op_data *op, struct
> op_data_entries *orig
> >                     abs_delt = delt > 0 ? delt : -delt;
> >                     error_num += (abs_delt > thres_hold ? 1 : 0);
> >             }
> > -           if (error_num > 0) {
> > +           if ((error_num > 0) && !skip_validate_output) {
> >                     rte_memdump(stdout, "Buffer A", ref_out, data_len);
> >                     rte_memdump(stdout, "Buffer B", op_out, data_len);
> >                     TEST_ASSERT(error_num == 0,
> > @@ -2686,16 +2696,24 @@ validate_fft_op(struct rte_bbdev_fft_op **ops,
> const uint16_t n,
> >     int ret;
> >     struct op_data_entries *fft_data_orig =
> &test_vector.entries[DATA_HARD_OUTPUT];
> >     struct op_data_entries *fft_pwr_orig =
> > &test_vector.entries[DATA_SOFT_OUTPUT];
> > +   bool skip_validate_output = false;
> > +
> > +   if ((test_vector.fft_window_width_vec > 0) &&
> > +                   (test_vector.fft_window_width_vec !=
> fft_window_width_dev)) {
> > +           printf("The vector FFT width doesn't match with device - skip
> %d %d\n",
> > +                           test_vector.fft_window_width_vec,
> fft_window_width_dev);
> > +           skip_validate_output = true;
> > +   }
> >
> >     for (i = 0; i < n; ++i) {
> >             ret = check_fft_status_and_ordering(ops[i], i, ref_op->status);
> >             TEST_ASSERT_SUCCESS(ret, "Checking status and ordering for
> FFT failed");
> >             TEST_ASSERT_SUCCESS(validate_op_fft_chain(
> > -                           &ops[i]->fft.base_output, fft_data_orig),
> > +                           &ops[i]->fft.base_output, fft_data_orig,
> skip_validate_output),
> >                             "FFT Output buffers (op=%u) are not
> matched", i);
> >             if (check_bit(ops[i]->fft.op_flags,
> RTE_BBDEV_FFT_POWER_MEAS))
> >                     TEST_ASSERT_SUCCESS(validate_op_fft_chain(
> > -                           &ops[i]->fft.power_meas_output,
> fft_pwr_orig),
> > +                           &ops[i]->fft.power_meas_output,
> fft_pwr_orig,
> > +skip_validate_output),
> >                             "FFT Power Output buffers (op=%u) are not
> matched", i);
> >     }
> >
> > diff --git a/app/test-bbdev/test_bbdev_vector.c
> > b/app/test-bbdev/test_bbdev_vector.c
> > index b3e9d4bb7504..e48947b211ac 100644
> > --- a/app/test-bbdev/test_bbdev_vector.c
> > +++ b/app/test-bbdev/test_bbdev_vector.c
> > @@ -1050,6 +1050,20 @@ parse_fft_params(const char *key_token, char
> *token,
> >                     }
> >             }
> >             ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
> > +   } else if (!strcmp(key_token, "fft_window_width")) {
> > +           tok = strtok(token, VALUE_DELIMITER);
> > +           if (tok == NULL)
> > +                   return -1;
> > +           for (i = 0; i < FFT_WIN_SIZE; i++) {
> > +                   if (i == 0)
> > +                           vector->fft_window_width_vec = (uint32_t)
> strtoul(tok, &err, 0);
> > +                   if (i < (FFT_WIN_SIZE - 1)) {
> > +                           tok = strtok(NULL, VALUE_DELIMITER);
> > +                           if (tok == NULL)
> > +                                   return -1;
> > +                   }
> > +           }
> > +           ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
> >     } else if (!strcmp(key_token, "op_flags")) {
> >             vector->mask |= TEST_BBDEV_VF_OP_FLAGS;
> >             ret = parse_turbo_flags(token, &op_flags, vector->op_type);
> diff
> > --git a/app/test-bbdev/test_bbdev_vector.h
> > b/app/test-bbdev/test_bbdev_vector.h
> > index 14b8ef2764ad..ba1d0d20f9ea 100644
> > --- a/app/test-bbdev/test_bbdev_vector.h
> > +++ b/app/test-bbdev/test_bbdev_vector.h
> > @@ -69,6 +69,8 @@ struct test_bbdev_vector {
> >     };
> >     /* Additional storage for op data entries */
> >     struct op_data_entries entries[DATA_NUM_TYPES];
> > +   /* Vector FFT window width assumption. */
> > +   uint16_t fft_window_width_vec;
> >   };
> >
> >   /* fills test vector parameters based on test file */

Reply via email to