From patchwork Tue Dec 13 16:18:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 120841 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 14CF8A0540; Tue, 13 Dec 2022 17:20:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E86442D21; Tue, 13 Dec 2022 17:20:02 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B4CC540146; Tue, 13 Dec 2022 17:19:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670948400; x=1702484400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Kv55rpOymXJHf7DzPyLmRroFhexZsLYQncIIQuzjfYU=; b=fZI2V/4wta4zHSiWpH8sn5jZ03CAA9yiFCiK4JgiRYg9/q2a3qY1gNEy DpThma0RWATQt9+vcwZ0Qpdsc2HwtAJJWMx84iZZLO/uHVu+Kw6iCWtL4 QFbmogbR+uZAEuROHb/C0a8ccXurPNiobLi5Qmkf/bPO1y0js6Y6bGz01 sKxsxoicVXNilIxSrqu2ZBzzLk5rFzyy6v5i9C4UvaMcMze8Pkw4N/gqj AHW05pIFjEZ052xJ5ismKa3+7kmZQqG+hStKIyok/Qnym/IKNLeHX/ItA u1oOqHthcM+OIU36SgWBM24NPltgDoOuaTQfzZEbUjPEWRhxdfOYsywuC Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="319309735" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="319309735" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 08:19:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="755467614" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="755467614" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by fmsmga002.fm.intel.com with ESMTP; 13 Dec 2022 08:19:09 -0800 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hernan.vargas@intel.com, Vipin.Varghese@amd.com, stable@dpdk.org, Nicolas Chautru Subject: [PATCH v3 1/3] test/bbdev: fix build issue with optional build flag Date: Tue, 13 Dec 2022 08:18:53 -0800 Message-Id: <20221213161855.12970-2-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221213161855.12970-1-nicolas.chautru@intel.com> References: <20221213161855.12970-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 Incorrect bbdev member name used in test code under RTE_BBDEV_OFFLOAD_COST build flag. Fixes: 4f08028c5e24 ("bbdev: expose queue related warning and status") Cc: stable@dpdk.org Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin --- app/test-bbdev/test_bbdev_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index b285d3f3a7..1859952901 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4933,8 +4933,8 @@ get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id, stats->dequeued_count = q_stats->dequeued_count; stats->enqueue_err_count = q_stats->enqueue_err_count; stats->dequeue_err_count = q_stats->dequeue_err_count; - stats->enqueue_warning_count = q_stats->enqueue_warning_count; - stats->dequeue_warning_count = q_stats->dequeue_warning_count; + stats->enqueue_warn_count = q_stats->enqueue_warn_count; + stats->dequeue_warn_count = q_stats->dequeue_warn_count; stats->acc_offload_cycles = q_stats->acc_offload_cycles; return 0; From patchwork Tue Dec 13 16:18:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 120840 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 1B9E6A0540; Tue, 13 Dec 2022 17:20:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D16042D14; Tue, 13 Dec 2022 17:20:01 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 3262A400D5; Tue, 13 Dec 2022 17:19:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670948399; x=1702484399; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ullhLoy59xn8kHGHkkGu6oXvnnWspGBx6rYlQ+QHnUg=; b=athOAYxCuvInm08UworTRrjD5Qvzx8ImOjkjnrHV0f4vkC8f/EkUf3SN 6D8RbPdK/auW7iwmCzPMOVD9xQDDt8afPY+9TTRpeoHLYiZFPEtFAIL2H Fx0kGLIU9pgO04OG0Zcy6hJ3uOEhbQfGcLQ3J/zOA+TjrYDqC7Ppz7lZ2 M+3M/wh5W90NLRX8uKj8boBg5p8DSS/hZDcVJ9L8UjBxEs3paIUA068vq 82AufHF26wIf5TNOYXBf7Q6FIkWjItgO1CEY7D/LLJ2BuR7GUsS4VT4eD iqdKnPi96d7heu+m33WMH0RbLTtloRDmIzTS0ket8kXnn8gx9VJ83fD+b Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="319309731" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="319309731" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 08:19:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="755467618" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="755467618" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by fmsmga002.fm.intel.com with ESMTP; 13 Dec 2022 08:19:09 -0800 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hernan.vargas@intel.com, Vipin.Varghese@amd.com, stable@dpdk.org, Nicolas Chautru Subject: [PATCH v3 2/3] test/bbdev: fix build issue with optional build flag Date: Tue, 13 Dec 2022 08:18:54 -0800 Message-Id: <20221213161855.12970-3-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221213161855.12970-1-nicolas.chautru@intel.com> References: <20221213161855.12970-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 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") Cc: stable@dpdk.org Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin --- 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, From patchwork Tue Dec 13 16:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 120842 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 58B33A0540; Tue, 13 Dec 2022 17:20:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E482742C29; Tue, 13 Dec 2022 17:20:03 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id EE7C140684; Tue, 13 Dec 2022 17:20: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=1670948401; x=1702484401; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1US6UWkPNJwkFbqy+RgtOG2vb05diZx/nfsfRM+OcWM=; b=FIrMHFJ2DpY2sRJ+vFp1idtnHkqUMf6LTcINY2Qe/LUv09VZjIr+XVLR AGC4vg/tqtF1xIH9Vjlgi7Ej8uUwXF1SxX7yoaNk8+VdnphoQ+mW9wPw4 fRY6XfQ0O7EC5ZDgGqT6nK/rwlOnlovKsUh9pNqvy+VSO8RB/56jdLAs+ DEqERI44bA9tzZyzS3RBq5cwQ1V7+IczhU6hOnAM0j6CaSa4Wq3H91TDj 8TsrZy2+bB0ZatCpynt1frnFVBWQIV/9/y/mxAG0u7xEFtimDWIj4bSeZ ZSelwH/P7vUbsGNVY+pTkZui9ZTjmwZFyDvI5fUO23qSYIT9rxVxq+fNu A==; X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="319309743" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="319309743" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2022 08:20:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10560"; a="755467638" X-IronPort-AV: E=Sophos;i="5.96,241,1665471600"; d="scan'208";a="755467638" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by fmsmga002.fm.intel.com with ESMTP; 13 Dec 2022 08:19:10 -0800 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hernan.vargas@intel.com, Vipin.Varghese@amd.com, stable@dpdk.org, Nicolas Chautru Subject: [PATCH v3 3/3] test/bbdev: explicit check for allocation failure Date: Tue, 13 Dec 2022 08:18:55 -0800 Message-Id: <20221213161855.12970-4-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221213161855.12970-1-nicolas.chautru@intel.com> References: <20221213161855.12970-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 Adding check for error on return of the rte_bbdev_*_op_alloc_bulk calls in bbdev-test. Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev") Cc: stable@dpdk.org Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin --- app/test-bbdev/test_bbdev_perf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index b2e536b5e3..a922d69ada 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4958,7 +4958,8 @@ offload_latency_test_fft(struct rte_mempool *mempool, struct test_buffers *bufs, 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); + ret = rte_bbdev_fft_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_fft_op(ops_enq, burst_sz, dequeued, bufs->inputs, @@ -5040,7 +5041,8 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs, if (unlikely(num_to_process - dequeued < burst_sz)) burst_sz = num_to_process - dequeued; - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_dec_op(ops_enq, burst_sz, dequeued, bufs->inputs, @@ -5125,7 +5127,8 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool, if (unlikely(num_to_process - dequeued < burst_sz)) burst_sz = num_to_process - dequeued; - rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz); + TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", ops_enq); if (test_vector.op_type != RTE_BBDEV_OP_NONE) copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued, bufs->inputs,