From patchwork Thu Feb 24 15:48:00 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: 108299 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 A751DA034E; Thu, 24 Feb 2022 16:48:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4518741156; Thu, 24 Feb 2022 16:48:12 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 0357E40040; Thu, 24 Feb 2022 16:48:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645717691; x=1677253691; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WXn3rJtF86hCOGKCsPWFxmKNSRGFD8RrF2zsnYVPwKw=; b=euSzPd8J/WjoA3SiALqFJN/bcIvQMCjCQ+imV0d/hZrBht5/H0LG4S/Q ieqmBkqsW0+SW3poMPr+Mx80o6JsCzMzIsealUG0ZNZ6+YGXyeOwsyInT Tz3mfpACMFwaQXMBAsaHIBLGlI+WwGq+VRQEQU4lQY8v+J8Olc4+U7Ze/ cjn5U8KdVc8cknmiqxjPcuOZY7q5SVGWUR6GFCvCoDiX3l8J6vTPNID7X mCJPVY4TVR7a61+SZStoKRnlhszbBGtcpFoNkuIQ+7Lw3+N//eRDzgxgo dedUe6e8QCz2rkzZ7dxtdMQ2TdaTZ5DDX6hbpyoRaC+XcbXvCqeQAO9gd w==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="315485317" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="315485317" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:48:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="508912363" Received: from silpixa00400636.ir.intel.com ([10.237.213.19]) by orsmga006.jf.intel.com with ESMTP; 24 Feb 2022 07:48: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 1/2] test/efd: fix size of constant Date: Thu, 24 Feb 2022 15:48:00 +0000 Message-Id: <20220224154801.819320-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.25.1 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 --- 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:48:01 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: 108300 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 00B9CA034E; Thu, 24 Feb 2022 16:48:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 363F6426ED; Thu, 24 Feb 2022 16:48:15 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id ECE3E40040; Thu, 24 Feb 2022 16:48:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645717692; x=1677253692; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Fi7OhuIMC/aHPvJoAf0SNUkCSn4w9IGQ/mXkT3BylOM=; b=DVDmVziTOsdXpK5Svy0XOwMR0Eh21CVZ7ipyK6wQ9mwmVpVQa8DbFzxc YQx8BCQh8H/5NhUjnsdqoLfVvsHHoDikTQJxJiLSoR+SFSiXxtrPlFkO3 kio7+7Nvi5v7o9kQLNEBwHP7lwfOCv/VJ32YL9IC5BTeGwZCrm74a6g9B XhhGUpgDu4Hr8vBCbX6/jGidJAdiJZCyktwsb0yKnA0vs8zNoGvx5nH4x OLlZGanw8woihhLyGvyuimucdy5ODcwyY2elxdw7c6mUrCMmrWvUbW1kc iushNuZ+nLSWinO5Fi/XYWPIF+JZzD3ft7UPd43zISXeKVW54fUjgTHhr A==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="315485325" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="315485325" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 07:48:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="508912392" Received: from silpixa00400636.ir.intel.com ([10.237.213.19]) by orsmga006.jf.intel.com with ESMTP; 24 Feb 2022 07:48:10 -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 2/2] efd: fix uninitialized structure Date: Thu, 24 Feb 2022 15:48:01 +0000 Message-Id: <20220224154801.819320-2-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 Coverity flags that both elements of efd_online_group_entry are used unititialized. 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 --- 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,