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 4CC0CA00C4 for ; Thu, 3 Nov 2022 19:14:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 462F742D14; Thu, 3 Nov 2022 19:14:05 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D461F41181; Thu, 3 Nov 2022 19:14: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=1667499243; x=1699035243; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7/dthZVLrWHrGfdQdmBOROMhmtnVvxIg+vSxI1rSSek=; b=j1iRO/OBah4Xq4T352nNgBzw8Z9zw6VjplnuNHXaUWOx4PKeWuNR82hP DAbPhb0IKTQzOzKp8lqZ9dQGr+zTH6VSWrFmzfqzydVKBXFvxqDMtE0SE njkfKnlCjTGFbH0SQdOgMVrbD7/JBAhTaG5fyEj65fVTWt/i3WGNITkIw hdEmlW0d/TdjRB0zHITQS8ekhMBYrRs3Do4XWAdB36ZnIV/vks44QHQ74 hIO9vHNnLq59GyKByC7PlvfIZYRnZg/pqNzxatl1rSwjk/k/wvdua7aew +vm8c1qlnD+5SwEG+KgQaGI51YMEKtiUZaNwMXzHPXAvkTH7OsbyBO2um Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="310882592" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="310882592" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 11:13:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="740295024" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="740295024" 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:13:44 -0700 From: Vladimir Medvedkin To: dev@dpdk.org Cc: stable@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson Subject: [PATCH 2/2] test/hash: fix coverity warning Date: Thu, 3 Nov 2022 18:13:38 +0000 Message-Id: <20221103181339.1135127-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index 5d36c0f454..a9655e69f7 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -475,6 +475,11 @@ 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 +492,15 @@ 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