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 6F833A0547; Mon, 19 Jul 2021 19:15:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3422740E28; Mon, 19 Jul 2021 19:15:37 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3E69D4068B for ; Mon, 19 Jul 2021 19:15:35 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 89FB520B7178; Mon, 19 Jul 2021 10:15:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 89FB520B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1626714934; bh=0X+06345AGpIxMvujh5ZxDMwnjOFeemNP5J3dhBOlmM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TKGKq3R9XV075ItQqWIIECQ8uVg+m9mqUHe2YlyzkymsJbV39Uw5Ge/+mC70kEELk JT77Xc0737XJQc5osDgCmcZuLTZ6J5VQ/QhrbQngFnaQNtVH0SBMWYArcbQ7xt1RWo 5te5VFPxc0ycZ1tEMnpLMR6mugw++iDeeQlyFllk= Date: Mon, 19 Jul 2021 10:15:34 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, anatoly.burakov@intel.com Message-ID: <20210719171534.GC7679@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20210713201221.301248-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210713201221.301248-1-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH] eal: fix argument to rte_bsf32_safe 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 Sender: "dev" On Tue, Jul 13, 2021 at 01:12:21PM -0700, Stephen Hemminger wrote: > The first argument to rte_bsf32_safe was incorrectly declared as > a 64 bit value. This function only correctly handles on 32 bit values > and the underlying function rte_bsf32 only accepts 32 bit values. > This was introduced when the safe version was added and probably cause > by copy/paste from the 64 bit version. there are multiple errors in this family of functions [1] both in usage and signatures. we previously discussed rolling all fixes up into a single patch and announcing an api break. a doc patch was submitted as per the process documented for breaking api but received no replies [2] i have a full patch that corrects the whole family if you would like to take it instead. contact me offline if you are interested. 1. http://mails.dpdk.org/archives/dev/2021-March/201590.html 2. http://mails.dpdk.org/archives/dev/2021-March/201868.html the change stand-alone is correct so Acked-By: Tyler Retzlaff > > The bug passed silently under the radar until some other code was > built with -Wall and -Wextra in C++ and C++ complains about the > missing cast. > > Yes, this is a API signature change, but the original code was wrong. > It is an inline so not an ABI change. > > Fixes: 4e261f551986 ("eal: add 64-bit bsf and 32-bit safe bsf functions") > Cc: anatoly.burakov@intel.com > Signed-off-by: Stephen Hemminger > --- > lib/eal/include/rte_common.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h > index d5a32c66a5fe..99eb5f1820ae 100644 > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -623,7 +623,7 @@ rte_bsf32(uint32_t v) > * Returns 0 if ``v`` was 0, otherwise returns 1. > */ > static inline int > -rte_bsf32_safe(uint64_t v, uint32_t *pos) > +rte_bsf32_safe(uint32_t v, uint32_t *pos) > { > if (v == 0) > return 0; > -- > 2.30.2