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 7769D460ED; Wed, 22 Jan 2025 17:13:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13DA4402D5; Wed, 22 Jan 2025 17:13:00 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) by mails.dpdk.org (Postfix) with ESMTP id AD5D4402BC for ; Wed, 22 Jan 2025 17:12:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737562379; x=1769098379; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=/7a2aC3lbyYVjDwR8cYvN9Qx78jZZ6WWvFQxZONISEA=; b=Ll9stKwYn6BNHiUx1NwgntcntCx+Vc8HO0jh07wl/NUaZhALPU0L+oZt CluC8Iexi1IZyvGrZ/AztMssFIYQKIuiK03IrcXPnVmJzJgHsfwX4N1jh Fv9+jQGOCes1lS2AM3jUAUAxyYWX9Ao5nHEbhvEV9UE4IbWT7WuydZ/Od 1iQTH9O/Fy0xUiUPS+TsIGGtgm3aGp8aRULxqo672h4ILesgBlR20DyeN 0ntz6Y9PJGN9DtA1/SyYceTQyCLFFUePHl9kd7pdP5ro1MGyJSZo1+fR0 b8trBzZZSlJjy9gQXorU4mKP7/qWhZTBbn0rv0D0TwMRA0H0eeelqSCCb Q==; X-CSE-ConnectionGUID: LrF0wloATL68vsGuC12Pbg== X-CSE-MsgGUID: I7GSlDOWS3CdQC6DTIAUkA== X-IronPort-AV: E=McAfee;i="6700,10204,11323"; a="37726536" X-IronPort-AV: E=Sophos;i="6.13,225,1732608000"; d="scan'208";a="37726536" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2025 08:12:58 -0800 X-CSE-ConnectionGUID: sN62wt4GRHKIjud8AXVnjA== X-CSE-MsgGUID: RSQDIKfGRhaXGxlwGjk9gQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,225,1732608000"; d="scan'208";a="107787075" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 22 Jan 2025 08:12:57 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Wed, 22 Jan 2025 08:12:56 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Wed, 22 Jan 2025 08:12:56 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Wed, 22 Jan 2025 08:12:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PHU9X4jkfTmkRE00gQ4y+GcoKU4zv016M4OKL4IhQO5FBdJq+0qr9uWShNNfRDQ5v9PLlI8DI5CQRh43Hk6VdhQq/4qJS4f27HdYaHBU3VS+6vnBCdSpxzN1Of1ynTL40CO1UJICvNLh9DLU718sNApnlCiLMUo6AQCS2tiswJ8cOhgjxc65BC7onqu3eg0ElIqKTIAP+EM0EHARrGwJN8wqzmyVCissWVt7cn3EHwFQdWFVqut3QGnjoRjFigiO1uxzdymcYM3FEaoNBzyd9C1R/3krCiFE+8YyZmsWbH1mWtiRrMY/hbvnyrMrI2L4+V9XtU8FiCfIkizrM64vBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y6xf3q9bSQ3XDqVbhT/ca2dz7TatvOE0LMeIj3soYEw=; b=LQWOJOHRH7n488w/CK3vch5I0K16fU01u4rzRrW8yGWbZmw1MZQ5SbjQ25NHwqSmrTp7CCAkEaW34B1SjMht+ajFOIShS7p2Y/uC9TlKkVbY4NDfv8NDh5qCOHMR+NPGrOpNSqFMO4mQj7mJkKzAaRd3aPxzCUabDpQL2ZLcoJ6Q8yiNn53nyF3hZ7s2rGReLHo4xrWZcCfw8xPi3di3EOhkGmJH8rH2Aroaa+LDzY1QEL0TZNT4ujp/h6ity0RLNd64vMguTxon/JQEAVh5CG38b/wtlMoanw5NP+jorJEs+v8mjGxJ0mVkjBixBpUOz7UhX1hoVbv3BszsSIvZ2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DM4PR11MB5311.namprd11.prod.outlook.com (2603:10b6:5:392::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.22; Wed, 22 Jan 2025 16:12:54 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%5]) with mapi id 15.20.8377.009; Wed, 22 Jan 2025 16:12:54 +0000 Date: Wed, 22 Jan 2025 16:12:49 +0000 From: Bruce Richardson To: Andre Muezerie CC: Yipeng Wang , Sameh Gobriel , Vladimir Medvedkin , Subject: Re: [PATCH 2/2] lib/hash: avoid implicit conversion to 64 bit number Message-ID: References: <1732758837-6350-1-git-send-email-andremue@linux.microsoft.com> <1732758837-6350-2-git-send-email-andremue@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1732758837-6350-2-git-send-email-andremue@linux.microsoft.com> X-ClientProxiedBy: DUZPR01CA0002.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::8) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM4PR11MB5311:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a905480-351a-4e88-208c-08dd3affa0b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?M53lPRCY6NifRasp5Bif87VUa8dpPX5FEkwze+kYKt7e/XHur4bITRz7PZcD?= =?us-ascii?Q?ntDPKiz5JmgBpUxgezChmA89qQta8Yy/c/DNabS1GIGVvk6eBzW+GYlUdSJu?= =?us-ascii?Q?xBIIRRhR2LVfb0/Oni68CGZ3uPYCwd9gEzIElZaNZDrOK9PygAhQrKOFsrQN?= =?us-ascii?Q?2+zpRrjU6QZREoQNhdXJ6Irz4HU0WE2ISqqYelGWZA4lXZJZCPZfS11yoCHP?= =?us-ascii?Q?vWCZlvGaK2MJ+Lpm/ElferZ9MqW0D4RrIlApaY0DcrfiwL0SL7XDMhWvh12v?= =?us-ascii?Q?zxy5QfuctwkaB9JQNuXQ8onz6KCvXVyqP2uqsPDDqDRrvu/S6Epu0ZgsC39Q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1QNJc8/kqGO1cxNTXCJWNtXd0r1?= =?us-ascii?Q?m3tkDEmEsmrtlgBivenei0FdhtGHp3UtSzxKVyh7dIU17Zxv92xbdxQILky0?= =?us-ascii?Q?G3NBkRC2dSOZpE9vUsPGnm7RKrP/f5hjdNuCGd/3R4loyOvoCNxXTLdIHYKz?= =?us-ascii?Q?ZHXQ9M9tZtbUst6C87D4lc0wSpmZ?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Hg2n/eO3DYw9i2OrL6niSJWhAHommr39hDJpYKebQeJi2yfKq9+VL2e2QL+O?= =?us-ascii?Q?qJBtOfCSLWQQ/grBhUrsnzNtVnSlJfE1bi62C0FhqawdTcKDm/gd4onAEHqR?= =?us-ascii?Q?wwOJXgPSNKEtenc8e2mMaP+xC47HyQ9y8SVnUXCVZYiyjkBDW+CMsJO4UmOp?= =?us-ascii?Q?UcdNoIvA0FiURsbwJZP+W9CD8YbfT9NDeB/UV3Dyp0ZR+eAPaXsIA+bmVDg/?= =?us-ascii?Q?x7R3Vt8ujIZLf02jtOwMVDsEmb3EGeM4kom/Hg2U1/yxAchbRYxWRR/Hg9uu?= =?us-ascii?Q?DxuMXr1DGoEyHWCGvzmNN14yOLh6zTxZhkt3kQ5u5dJz41F+jXf2pPm99R3C?= =?us-ascii?Q?3EfU2/lGPvXockuTn1ObeWTzEYIzsW68hYycnaxs8Q1gHBWImrmIEQvStGxi?= =?us-ascii?Q?Jcp93iMofJF9f2KHGGp8/kPVGeJ8+uvMzzrkz4BuZZ5oSZTU1Sf+W7SQUZVo?= =?us-ascii?Q?NIusO32khB0VqR01iI1sDKENj0jHp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= =?us-ascii?Q?p+ZUldWFAKlg6OePJFzmUTWqUt0EhBfcwrxzxpFVW36V0YJTVJl3zCsIpMmP?= =?us-ascii?Q?/LuOkaBiGhNHxGpi1owuoPoAMidrySCHSVPyxtD9uY5qy3Qtfc0tTK96YTEB?= =?us-ascii?Q?r1udOSz8/yNDbSPttLHYlarMNq8B5hWMKzYhgknhFumfsRSJ/trKuyilMY9F?= =?us-ascii?Q?1emrnFhoLFcRUjuQpp1Kwsllz8hZci+jYhojm0ciHw3sW3sA405j9Fe0SU+W?= =?us-ascii?Q?2g=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1a905480-351a-4e88-208c-08dd3affa0b2 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2025 16:12:54.5088 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MAe2oeB3e+or73Mb7O0ls+kwq8oDLzTN3DTs8padN/mQdTq4DNEiAxjO4R9sy/cfEi9O6+SdUcsgrg1wmKh7eKDJi1o8FNU72b/xP7qz32w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5311 X-OriginatorOrg: intel.com 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 On Wed, Nov 27, 2024 at 05:53:57PM -0800, Andre Muezerie wrote: > MSVC issues the warnings below: > > 1) ../lib/hash/rte_thash_gf2_poly_math.c(128): warning C4334: '<<': > result of 32-bit shift implicitly converted to 64 bits > (was 64-bit shift intended?) > > The code would be better off by using 64 bit numbers to begin with. > That eliminates the need for a conversion to 64 bits later. > > 2) ../lib/hash/rte_thash.c(568): warning C4334: '<<': > result of 32-bit shift implicitly converted to 64 bits > (was 64-bit shift intended?) > > 1ULL should be used as the result of the bit shift gets multiplied > by sizeof(uint32_t). > > Signed-off-by: Andre Muezerie > --- Acked-by: Bruce Richardson > lib/hash/rte_thash.c | 2 +- > lib/hash/rte_thash_gf2_poly_math.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c > index fa78787143..f076311b57 100644 > --- a/lib/hash/rte_thash.c > +++ b/lib/hash/rte_thash.c > @@ -565,7 +565,7 @@ rte_thash_add_helper(struct rte_thash_ctx *ctx, const char *name, uint32_t len, > offset; > > ent = rte_zmalloc(NULL, sizeof(struct rte_thash_subtuple_helper) + > - sizeof(uint32_t) * (1 << ctx->reta_sz_log), > + sizeof(uint32_t) * (1ULL << ctx->reta_sz_log), > RTE_CACHE_LINE_SIZE); Is there a reason not to use RTE_BIT64 here too?