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 1944141CA8; Wed, 15 Feb 2023 18:13:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A922E42D30; Wed, 15 Feb 2023 18:13:06 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 1AE8241141 for ; Wed, 15 Feb 2023 18:13:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676481181; x=1708017181; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YbqSPEQMfjcvB8EsBe9R/pEXrCtHt7MVWdL5NTioHGw=; b=Mhj7Kvk5WrOj86IFi5WNsR5Z6JIFdBL19jJBTeGR2S9xtc2Q7kfyNBIK jZlxqnkUDGgr6IlwJsJuP3GSFfYP2RHu3ExzR8SqyGh7T+eUvYMPxSuoT M7SRXP1hGtvrLoHyDdFsCHUeqxvFMaTOshf4LYn9aeSrahWLId42Zw+e1 9IfQ6lnx6x7BqfFeUeA9FixRYMDfHWhPT0NMTmxdSAg//fPozy0UTdOmj /51DMN7W8Z+fNYVb0x34bu6LHF0xDFC1Rofqu63sR06Ia8OVqTzPPlYCX EJLtJ2qOTdijJXfFiCvwPghiThv2aGKTR6VFGCj827H6d4CnA65PQ+moB Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="332789800" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="332789800" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:09:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="758489616" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="758489616" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by FMSMGA003.fm.intel.com with ESMTP; 15 Feb 2023 09:09:57 -0800 From: Hernan Vargas To: dev@dpdk.org, maxime.coquelin@redhat.com, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v2 04/16] test/bbdev: add timeout for latency tests Date: Wed, 15 Feb 2023 09:09:37 -0800 Message-Id: <20230215170949.60569-5-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230215170949.60569-1-hernan.vargas@intel.com> References: <20230215170949.60569-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 Add a timeout to force exit the latency tests in case dequeue never happens. Signed-off-by: Hernan Vargas --- app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 19b9a5b119..dede0f900e 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -26,6 +26,7 @@ #define MAX_QUEUES RTE_MAX_LCORE #define TEST_REPETITIONS 100 +#define TIME_OUT_POLL 1e8 #define WAIT_OFFLOAD_US 1000 #ifdef RTE_BASEBAND_FPGA_LTE_FEC @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool *mempool, for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) { uint16_t enq = 0, deq = 0; + uint32_t time_out = 0; bool first_time = true; last_time = 0; @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool *mempool, last_time = rte_rdtsc_precise() - start_time; first_time = false; } - } while (unlikely(burst_sz != deq)); + time_out++; + } while ((burst_sz != deq) && (time_out < TIME_OUT_POLL)); *max_time = RTE_MAX(*max_time, last_time); *min_time = RTE_MIN(*min_time, last_time); @@ -4606,7 +4609,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool, if (extDdr) retrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz); - if (test_vector.op_type != RTE_BBDEV_OP_NONE) { + if (burst_sz != deq) { + struct rte_bbdev_info info; + ret = TEST_FAILED; + rte_bbdev_info_get(dev_id, &info); + TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!"); + } else if (test_vector.op_type != RTE_BBDEV_OP_NONE) { ret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op, vector_mask); TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@ -4632,6 +4640,7 @@ latency_test_enc(struct rte_mempool *mempool, for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) { uint16_t enq = 0, deq = 0; + uint32_t time_out = 0; bool first_time = true; last_time = 0; @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool *mempool, last_time += rte_rdtsc_precise() - start_time; first_time = false; } - } while (unlikely(burst_sz != deq)); + time_out++; + } while ((burst_sz != deq) && (time_out < TIME_OUT_POLL)); *max_time = RTE_MAX(*max_time, last_time); *min_time = RTE_MIN(*min_time, last_time); *total_time += last_time; - - if (test_vector.op_type != RTE_BBDEV_OP_NONE) { + if (burst_sz != deq) { + struct rte_bbdev_info info; + ret = TEST_FAILED; + rte_bbdev_info_get(dev_id, &info); + TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!"); + } else if (test_vector.op_type != RTE_BBDEV_OP_NONE) { ret = validate_enc_op(ops_deq, burst_sz, ref_op); TEST_ASSERT_SUCCESS(ret, "Validation failed!"); } -- 2.37.1