From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB5D543284; Sat, 4 Nov 2023 00:42:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4718442E15; Sat, 4 Nov 2023 00:41:43 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 052B640EE1; Sat, 4 Nov 2023 00:41:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699054893; x=1730590893; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cMJDcp5zjjxEXx8xhBTO/ExN8lNfGOFtNK6grDvhRdM=; b=hLrblbyipRPWi65ksoeorIj+ABm/JDV9e0h4Il1b/t9IN5DjzXyMSuJQ QFthRYYBowzXDG75xeBWS7/DW+XPwgV5M93YOe9upNFPzOH2Xq+hW9pj2 pkggA9GBn9XAdTEruYWE3ZlCsKDUxaMtqiUP1APxoXP8beK8fQg9G2BB4 CPvB7wy3s4uQ11vNLP1QSPE5OOMyHtx2VamCcJw0fUBiVz0379QjQH0Bk uAn+V91x0CVY96LcXbwfPh/S3JhNK0ybuWHlWx1OQt7RGeOpILrQ5Mhxq 1qVxpSN9FXgEyAzEOfXuPrLfh/UYh6+Bj/alCb1qDlgKfZ4wsxfvSO4iS A==; X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="386213590" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="386213590" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2023 16:41:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10883"; a="935249164" X-IronPort-AV: E=Sophos;i="6.03,275,1694761200"; d="scan'208";a="935249164" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by orsmga005.jf.intel.com with ESMTP; 03 Nov 2023 16:41:31 -0700 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com, stable@dpdk.org Subject: [PATCH v3 08/10] test/bbdev: support new FFT capabilities Date: Fri, 3 Nov 2023 23:34:11 +0000 Message-Id: <20231103233413.756110-9-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231103233413.756110-1-nicolas.chautru@intel.com> References: <20231103233413.756110-1-nicolas.chautru@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Hernan Vargas Adding support to test new FFT capabilities. Optional frequency domain dewindowing, frequency resampling, timing error correction and time offset per CS. Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- app/test-bbdev/test_bbdev_perf.c | 26 ++++++++++--- app/test-bbdev/test_bbdev_vector.c | 61 ++++++++++++++++++++++++++++-- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index d2e3542356..84596e28da 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -864,6 +864,7 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info, conf.q_fft.num_qgroups = VRB_QMGR_NUM_QGS; conf.q_fft.first_qgroup_index = VRB_QMGR_INVALID_IDX; conf.q_fft.num_aqs_per_groups = VRB_QMGR_NUM_AQS; + conf.q_fft.aq_depth_log2 = VRB_QMGR_AQ_DEPTH; conf.q_mld.num_qgroups = VRB_QMGR_NUM_QGS; conf.q_mld.first_qgroup_index = VRB_QMGR_INVALID_IDX; conf.q_mld.num_aqs_per_groups = VRB_QMGR_NUM_AQS; @@ -1970,7 +1971,7 @@ static void copy_reference_fft_op(struct rte_bbdev_fft_op **ops, unsigned int n, unsigned int start_idx, struct rte_bbdev_op_data *inputs, struct rte_bbdev_op_data *outputs, struct rte_bbdev_op_data *pwrouts, - struct rte_bbdev_fft_op *ref_op) + struct rte_bbdev_op_data *win_inputs, struct rte_bbdev_fft_op *ref_op) { unsigned int i, j; struct rte_bbdev_op_fft *fft = &ref_op->fft; @@ -1982,6 +1983,11 @@ copy_reference_fft_op(struct rte_bbdev_fft_op **ops, unsigned int n, fft->output_leading_depadding; for (j = 0; j < RTE_BBDEV_MAX_CS_2; j++) ops[i]->fft.window_index[j] = fft->window_index[j]; + for (j = 0; j < RTE_BBDEV_MAX_CS; j++) { + ops[i]->fft.cs_theta_0[j] = fft->cs_theta_0[j]; + ops[i]->fft.cs_theta_d[j] = fft->cs_theta_d[j]; + ops[i]->fft.time_offset[j] = fft->time_offset[j]; + } ops[i]->fft.cs_bitmap = fft->cs_bitmap; ops[i]->fft.num_antennas_log2 = fft->num_antennas_log2; ops[i]->fft.idft_log2 = fft->idft_log2; @@ -1992,8 +1998,12 @@ copy_reference_fft_op(struct rte_bbdev_fft_op **ops, unsigned int n, ops[i]->fft.ncs_reciprocal = fft->ncs_reciprocal; ops[i]->fft.power_shift = fft->power_shift; ops[i]->fft.fp16_exp_adjust = fft->fp16_exp_adjust; + ops[i]->fft.output_depadded_size = fft->output_depadded_size; + ops[i]->fft.freq_resample_mode = fft->freq_resample_mode; ops[i]->fft.base_output = outputs[start_idx + i]; ops[i]->fft.base_input = inputs[start_idx + i]; + if (win_inputs != NULL) + ops[i]->fft.dewindowing_input = win_inputs[start_idx + i]; if (pwrouts != NULL) ops[i]->fft.power_meas_output = pwrouts[start_idx + i]; ops[i]->fft.op_flags = fft->op_flags; @@ -2575,7 +2585,7 @@ validate_op_fft_chain(struct rte_bbdev_op_data *op, struct op_data_entries *orig { struct rte_mbuf *m = op->data; uint8_t i, nb_dst_segments = orig_op->nb_segments; - int16_t delt, abs_delt, thres_hold = 3; + int16_t delt, abs_delt, thres_hold = 4; uint32_t j, data_len_iq, error_num; int16_t *ref_out, *op_out; @@ -2754,6 +2764,9 @@ create_reference_fft_op(struct rte_bbdev_fft_op *op) entry = &test_vector.entries[DATA_INPUT]; for (i = 0; i < entry->nb_segments; ++i) op->fft.base_input.length += entry->segments[i].length; + entry = &test_vector.entries[DATA_HARQ_INPUT]; + for (i = 0; i < entry->nb_segments; ++i) + op->fft.dewindowing_input.length += entry->segments[i].length; } static void @@ -3722,7 +3735,8 @@ throughput_intr_lcore_fft(void *arg) num_to_process); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_fft_op(ops, num_to_process, 0, bufs->inputs, - bufs->hard_outputs, bufs->soft_outputs, tp->op_params->ref_fft_op); + bufs->hard_outputs, bufs->soft_outputs, bufs->harq_inputs, + tp->op_params->ref_fft_op); /* Set counter to validate the ordering */ for (j = 0; j < num_to_process; ++j) @@ -4596,7 +4610,7 @@ throughput_pmd_lcore_fft(void *arg) if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_fft_op(ops_enq, num_ops, 0, bufs->inputs, - bufs->hard_outputs, bufs->soft_outputs, ref_op); + bufs->hard_outputs, bufs->soft_outputs, bufs->harq_inputs, ref_op); /* Set counter to validate the ordering */ for (j = 0; j < num_ops; ++j) @@ -5452,7 +5466,7 @@ latency_test_fft(struct rte_mempool *mempool, 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, + bufs->hard_outputs, bufs->soft_outputs, bufs->harq_inputs, ref_op); /* Set counter to validate the ordering */ @@ -5714,7 +5728,7 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, 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, + bufs->hard_outputs, bufs->soft_outputs, bufs->harq_inputs, ref_op); /* Start time meas for enqueue function offload latency */ diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c index 8f464db838..56b882533c 100644 --- a/app/test-bbdev/test_bbdev_vector.c +++ b/app/test-bbdev/test_bbdev_vector.c @@ -215,7 +215,6 @@ op_ldpc_decoder_flag_strtoul(char *token, uint32_t *op_flag_value) return 0; } - /* Convert FFT flag from string to unsigned long int. */ static int op_fft_flag_strtoul(char *token, uint32_t *op_flag_value) @@ -236,6 +235,14 @@ op_fft_flag_strtoul(char *token, uint32_t *op_flag_value) *op_flag_value = RTE_BBDEV_FFT_FP16_INPUT; else if (!strcmp(token, "RTE_BBDEV_FFT_FP16_OUTPUT")) *op_flag_value = RTE_BBDEV_FFT_FP16_OUTPUT; + else if (!strcmp(token, "RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS")) + *op_flag_value = RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS; + else if (!strcmp(token, "RTE_BBDEV_FFT_TIMING_ERROR")) + *op_flag_value = RTE_BBDEV_FFT_TIMING_ERROR; + else if (!strcmp(token, "RTE_BBDEV_FFT_DEWINDOWING")) + *op_flag_value = RTE_BBDEV_FFT_DEWINDOWING; + else if (!strcmp(token, "RTE_BBDEV_FFT_FREQ_RESAMPLING")) + *op_flag_value = RTE_BBDEV_FFT_FREQ_RESAMPLING; else { printf("The given value is not a FFT flag\n"); return -1; @@ -907,8 +914,7 @@ parse_ldpc_decoder_params(const char *key_token, char *token, return 0; } - -/* Parse FFT parameters and assigns to global variable. */ +/* Parses FFT parameters and assigns to global variable. */ static int parse_fft_params(const char *key_token, char *token, struct test_bbdev_vector *vector) @@ -923,6 +929,10 @@ parse_fft_params(const char *key_token, char *token, ret = parse_data_entry(key_token, token, vector, DATA_INPUT, op_data_prefixes[DATA_INPUT]); + } else if (starts_with(key_token, "dewin_input")) { + ret = parse_data_entry(key_token, token, vector, + DATA_HARQ_INPUT, + "dewin_input"); } else if (starts_with(key_token, "output")) { ret = parse_data_entry(key_token, token, vector, DATA_HARD_OUTPUT, @@ -989,6 +999,51 @@ parse_fft_params(const char *key_token, char *token, fft->fp16_exp_adjust = (uint32_t) strtoul(token, &err, 0); printf("%d\n", fft->fp16_exp_adjust); ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; + } else if (!strcmp(key_token, "freq_resample_mode")) { + fft->freq_resample_mode = (uint32_t) strtoul(token, &err, 0); + ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; + } else if (!strcmp(key_token, "out_depadded_size")) { + fft->output_depadded_size = (uint32_t) strtoul(token, &err, 0); + ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; + } else if (!strcmp(key_token, "cs_theta_0")) { + tok = strtok(token, VALUE_DELIMITER); + if (tok == NULL) + return -1; + for (i = 0; i < FFT_WIN_SIZE; i++) { + fft->cs_theta_0[i] = (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, "cs_theta_d")) { + tok = strtok(token, VALUE_DELIMITER); + if (tok == NULL) + return -1; + for (i = 0; i < FFT_WIN_SIZE; i++) { + fft->cs_theta_d[i] = (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, "time_offset")) { + tok = strtok(token, VALUE_DELIMITER); + if (tok == NULL) + return -1; + for (i = 0; i < FFT_WIN_SIZE; i++) { + fft->time_offset[i] = (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); -- 2.34.1