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,