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 9BDEDA00C2; Fri, 6 Jan 2023 12:48:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40020400EF; Fri, 6 Jan 2023 12:48:31 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id C638E400D4 for ; Fri, 6 Jan 2023 12:48:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673005710; x=1704541710; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=ybl7M+751XYmEIIbJdKuwI5y8V/gh3FxQVcb/2mGbp4=; b=eX9Qr++jq4hxlIj1rOR1VyejcY3O9T12bDTVfSQ4rR4BxfICXJjIjcT4 OzEXkGO3dRKiAVA0XV+APJbclX8aTSJgSljd9w1JS6AyIGjn2xMx9qaZR XQABsWyHVf5L2CAX8NQdpd/KvQt78MO3jHBH/Sdww/fOkDqzDhqezCxjl bJgz4AcZehRF+juDoLR4B7FYE0lMXWuTbhzYmWg9jjQ5dOl1C6vrBuQqz B5+3VdVsZLKe28VnvTmratZU/qULQdbLMth92T0IKdlzKG6hjVBPhvFhA XACT7B401fSgbcnqVajCkbsOAzZ1HInAdVvjzgpzUhpsRJGIdD8+rB8C8 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="323712514" X-IronPort-AV: E=Sophos;i="5.96,305,1665471600"; d="scan'208";a="323712514" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jan 2023 03:48:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10581"; a="686450379" X-IronPort-AV: E=Sophos;i="5.96,305,1665471600"; d="scan'208";a="686450379" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP; 06 Jan 2023 03:48:28 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 03:48:27 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 6 Jan 2023 03:48:27 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 6 Jan 2023 03:48:27 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) 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.16; Fri, 6 Jan 2023 03:48:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNDK0piIkuIlIAu5edAy3a9ROwTzlbpmf8F3O/xlKxcNKYEJivnojohlEewp4f5vqNEzgG6SIzZ8jfvtNBjb+mrBI/hqhVXlpt3/hBPiYxcF3Yusc/NePRY0GJMhfeORvpdZtrkJDBeEZS2jC2l/wGvSO7Lt2IGqOff2Ry/lYdeeZmJrLztk2JEaJZfBAvFSvK7ojBR9UYwXjRp9kVb0lMypXljCihJysX7cwug2TQ3nhwfYtJ+M8yi3mwel8EfPlkkOfab1UNxsn9JMtXLNNo3KLSbrcjhLij9yKCJtNC8ci5yrdsZCK7+PbiMgModWFPv8uMNHq15exSlsyCIByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2AOlgpTsvR2IPg0PSgkzvXOVfvvIeIt7GD5rp5UlsC4=; b=UYLzqlPbgINAdx7sKNwL5H2I0Vhhgjt8umP1/VJvcXAkaPkHMwopBrHeOz/dHnuO4TnX02HxcTYJm3Z4vn0LJnWHnzXrVUqFEHjzTl+j1gbMMYpTWk5Qoq1+YAftvpRQgPpD5gYdGORq0vHWyt4K6vqqVAEq8uGRPJ40+/G08fhvzfUmvjJqZqs5eFrOXuMnzCt+2hhRzmxSuWCLfGuGgnu+jLuz7iTaKFX6N46sfFm3KNvas3oaAY5XZVUkIHhACz2Bqu970k4WOxH1ku4ys8U1szWMDcfI1KgSSMI6hjQXtnostbOxRgoTavlfeqQWS0A7WZxXhnsHKcBq6JyJrA== 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 DS0PR11MB7191.namprd11.prod.outlook.com (2603:10b6:8:139::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Fri, 6 Jan 2023 11:48:25 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%7]) with mapi id 15.20.5944.019; Fri, 6 Jan 2023 11:48:25 +0000 Date: Fri, 6 Jan 2023 11:48:17 +0000 From: Bruce Richardson To: Stephen Hemminger CC: Tyler Retzlaff , Thomas Monjalon , Morten =?iso-8859-1?Q?Br=F8rup?= , , Subject: Re: [PATCH v2 1/2] eal: provide leading and trailing zero bit count abstraction Message-ID: References: <1669241687-18810-1-git-send-email-roretzla@linux.microsoft.com> <1669246997-30592-2-git-send-email-roretzla@linux.microsoft.com> <98CBD80474FA8B44BF855DF32C47DC35D87624@smartserver.smartshare.dk> <3710898.kQq0lBPeGt@thomas> <20230105172118.GB9408@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20230105163240.78eefebb@hermes.local> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230105163240.78eefebb@hermes.local> X-ClientProxiedBy: LO4P265CA0217.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::14) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS0PR11MB7191:EE_ X-MS-Office365-Filtering-Correlation-Id: 135ffbeb-4b40-4c34-85ec-08daefdbeb90 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZGHNNB/crNghlTE2lt8xyQJHaXZyuSsnyDKRs/uKeEhqlwRqbiDGrEF/8F0SIJXAyatlj5j0tFpXuff3/hvjVE1f3pgjW4EF2RCacUyAZ4K/QuKiwo/z7BvirRQJa6TAYZe+IanfVDrbaSHU9PUBAw7h0s/tcuZOcc6LgR7Vw1MyOIMQEoYUkSG8Ia5zAKeNGkbhtZenpdPMMyDTiVWO7lLKgbTsvw059zDMJENIb5fdXfr1NBtAgurJwYQDxvLn97YF97P/6lat52BmT9fPZJpTlNjxpsYWFcwsxfDg+7NYZcAUdxtWKxXWhdrXXPp1cgQzoHY0Vf3VTxgvpm4T+QRT4XYZsqW2lYBeBEAE60SxF9lggDXDJzfwiC55cMfIL3xifMMbmYj0g6nEDug+Ux+TNuHyGBwJ9ib7Omi4s7v81ZGPmTyGlLAWTkSJyDBNj3dggEHbdf1OsTt2W6EVi5bwI5nldgkXMGiJAbzUv0w67lDXKQso+mNC3yi5UOOfw5deXZeF4ARWSgIX4ujb74ca6ocXEy3qSlFGM+6Sm7zXRr70ZxvIx26KuBGMbPGEUqRHtik6r+1DxVR4x3jg1ogxI25xjwWox0LFvmGOGiWeW2V7W/++q1vOiF/93b3kP1RoRiUQ0XIzMHjpVQFA8WzVH5FunclmapT3ESkJ8LGhnDRH7Lh9tUdH6kLKx3ER 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:(13230022)(396003)(366004)(346002)(39860400002)(136003)(376002)(451199015)(66574015)(83380400001)(86362001)(82960400001)(38100700002)(54906003)(6916009)(2906002)(316002)(8936002)(41300700001)(5660300002)(8676002)(66556008)(66946007)(66476007)(4326008)(6666004)(26005)(186003)(6512007)(6486002)(44832011)(478600001)(6506007)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?hOiBGHKEy3Yj8rVUrcpEp4vct4XY3OCeE5V5s2pBFqW24oZIIbqqQgqLjX?= =?iso-8859-1?Q?h0yFYVJYPn9M1fwzc6rw+blcuLyt0dPfw93bRJN+vPTyf8URnQ+h3wjI2E?= =?iso-8859-1?Q?Pkl116MuFcOPh2xje54X0q0rq1T/dC4/hamBaSLiQlFCmRUnZ+ZXpVOtd6?= =?iso-8859-1?Q?xYzd+SqkU+blbW6aA9W+v0DWpVE7U9AHvcl67d2tOLcIqnmZfFkky+qXDI?= =?iso-8859-1?Q?ES721rXM1tan8LigHEkpiFFBESe3vTE/WfNotZBOjw5diVE1JLFve8+cZb?= =?iso-8859-1?Q?sv5rDjUcZ7AnyRjldTQg2swc1d+QmwiprugHbplJpFNmK0pnTDq8NZpETf?= =?iso-8859-1?Q?6RjcZgs9a8ODJrs8jSxwq1wZH6efnohW8UaOXDJdAoeFWYk377Mm+WM7N+?= =?iso-8859-1?Q?5pJuB1t845qxgDOENOQnqEksBgYlrAYs9ng/f7whH30s+HWtDJqWHEKlte?= =?iso-8859-1?Q?m+euxQACQgIkayTKSZIG+TLRTlYn0MzMbSIurDedyFFXwcxoz3bbbvJ4yh?= =?iso-8859-1?Q?Uc5n6ft9eZdsTbqvE6hkRLnpM7LnxusucTQVz/mTtbweiBM/rf4g9nxoPa?= =?iso-8859-1?Q?vTymYto77vC23Ug9qH+/mR3zv3vwU44VRf6Nh7RtkKz+4MiKcfd0UT9qHQ?= =?iso-8859-1?Q?NSJXjWm1bRNK5AjUwkbuIw4EKbz1FX9SbcE7sNGQN/W/bAm4FKXbMqaYG4?= =?iso-8859-1?Q?2kM8puOxht8nGLcR/O27eyD78BAtFLEOyWgUCkCBSxx5GmiHbhw0DfY6X2?= =?iso-8859-1?Q?29K2y14yI8eMVI1n1cnc1C4jheBCvn25yUDZAfO0oMnmaygBsy/CptUpjK?= =?iso-8859-1?Q?8pp6Qyij1imflFc0I3yAEA0lLXun/u5lmIbMrmUafNvuKnvRKSajhpwKRJ?= =?iso-8859-1?Q?otylV1TDTRzBDUOSGAOUtdUaW1YkkB1Jcic07b95/zCsKuKNyUusf/4NgA?= =?iso-8859-1?Q?5W08LURu9LeDbpspxcq4ZgczJ8tn/B5If3p6/crcQqwn5wOpOieTaCen27?= =?iso-8859-1?Q?vFoEYqGf/XH7T1fwStqDekFnM5D5x50ekInKINDvVdlRRJWe20/osRQ4Nx?= =?iso-8859-1?Q?CTNhPmFnjcizpmdSfBa20srHhNupjVY+abSNHk50nx1MDUV1QCzRFblKUr?= =?iso-8859-1?Q?aOIxPfsjajflhfXt9sDfdryEKI4Wty/MEmLnwfmYpHE0wmjJOvkR6YhSVi?= =?iso-8859-1?Q?+eNbYncaIwFngAHqV+wUhb6crXRdTniKPNhUPlSn8xft5/0xjONfiMGZqp?= =?iso-8859-1?Q?x19keYBMHvfPkEwQn2j3/PqyqzVE+ne5ceW7lkI6EhTIdN50bDPqaNAu1M?= =?iso-8859-1?Q?QpoPyYyLOtGI0JFSUXIKh4y5rr7XFJNJ1WN6agvApkoDh00oDuIX3TkzOY?= =?iso-8859-1?Q?mP1YALWE5d0XrYiSOp4NJcqvuN0qzpVX/8VbbGPMTcoX6ufTEYJye0CKNZ?= =?iso-8859-1?Q?JozG1GtAdq3Cetzo+SfRyxjPEEYMw26fmY1PlsHWPiedic2idQ4BMqwhc4?= =?iso-8859-1?Q?gPg+5o27coORBkzacDmiRh8GiLzvw2GjA7R3IEBMqrpXVVGLZ4YcEDSxSD?= =?iso-8859-1?Q?Vur8z0Hcyc5jRUrrOiLXiO1mUuu5kdmeW1EiPvvlSJILB7rh+ZKqKXiDWu?= =?iso-8859-1?Q?pF5gBVsrr2jDTEU1GCiGDxtWRaUbHeywTm0qwtfVcoxx2gBsdK5f3N0g?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 135ffbeb-4b40-4c34-85ec-08daefdbeb90 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 11:48:25.7215 (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: 1VzZKPb9WSuhxbRh2FB7MkKKNNO+K/HyvtRJPm25D58R0/LD3WhNCwgHpr+xJ9JSgrp7KnM9QMmleHTBNkQRPhPaiQKj0xguFDBPp7EMNQI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7191 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 Thu, Jan 05, 2023 at 04:32:40PM -0800, Stephen Hemminger wrote: > On Thu, 5 Jan 2023 09:21:18 -0800 > Tyler Retzlaff wrote: > > > On Thu, Jan 05, 2023 at 10:01:31AM +0100, Thomas Monjalon wrote: > > > 05/01/2023 08:09, Morten Brørup: > > > > > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > > > > > +/** > > > > > + * @warning > > > > > + * @b EXPERIMENTAL: this API may change, or be removed, without prior > > > > > notice > > > > > + * > > > > > + * Get the count of leading 0-bits in v. > > > > > + * > > > > > + * @param v > > > > > + * The value. > > > > > + * @return > > > > > + * The count of leading zero bits. > > > > > + */ > > > > > +__rte_experimental > > > > > +static inline unsigned int > > > > > +rte_clzl(unsigned long v) > > > > > > > > Don't use l (long) and ll (long long) for names (and types), use explicit bit lengths, 32 and 64. > > > > > > > > E.g.: rte_clz32(uint32_t v) > > > > > > I agree on using numbers. > > > > > > > love the idea, fewer functions too. > > > > though it is a shame we cannot adopt C11 standard because we could just > > do away with the bit suffixes entirely. > > We could but the project needs to support older RHEL releases > which have older tool sets. Though probably this is moot point given > how much meson seems to change. True, though meson tends to be a bit easier to update than GCC on a system - no "pip3 install --upgrade gcc", sadly :-) If we can't go all the way to C11 support, how about at least going to C99 support? As far as I know DPDK has never updated its minimum C-standard version, and it might be a good idea to start the process of doing so, even if it is a baby step. /Bruce