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 ADF76A00C2; Thu, 3 Nov 2022 19:53:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BE4D42D13; Thu, 3 Nov 2022 19:53:04 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id D11574014F; Thu, 3 Nov 2022 19:53:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667501583; x=1699037583; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Err3R2AS3Ks5+SsdvGb5c+FxGu8G+H80kbmywoW6b14=; b=m+GzNOWB92Xc1DS4We63P4WWoUnzfe/2viRgpodHqFZz86s9Zz2fDyf3 OGnp1ZTqOYDXTa7i8kLV/xxKcw6P6OZz3UdR/EEJIaB5CPlkdoy0vVWdq fBR1XQw/zyyXfRhYIrnnDwYhjbQTJkt7rTwj8w/JaISnhm1ns9du2dsMD zT64HCRx9A1DJj8lOflgOIkb46yvb/pOhCuh79AgrsTG5vjKn36bbYCvq lUHI1M/19xtjHfRm4Ii5z0oeziNficAJXTg2LYOSwOO0wbcjYQqysLKPS Hi1wbGDXaFUvYoGO1jdvBcSUrUPJKzXlT3yMVA0oS/TEMkS66CG2ImVh0 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="311508945" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="311508945" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 11:53:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="740309834" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="740309834" Received: from silpixa00401176.ir.intel.com (HELO silpixa00401176.ger.corp.intel.com) ([10.237.222.174]) by fmsmga002.fm.intel.com with ESMTP; 03 Nov 2022 11:53:00 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: stephen@networkplumber.org, stable@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson Subject: [PATCH v2] test/hash: fix coverity warning Date: Thu, 3 Nov 2022 18:52:56 +0000 Message-Id: <20221103185256.1136521-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103181339.1135127-1-vladimir.medvedkin@intel.com> References: <20221103181339.1135127-1-vladimir.medvedkin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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", -- 2.25.1