From patchwork Thu Nov 10 15:13:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Medvedkin X-Patchwork-Id: 119729 X-Patchwork-Delegate: david.marchand@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 7039FA0542; Thu, 10 Nov 2022 16:13:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6490042D0D; Thu, 10 Nov 2022 16:13:40 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 0C46F40A7D; Thu, 10 Nov 2022 16:13:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668093219; x=1699629219; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Err3R2AS3Ks5+SsdvGb5c+FxGu8G+H80kbmywoW6b14=; b=Y3WKxOM1DWwRa5OwMu2GS5h3Wa1zas+aumisrC0kjV2wsOlYDQaewrbF N2M4qwwstPe/ft5jVePJqErRbFOfSgCmoPZf7bTeqNGSwaZ4RevboGXhm hR4wv27iIFuLFdZOnmzfoEkhw2Ge8eLKmv12w5iW5Kh+bONmAIBPUJTGu 5drDfAAYQdl4xG5IXN45AgePbMF+UQNjItcMaTmOgn1N0LujSeLzaAkek 4pulZNP2XMCiL106LSWtV10gTlycGgAYgdtehNO8mSyYWTuBv4fJPFOiF Bj3cDS4+L+zmYGiuCOX5lWkVQAwHoycRnlreEvefMdDzJhshdiDCJ8INA A==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="310045311" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="310045311" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 07:13:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="637200150" X-IronPort-AV: E=Sophos;i="5.96,154,1665471600"; d="scan'208";a="637200150" Received: from silpixa00401176.ir.intel.com (HELO silpixa00401176.ger.corp.intel.com) ([10.237.222.174]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2022 07:13:36 -0800 From: Vladimir Medvedkin To: dev@dpdk.org Cc: stephen@networkplumber.org, stable@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson Subject: [PATCH v3 2/2] test/hash: fix coverity warning Date: Thu, 10 Nov 2022 15:13:34 +0000 Message-Id: <20221110151334.1448727-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103181240.1135012-1-vladimir.medvedkin@intel.com> References: <20221103181240.1135012-1-vladimir.medvedkin@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 Check return value after bulk lookup Coverity issue: 357746 Fixes: 14b8ab576235 ("hash: add bulk lookup with signatures array") Cc: stable@dpdk.org Signed-off-by: Vladimir Medvedkin Acked-by: Bruce Richardson --- app/test/test_hash_perf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index 5d36c0f454..1a90acd1ba 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -475,6 +475,10 @@ timed_lookups_multi(unsigned int with_hash, unsigned int with_data, (const void **)keys_burst, &signatures[j * BURST_SIZE], BURST_SIZE, positions_burst); + if (ret != 0) { + printf("rte_hash_lookup_with_hash_bulk failed with %d\n", ret); + return -1; + } for (k = 0; k < BURST_SIZE; k++) { if (positions_burst[k] != positions[j * @@ -487,10 +491,14 @@ timed_lookups_multi(unsigned int with_hash, unsigned int with_data, } } } else { - rte_hash_lookup_bulk(h[table_index], + ret = rte_hash_lookup_bulk(h[table_index], (const void **) keys_burst, BURST_SIZE, positions_burst); + if (ret != 0) { + printf("rte_hash_lookup_bulk failed with %d\n", ret); + return -1; + } for (k = 0; k < BURST_SIZE; k++) { if (positions_burst[k] != positions[j * BURST_SIZE + k]) { printf("Key looked up in %d, should be in %d\n",