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 9A1EE454E2; Mon, 24 Jun 2024 17:08:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53A1D41104; Mon, 24 Jun 2024 17:07:21 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mails.dpdk.org (Postfix) with ESMTP id 3706F40A6E for ; Mon, 24 Jun 2024 17:07:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719241633; x=1750777633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZIFowcc829MXQU495wUmrP8EEtUX8yNtfNepdjAgDAQ=; b=hkqgbiveBxY6wSIDQ9IcxS2JkAn0B8/AXTxO4lCVh9cmGYN5mDZOY7Es XYYcBvCHu0Z21/CwI+v6Evy8O4fQPsIKuLZP0Jo5aGjgjsqQ/rKnx99+x CzCSCRKI2Qttuvhf/8/L2a1pOU9Q33XPN+uaiXucpzh98Ttzk8CB6vBQu z/VKhnHsGwAr2QYqnEilKszZoqC0/ARoKs0lQYx8YRAQ8LINGvE5N5Mkr NUJX5afsQvTEROMN7iNxGp8hpxiDJI+OELCVd6Iwq6sXLvJxh0ephfXBd AD6aizmSOHUfiyyC1q5Pc7QuDzu5gIhb0NSfRD4j4TP1+b8hgEjGZFLRb w==; X-CSE-ConnectionGUID: sKHAGxfDQ7SawxZQEKKOJw== X-CSE-MsgGUID: ElonrMJ/Qv+TM4yeXe7CqA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16042046" X-IronPort-AV: E=Sophos;i="6.08,262,1712646000"; d="scan'208";a="16042046" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2024 08:07:12 -0700 X-CSE-ConnectionGUID: oD+LRLQ/Qc25K97DyTIC0A== X-CSE-MsgGUID: BirApNhjRduu2xPWjj/GZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,262,1712646000"; d="scan'208";a="44025877" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orviesa008.jf.intel.com with ESMTP; 24 Jun 2024 08:07:12 -0700 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com, maxime.coquelin@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v2 8/9] test/bbdev: update fft measurement output Date: Mon, 24 Jun 2024 08:02:36 -0700 Message-Id: <20240624150237.47169-9-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240624150237.47169-1-hernan.vargas@intel.com> References: <20240624150237.47169-1-hernan.vargas@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 Update check for FFT measurement output to better account for tolerance. Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- app/test-bbdev/test_bbdev_perf.c | 52 +++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 7c414ab360a8..3a94f15a30b8 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -2639,6 +2639,56 @@ validate_op_fft_chain(struct rte_bbdev_op_data *op, struct op_data_entries *orig return TEST_SUCCESS; } +static inline int +validate_op_fft_meas_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; + double thres_hold = 1.0; + uint32_t j, data_len_iq, error_num; + int32_t *ref_out, *op_out; + double estSNR, refSNR, delt, abs_delt; + + TEST_ASSERT(nb_dst_segments == m->nb_segs, + "Number of segments differ in original (%u) and filled (%u) op fft", + nb_dst_segments, m->nb_segs); + + /* Due to size limitation of mbuf, FFT doesn't use real mbuf. */ + for (i = 0; i < nb_dst_segments; ++i) { + uint16_t offset = (i == 0) ? op->offset : 0; + uint32_t data_len = op->length; + + TEST_ASSERT(orig_op->segments[i].length == data_len, + "Length of segment differ in original (%u) and filled (%u) op fft", + orig_op->segments[i].length, data_len); + + /* Divided by 4 to get the number of 32 bits data. */ + data_len_iq = data_len >> 2; + ref_out = (int32_t *)(orig_op->segments[i].addr); + op_out = rte_pktmbuf_mtod_offset(m, int32_t *, offset); + error_num = 0; + for (j = 0; j < data_len_iq; j++) { + estSNR = 10*log10(op_out[j]); + refSNR = 10*log10(ref_out[j]); + delt = refSNR - estSNR; + abs_delt = delt > 0 ? delt : -delt; + error_num += (abs_delt > thres_hold ? 1 : 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, + "FFT Output are not matched total (%u) errors (%u)", + data_len_iq, error_num); + } + + m = m->next; + } + + return TEST_SUCCESS; +} + static inline int validate_op_mldts_chain(struct rte_bbdev_op_data *op, struct op_data_entries *orig_op) @@ -2714,7 +2764,7 @@ validate_fft_op(struct rte_bbdev_fft_op **ops, const uint16_t n, &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( + TEST_ASSERT_SUCCESS(validate_op_fft_meas_chain( &ops[i]->fft.power_meas_output, fft_pwr_orig, skip_validate_output), "FFT Power Output buffers (op=%u) are not matched", i); } -- 2.37.1