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 D5C3F41B8D; Tue, 31 Jan 2023 11:02:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68E2B40DFB; Tue, 31 Jan 2023 11:02:23 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 5E48D4067B for ; Tue, 31 Jan 2023 11:02:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675159341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ngiOdLmdg5EXTniLs/R5t2FFw+J58P+eAqbRZ/Qp8jM=; b=O9tijAyGKs23C4RreA+GsfAEBc6g62JFzKLcDPdAk2qgeOYjm4RLw5nlsgEUp+EiaggaYU 86R9lXw4Jg14A1WH9fAaFUHtXaN9hnSAMjY+KWdtFUUdRPvYZODA4Nxh6uMM4nK7rxU3Fl ha9cVVMW/kZER+TeSUzQ18hnMQBIk+8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-x6acUGuxMQOcR2h-F5CVew-1; Tue, 31 Jan 2023 05:02:18 -0500 X-MC-Unique: x6acUGuxMQOcR2h-F5CVew-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51AD0800186; Tue, 31 Jan 2023 10:02:18 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06E02492C3E; Tue, 31 Jan 2023 10:02:16 +0000 (UTC) Message-ID: <1639469b-213a-d782-8234-a34cbe688df7@redhat.com> Date: Tue, 31 Jan 2023 11:02:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com References: <20230117165023.20567-1-hernan.vargas@intel.com> <20230117165023.20567-4-hernan.vargas@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v1 03/13] test/bbdev: add timeout for latency tests In-Reply-To: <20230117165023.20567-4-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 1/17/23 17:50, Hernan Vargas wrote: > 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 */ This should not be necessary, as TEST_ASSERT_SUCCESS() hides a return statement. > + struct rte_bbdev_info info; Don't mix declaration & code. > + 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!"); Same comments here. > + } 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!"); > }