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 A80B2A00C3; Wed, 7 Dec 2022 09:39:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95F2442C54; Wed, 7 Dec 2022 09:39:16 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D7420410D7 for ; Wed, 7 Dec 2022 09:39:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670402355; 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=cytRmT+yBGGsxRoIcgXaIgwjIzclFAnqIEViKOUdbzY=; b=ZTmkre0sMbXcnPxhKDkhS83yS9LqEFOVupY3zMHFvsSx8acV/+bywAGhQZElf0ZM+zuqxI myZPf0TRJ9I8b1EMnRf4P5HEnmlTvj6XFuGoymgOOP84V5dq7OGJhjOQDKW46CQEmoDcVK WgTmVNu4SAyOVholYWhntVAjqo/9OZU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-531-QFGM2SX2N5GRPql1vqp9bA-1; Wed, 07 Dec 2022 03:39:11 -0500 X-MC-Unique: QFGM2SX2N5GRPql1vqp9bA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DB4FC29AA383; Wed, 7 Dec 2022 08:39:10 +0000 (UTC) Received: from [10.39.208.28] (unknown [10.39.208.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C9F871121314; Wed, 7 Dec 2022 08:39:09 +0000 (UTC) Message-ID: Date: Wed, 7 Dec 2022 09:39:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 2/3] test/bbdev: fix build issue with optional build flag To: Nicolas Chautru , dev@dpdk.org, "stable@dpdk.org" Cc: hernan.vargas@intel.com, Vipin.Varghese@amd.com References: <20221206191441.12428-1-nicolas.chautru@intel.com> <20221206191441.12428-3-nicolas.chautru@intel.com> From: Maxime Coquelin In-Reply-To: <20221206191441.12428-3-nicolas.chautru@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 12/6/22 20:14, Nicolas Chautru wrote: > Missing implementation for offload test with FFT. > Only build when the optional build flag RTE_BBDEV_OFFLOAD_COST > is set. > > Fixes: 0acdb9866756 ("test/bbdev: add FFT operations cases") Same here, adding stable@dpdk.org. > Signed-off-by: Nicolas Chautru > --- > app/test-bbdev/test_bbdev_perf.c | 82 ++++++++++++++++++++++++++++++++ > 1 file changed, 82 insertions(+) > > diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c > index 1859952901..b2e536b5e3 100644 > --- a/app/test-bbdev/test_bbdev_perf.c > +++ b/app/test-bbdev/test_bbdev_perf.c > @@ -4940,6 +4940,88 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, > return 0; > } > > +static int > +offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, > + struct rte_bbdev_fft_op *ref_op, uint16_t dev_id, > + uint16_t queue_id, const uint16_t num_to_process, > + uint16_t burst_sz, struct test_time_stats *time_st) > +{ > + int i, dequeued, ret; > + struct rte_bbdev_fft_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST]; > + uint64_t enq_start_time, deq_start_time; > + uint64_t enq_sw_last_time, deq_last_time; > + struct rte_bbdev_stats stats; > + > + for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) { > + uint16_t enq = 0, deq = 0; > + > + if (unlikely(num_to_process - dequeued < burst_sz)) > + burst_sz = num_to_process - dequeued; > + > + rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); > + if (test_vector.op_type != RTE_BBDEV_OP_NONE) > + copy_reference_fft_op(ops_enq, burst_sz, dequeued, > + bufs->inputs, > + bufs->hard_outputs, bufs->soft_outputs, > + ref_op); > + > + /* Start time meas for enqueue function offload latency */ > + enq_start_time = rte_rdtsc_precise(); > + do { > + enq += rte_bbdev_enqueue_fft_ops(dev_id, queue_id, > + &ops_enq[enq], burst_sz - enq); > + } while (unlikely(burst_sz != enq)); > + > + ret = get_bbdev_queue_stats(dev_id, queue_id, &stats); > + TEST_ASSERT_SUCCESS(ret, > + "Failed to get stats for queue (%u) of device (%u)", > + queue_id, dev_id); > + > + enq_sw_last_time = rte_rdtsc_precise() - enq_start_time - > + stats.acc_offload_cycles; > + time_st->enq_sw_max_time = RTE_MAX(time_st->enq_sw_max_time, > + enq_sw_last_time); > + time_st->enq_sw_min_time = RTE_MIN(time_st->enq_sw_min_time, > + enq_sw_last_time); > + time_st->enq_sw_total_time += enq_sw_last_time; > + > + time_st->enq_acc_max_time = RTE_MAX(time_st->enq_acc_max_time, > + stats.acc_offload_cycles); > + time_st->enq_acc_min_time = RTE_MIN(time_st->enq_acc_min_time, > + stats.acc_offload_cycles); > + time_st->enq_acc_total_time += stats.acc_offload_cycles; > + > + /* give time for device to process ops */ > + rte_delay_us(WAIT_OFFLOAD_US); > + > + /* Start time meas for dequeue function offload latency */ > + deq_start_time = rte_rdtsc_precise(); > + /* Dequeue one operation */ > + do { > + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, > + &ops_deq[deq], enq); > + } while (unlikely(deq == 0)); > + > + deq_last_time = rte_rdtsc_precise() - deq_start_time; > + time_st->deq_max_time = RTE_MAX(time_st->deq_max_time, > + deq_last_time); > + time_st->deq_min_time = RTE_MIN(time_st->deq_min_time, > + deq_last_time); > + time_st->deq_total_time += deq_last_time; > + > + /* Dequeue remaining operations if needed*/ > + while (burst_sz != deq) > + deq += rte_bbdev_dequeue_fft_ops(dev_id, queue_id, > + &ops_deq[deq], burst_sz - deq); > + > + rte_bbdev_fft_op_free_bulk(ops_enq, deq); > + dequeued += deq; > + } > + > + return i; > +} > + > + > static int > offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, > struct rte_bbdev_dec_op *ref_op, uint16_t dev_id, Reviewed-by: Maxime Coquelin Thanks, Maxime