From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A5B60A034D
	for <public@inbox.dpdk.org>; Fri, 25 Feb 2022 10:27:56 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 98AC041174;
	Fri, 25 Feb 2022 10:27:56 +0100 (CET)
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by mails.dpdk.org (Postfix) with ESMTP id 951A54068B;
 Fri, 25 Feb 2022 10:27:52 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1645781273; x=1677317273;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=XTmQg5OORG+4TK8p37aK2GkNS+c0AihTYsarqTaknG8=;
 b=DKuortQAoeR445u2p97MX5XajxYT+Vy+MmgG4op1lkqy2BT4a9/IZKeJ
 HbgeKdLYJbMrlHkRHf3e+nehGBIgjYhv+jnqW6gPq7Zyj/PQ0RQ5J9EtX
 +MZpWvnsTUrbSvZOZDn1ey1dS7nC5x8YKmXibcFZdnL0sI1Wzn5lCRgVU
 Qge5n7eKNPdo6Dvm8gTUDQ59UZ4cNkiV1yvEYJBsJdxYfcVw5VfOnpSbx
 2dD7HCMXqvDGRnarCd/J6KUtMB2N9ejTWoyWLBGp9b5WTaOSUM+iOFDsC
 0o7+x0NBPV+zmOuSTloPIeasZVn7yBLAImLiy2TdTKCYg/YAthe44sbZv g==;
X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="252383110"
X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="252383110"
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 25 Feb 2022 01:27:49 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.90,136,1643702400"; d="scan'208";a="638182376"
Received: from silpixa00400636.ir.intel.com ([10.237.213.19])
 by fmsmga002.fm.intel.com with ESMTP; 25 Feb 2022 01:27:47 -0800
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: yipeng1.wang@intel.com,
	byron.marohn@intel.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>,
 stable@dpdk.org
Subject: [PATCH v3 1/2] test/efd: fix size of constant
Date: Fri, 25 Feb 2022 09:27:44 +0000
Message-Id: <20220225092745.883850-1-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: <20220224155759.819460-1-pablo.de.lara.guarch@intel.com>
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 <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-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 <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 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);
 	}
 
-- 
2.25.1