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 241B9423FE; Tue, 17 Jan 2023 17:50:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4410E42BD9; Tue, 17 Jan 2023 17:50:29 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B2D89400D4 for ; Tue, 17 Jan 2023 17:50:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673974225; x=1705510225; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LYMJReGSbjlkU9fe6kJQYtsMSvKgN9cQxcWOdgWNKi4=; b=Y78UoeVNcSy4BF2hfdB8RW28UdTYqwqv/Nho+4zyEeWi/WygVw0a3PFE hfqw7Q09W2a7O6GU+vvvhujrpPkwGv6M5uIb9KXCz0YYR31HwBVvVxPjf GA4a4WNOLpvMMWMX4AzgfqPgcDzc8GbTNYLb0aRetvI/GbTiThgnQqshl 4urL88c7fAHTyB1fRoRpkfmzqz1r11hO88o9cqLXPhAx+g09W+RdPBPhq Atu5U6h5rmwq54BcMQpcLQC/+1X5SPsOGYXxQhRDoYYQIC9QEw2IAFEXD mHYxBoF+cKl2d9B/P2o7K40DvHpF61ciTB/9KMceGsp6EEcs/QSrTb/kc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="326022061" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="326022061" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 08:50:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10592"; a="833235093" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="833235093" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga005.jf.intel.com with ESMTP; 17 Jan 2023 08:50:23 -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 v1 03/13] test/bbdev: add timeout for latency tests Date: Tue, 17 Jan 2023 08:50:13 -0800 Message-Id: <20230117165023.20567-4-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230117165023.20567-1-hernan.vargas@intel.com> References: <20230117165023.20567-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 | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 1a8a6b9f82..14fe76eb64 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 @@ -4544,6 +4545,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; @@ -4595,7 +4597,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); @@ -4604,7 +4607,13 @@ 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) { + ret = TEST_FAILED; + dequeued = num_to_process; /* Force exit */ + struct rte_bbdev_info info; + 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!"); @@ -4630,6 +4639,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; @@ -4665,13 +4675,19 @@ 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) { + ret = TEST_FAILED; + dequeued = num_to_process; /* Force exit */ + struct rte_bbdev_info info; + 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