From patchwork Fri Oct 27 22:57:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 133521 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 644014321A; Sat, 28 Oct 2023 01:04:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B25BF42DD7; Sat, 28 Oct 2023 01:04:18 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id A02AB40649; Sat, 28 Oct 2023 01:04:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698447853; x=1729983853; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qq+AUxo7Juogf5ZYSj0/UmxhFtawmRfgRZa0z1n88lo=; b=a4kx0JCXIro4JVrGOB/eWM5vJFnsGLLIFC3chece7T6SAX1sIvqJoWNz HovfXj6RorRXAAxzdaRDQ0TrNoI7m9eM85ptVl2BeKuOJmaQ2tcEfKy/m T8sbdVikyIztTat7wzsFYLgZGRSZ9x4Hfj5optAZKP1Qe2IlfGpP2XIOA F2pFlZhElZk0wvZhbQ6fbYb2f39zg4K2fDa8p7SKuLa+kSE3BQHBGDFl4 oCivWiSjq36V8+4gwmX1HKeEiIEgJtYRsNtUJI6mk2TTXxdQIyWeq/lZX xdhgfznwW0vLjU/atuCnTZfuDXpdN10XmO5wxscWBIozBbCQCkhbMawhn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="6494077" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="6494077" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2023 16:04:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="825496966" X-IronPort-AV: E=Sophos;i="6.03,257,1694761200"; d="scan'208";a="825496966" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by fmsmga008.fm.intel.com with ESMTP; 27 Oct 2023 16:04:10 -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 v2 04/10] test/bbdev: handle exception for LLR generation Date: Fri, 27 Oct 2023 22:57:22 +0000 Message-Id: <20231027225728.563914-5-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231027225728.563914-1-nicolas.chautru@intel.com> References: <20231027225728.563914-1-nicolas.chautru@intel.com> MIME-Version: 1.0 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 Add range limit to prevent LLR generation greater than the data buffer size. Fixes: 7831a9684356 ("test/bbdev: support BLER for 4G") Cc: stable@dpdk.org Signed-off-by: Hernan Vargas --- app/test-bbdev/test_bbdev_perf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index d4c001de00..54cb2090f9 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -1838,6 +1838,12 @@ generate_turbo_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs, range = ref_op->turbo_dec.input.length; N0 = 1.0 / pow(10.0, get_snr() / 10.0); + if (range > inputs[0].data->data_len) { + printf("Warning: Limiting LLR generation to first segment (%d from %d)\n", + inputs[0].data->data_len, range); + range = inputs[0].data->data_len; + } + for (i = 0; i < n; ++i) { m = inputs[i].data; int8_t *llrs = rte_pktmbuf_mtod_offset(m, int8_t *, 0);