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 B9E634237B; Mon, 9 Jan 2023 09:50:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 751CD40687; Mon, 9 Jan 2023 09:50:23 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id D81864067C for ; Mon, 9 Jan 2023 09:50:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673254222; x=1704790222; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=OWfH3e5AeYJlvhRk20O2ZhccgF0qoR/Bx9mdVpk14WM=; b=eocEOmzq7rMCuFq75v1vT3Zr0HeUn3nP/SI3iJozmpCmDnQe2ySDO5ki j3CDb7Q4m4oU0olqujf0gfbqnpaLDUZdWnkHm/PVvhSgBWW4ZecGus6s8 ExoGQsyrMk5cM4Z0J3HzWOvA23mKS6wxUWPIuxfs3LVLZl1qgIezTJS9Z RFF2EEFY8XcBOR64o3TfG/k69ABZgZ2MnjLmQeGsF+EeI69KTOHMM0oVa KPcAqyyF+ozdLUmbrP+Q5b38PJRaEMBW9kIfzAycn4jLUj4g/QTLBUcfT S92m67BUakz2RIwziQJSC40LUr/LgKtEJeKpr/n9UcSsUl9ol2FIoHnNc A==; X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="321528899" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="321528899" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 00:50:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="901932386" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="901932386" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 09 Jan 2023 00:50:20 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 9 Jan 2023 00:50:20 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 9 Jan 2023 00:50:20 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 9 Jan 2023 00:50:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzzNYAYttGB9m0A5t3ZL8jT0l9DVcJiQtam5DoPO03mMk9z1bg98EEqVYgNH/z2H0vgywEsdYpvT6+2kYFOwelrVv2Muosc80QadXWs/sR/B/UugT6zBfn4oBsLlXeVOH6gvQMwl/QUu5YnDvmoMIDbZCABYoBRFG3yl1cn0FkxmQ47G39VwqrlRk5r7w1NgPUv+6mXZkZElY3Y9vmjAxyLXUv9M5WZCKwL6dLlovmhI1uGiuHU+MdW+NWPrGNTgKxhH2Jx2w4UIUAtJUE7JHFm3zgvJ9jnRwVqiqnYns9M4mbE4T2sE832PWQwYLzz8OyRlmAESJfu1eaqmDt/Y+Q== 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=yUwrKkIC5UvvKDSsgIY5Bpnr6YpC8ss+eTaU2hnaHF4=; b=TyJhXHTyDWGge0fo5fAbf1vK4PjtPS59ToVBrCFrVuLmIIpw/hGv6DjgCUtd6hg9v6IuwuzNbVMPlbnzL0fgM9jgKxnJ0bUhivmXy7twDTg8PbK7NZ4Ut1jG0RYI4pHno33gM1ejnTTnhTvz1pK+Gb37OB4xm48mjR7ZFyqRg6Vjj4iW32rdYknMTySg7e1D7AM2obvzU4dYb05l1Anh100pOVZ5dINxaHo3PRlnkvnFV2Y+BKTxryqV161a4Sv9qFHItFdiXsd+E8v8QIUcOQsiLhuH0Xxkswu3mBWr5migMqcdjIWhk864Dxvx0yOo3snDnuG9/9VLFA2TyuJgbQ== 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 SJ1PR11MB6106.namprd11.prod.outlook.com (2603:10b6:a03:48b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Mon, 9 Jan 2023 08:50:17 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%8]) with mapi id 15.20.5986.018; Mon, 9 Jan 2023 08:50:17 +0000 Date: Mon, 9 Jan 2023 08:50:11 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: Stephen Hemminger , 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> <20230106184706.GA20685@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230106184706.GA20685@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: LO4P123CA0498.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ1PR11MB6106:EE_ X-MS-Office365-Filtering-Correlation-Id: 92f9c0b5-5107-41ca-f17e-08daf21e8824 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: caGyWQ0jc1pJGXhbjjsqPOMwUMISTKgkEy0KYgbSgNm72WO7WM6xinodtupmzO5Ws7m1O0n8i4KlbtaVKyAx1BlT8BxvwSmVIn/+Ji8hPqAWAKorErw0KkAbfV0JFOtQu86BUJUGE6DwL0VOekdgjk9yf/AN2/V60AL9uiqWV86t59atIYsvNWjOTFiI4QGIRYN2hj++W8Krnwsz6iryFPOwZzM7lZQnsxX8TjeXIVL5Eytvo+mG7Eia1ysZw0HI3TlHL9GJ1EPVISnwsnF/1JymSIrEbotXNkEgBTP487Pk/B0Mdki3S9hJjwbqI8tVin+Snp4oSusnQrTgLORzaMWTZAeGmOHG0n9Rwexdc8oMwt3/N4v7fxQIf4Jip7DdQNxkZAna5RXTOFLkl0jZvAReo2v8o4+qZW/PrFMz5TetLh7Sbqjm9UoFQXhr+0Ev42tTxJ3MneWFl6qU/hWyUBm3QbHG+dGrN7h656/5V3+dWwV2BbXO/SegnqO7lrrWzd9KM6tUm4pUTCqnsZux3Mp9ZMjxB0QhB54XzYOzm/mFWY8nMfzvneAb2DTyDVim2cghjTPRes7GA8IyqgN5KFb7JbuTH9i4m7GgPqsvHo+BPJrpzUzsOFj+UMGEPITHTPCyFBdsGJZyK12vrMabWQ== 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)(39860400002)(346002)(366004)(376002)(396003)(136003)(451199015)(66574015)(83380400001)(82960400001)(86362001)(2906002)(44832011)(41300700001)(8936002)(5660300002)(38100700002)(186003)(6666004)(6506007)(478600001)(6512007)(26005)(6486002)(8676002)(6916009)(66476007)(4326008)(316002)(66946007)(54906003)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?ZHsh1tMpSoup9ZI9zZMV4IfjCcA3KxrJOT8fDcFG5usaAUOkYSZJGhfU6K?= =?iso-8859-1?Q?7SisOIEWQIoxjoHwJBzuQyqYML77MuhgMi0lw6mtWQn3uy+feOkh6atwV2?= =?iso-8859-1?Q?0n41rpvNIq/dbR1MEBmYvDq4kJjvb5xyBND5GX9RCJ3ZzW66xX00lN4QKp?= =?iso-8859-1?Q?dv7tsis/CGOFf8YnomrK2G4QLiYKqT+bk/P0+y25mFA5jHSpNbYmKUfZBh?= =?iso-8859-1?Q?CGGavFrL9Uj8SCKw7AJ9UUzv5fwNb8exOXroVMtCEBL6kkD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QTn0/x+31NNdqa/ZuLT51oNypuXpzOBdI6Z3tA4vtTtp5NGfcuZ?= =?iso-8859-1?Q?saFbeOd3XxahCzUovBQxy24Ap16PJ/SdR8Qp2lrojLIFBoKxw0zphY3RXD?= =?iso-8859-1?Q?ZhSpt6Ambm2stf/RVEiFSsoRLedHDZCtbVA/6Iixzopm3kUl7cISueXDL9?= =?iso-8859-1?Q?gjd62yUqZP9OKPdGe+cVVLgGc2rie7uD44iw8nTJYZjV55Ux5av24qwmJY?= =?iso-8859-1?Q?V+8O4t9Ga1OwByF3UJyf0ke6M7rOqS6z1Mqgyw0s+m4O7InxrAnrn8zHpX?= =?iso-8859-1?Q?Bs/U7TG1sAoHx5siyLahrlEzDFPeOIQXa9dDUiavpXgQXin+vP5rRvyZez?= =?iso-8859-1?Q?OzosehVW++qBHDO3o74ycbQ7ejup2ep5TfgrLbOL7v4PNxKgmBK3LXhUbh?= =?iso-8859-1?Q?5QVgFgXMz4qOUoJ4kW2ffwtluyfflThwBxwbx9Ru98+2YDp1m/w2YfO8Eh?= =?iso-8859-1?Q?ylwf0xrE9wGVN0HmITBi6a77etKcmoS2bmtfIl5sbh31t90FfxoP30og?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 92f9c0b5-5107-41ca-f17e-08daf21e8824 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2023 08:50:17.6222 (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: 1Ru9iJc0zqFv2LjNXVtQy4JcPXFdoc4e6rEHozwOy+wyXqA+bxjJ0SHPwISa9vv1vMfz8dn7m+cSJ7Vk5P5f8oB+i2xVTtfuaQTcZ9b0II0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6106 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 Fri, Jan 06, 2023 at 10:47:06AM -0800, Tyler Retzlaff wrote: > On Fri, Jan 06, 2023 at 11:48:17AM +0000, Bruce Richardson wrote: > > 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 :-) > > * on linux. :) > > > > > 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. > > the thing that blurs the line a bit is how the gcc version that is > holding us back does actually allow the use of some C99 optional > features. for example we use the C99 fixed width integer types so > technically some of the code already requires C99. > > i also notice at least one driver is explicitly specifying -std=gnu99 so > maybe that driver just isn't being built when the old gcc is detected? > > anyway, i think we are stuck pre-c99 so long as we have RHEL 7 to > contend with. the rationale is if we could use a compiler conforming to > the new standard we could just directly use those features, but so long > as we have to support non conforming compiler at a particular level we > have to introduce an abstraction and that is where all the extra work > comes from. > AFAIK the gcc 4.8 compiler on RHEL 7/Centos 7 does support C99, it's just missing full support for C11 (which comes in 4.9). Therefore I see using C99 as hopefully being unproblematic, and allowing us to try moving forward revision and seeing what issues - if any - we hit. It should also allow us to put in place infrastructure to support such version changes, since, for example, we likely need to ensure that our headers still work with C90 compilation. /Bruce