From patchwork Thu Feb 24 15:57:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 108311 X-Patchwork-Delegate: thomas@monjalon.net 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 0C74BA034C; Thu, 24 Feb 2022 16:58:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFFC1426FF; Thu, 24 Feb 2022 16:58:19 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 8DCA1411FE; Thu, 24 Feb 2022 16:58:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645718298; x=1677254298; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WXn3rJtF86hCOGKCsPWFxmKNSRGFD8RrF2zsnYVPwKw=; b=l/zus231yOUeO6LE+YIfyRfRD1WgGUKsCWkJKANqK3U/efTz+t0G2Og5 +LO6OTZE03bye7esIMvOBxxdfcfn6MRnerApwzxIPRNZZOp9L34JQ+B8t Ow4b5K3kh8EksjHDmAUdBXj2IcZtIyGvQmOZ4Ug467FETziH+l16E8SKi +G+kH5x+PxE5K+4ut7rgXYrZMKQvOq4gS0SwQBUrci3yIu0ey7+V3Mn5W x7xByy4iEUxWToU+lnA9pYsN3rvwZi3gIdyJqJlMRVmCkY9i0vVa4ovTX 8QvajjhQqkoE7LilDGjIW70QiTYrVCFtm8mTLMnHvXlSsdk/N4MqNfYe8 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="232241709" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="232241709" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:58:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="533183112" Received: from silpixa00400636.ir.intel.com ([10.237.213.19]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2022 07:58:01 -0800 From: Pablo de Lara To: yipeng1.wang@intel.com, byron.marohn@intel.com Cc: dev@dpdk.org, Pablo de Lara , stable@dpdk.org Subject: [PATCH v2 1/2] test/efd: fix size of constant Date: Thu, 24 Feb 2022 15:57:58 +0000 Message-Id: <20220224155759.819460-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224154801.819320-1-pablo.de.lara.guarch@intel.com> References: <20220224154801.819320-1-pablo.de.lara.guarch@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 Constant value 1 has a size of 32 bits, and shifting it more than 32 bits to the left overflows. 1ULL is needed to be able to get a 64-bit value. Coverity ID: 375846 Fixes: 8751a7e9832b ("efd: allow more CPU sockets in table creation") Cc: pablo.de.lara.guarch@intel.com Cc: stable@dpdk.org Signed-off-by: Pablo de Lara Acked-by: Yipeng Wang --- app/test/test_efd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_efd.c b/app/test/test_efd.c index 7bea674086..fa29e8f97a 100644 --- a/app/test/test_efd.c +++ b/app/test/test_efd.c @@ -107,7 +107,7 @@ static inline uint64_t efd_get_all_sockets_bitmask(void) unsigned int next_lcore = rte_get_main_lcore(); const int val_true = 1, val_false = 0; for (i = 0; i < rte_lcore_count(); i++) { - all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore); + all_cpu_sockets_bitmask |= 1ULL << rte_lcore_to_socket_id(next_lcore); next_lcore = rte_get_next_lcore(next_lcore, val_false, val_true); } From patchwork Thu Feb 24 15:57:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 108312 X-Patchwork-Delegate: thomas@monjalon.net 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 B50F6A034C; Thu, 24 Feb 2022 16:58:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01A5C426ED; Thu, 24 Feb 2022 16:58:22 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id B1F97411FE; Thu, 24 Feb 2022 16:58:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645718300; x=1677254300; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7ZE1elzOJhPZj5cdyrOgKsErHngtM5/M/tUVJx4BjUQ=; b=atQwwk5hY96z2NxqwKX4D2YiuR96fA7kWY9vgYK6Q2+bTR3RMKYhuilf FJmaPYxgGyGtsqutxjDUrRtmXjVq3tG66Cvj4uSw1ucti8pdXV8xwVkqW DBkb36FakbBoPxS7l601NV5cb8h8oxDTIWB6YNu3X8EiKJ2djXvMn9Ecg RZgGBjFqCPdR4mM8Hi+e8aff3rjY+8HdMuZ6LTPWS7gPno28pGPRw5I9T eFb2YF911Ikl3XGrXlSceui4tx4NCMEQdGuK5lBI/JtFInZ0o3BrRblrS 3Hq0b+R6tvVGxJ9Shj953Ln+N6jOOSQDoHQZXWATDJrENhL534FdXD6aj g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="232241722" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="232241722" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:58:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="533183130" Received: from silpixa00400636.ir.intel.com ([10.237.213.19]) by orsmga007.jf.intel.com with ESMTP; 24 Feb 2022 07:58:03 -0800 From: Pablo de Lara To: yipeng1.wang@intel.com, byron.marohn@intel.com Cc: dev@dpdk.org, Pablo de Lara , stable@dpdk.org Subject: [PATCH v2 2/2] efd: fix uninitialized structure Date: Thu, 24 Feb 2022 15:57:59 +0000 Message-Id: <20220224155759.819460-2-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224155759.819460-1-pablo.de.lara.guarch@intel.com> References: <20220224154801.819320-1-pablo.de.lara.guarch@intel.com> <20220224155759.819460-1-pablo.de.lara.guarch@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 Coverity flags that both elements of efd_online_group_entry are used uninitialized. This is OK because this structure is initially used for starting values, so any value is OK. Coverity ID: 375868 Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: pablo.de.lara.guarch@intel.com Cc: stable@dpdk.org Signed-off-by: Pablo de Lara Acked-by: Yipeng Wang --- -v2: Fixed typo in commit message --- lib/efd/rte_efd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index 560cd78961..86910e587c 100644 --- a/lib/efd/rte_efd.c +++ b/lib/efd/rte_efd.c @@ -1162,7 +1162,7 @@ rte_efd_update(struct rte_efd_table * const table, const unsigned int socket_id, { uint32_t chunk_id = 0, group_id = 0, bin_id = 0; uint8_t new_bin_choice = 0; - struct efd_online_group_entry entry; + struct efd_online_group_entry entry = {0}; int status = efd_compute_update(table, socket_id, key, value, &chunk_id, &group_id, &bin_id,