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 595F2A0C4F; Fri, 23 Jul 2021 02:52:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C58840040; Fri, 23 Jul 2021 02:52:24 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 1ABD94003C for ; Fri, 23 Jul 2021 02:52:23 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id i1so1275436plr.9 for ; Thu, 22 Jul 2021 17:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NwrOyRory1XmZdig+/oN5fJYy0rvivhWTpDQ8bXp8Is=; b=ywofi5ovYksaNpaBoahNicDWrGXMkGHOwSfzl+ebyuWcw3yXRT7IOZuf+YMH3w/NRG 6CEmCjnV5Sz9mxhJw4fCi2E84K7woll5RgaX4u6cV5dkLiEX56a3fQ40gx2g8lJdspd/ gJEmNOwXkdOsRUpcv8fO+bVOlAWW1PPT7WT9fKCbQ1lsDcNBTIFRvQa0Y+wY5EqSTsR9 IHTFEI4VNBTELz+vsmt/NMVAY11dLkzejoSsy11WeQmbhvdCxR8AgAeqpJ0xay8RIRz5 FVZa3i6sAOkwjzC7PTheHjY9eY1mGmDhlD9YZTNVzmZg8efAVNtx87qQVrPmnxdpuhPZ F1nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NwrOyRory1XmZdig+/oN5fJYy0rvivhWTpDQ8bXp8Is=; b=pZAtcihxgMOo9hg8Ke1ysiTfA24A7HfiW/3VZRXWOKEuMLyYJs+nei2Yj58cPqb5+m HjX1czl2EcVuEP2QLn73xaSfpUDI17gVo++zk7mOue3becf16wdhAkVyuOvpJGUzXX0K Xpq5LyzuSR9A7by1p6ZIvLJV5jv5tDaz/O21dJjm6Pl3RrKKe583U/UMX0EJLw3rC8hS 5+pgW9TwgdCGYEg68AswTPdjQExofMwXqUNCpn84Wf9E8+em9WcO1TPbcRpOxoRvYXx3 cP4DKqDkwEbdq8sZ3AgkCY+l035yqE7c6Oq/V/S6HxOWHQ7xM02Pnbh8qhtHMRMr6yH1 wVpA== X-Gm-Message-State: AOAM530zZcocmaAz/BlFDUp8nOeliox7tvrHEe6ZSICTBqdHmOHTN/ys IXH/YbWWIMn/DiNBABa0VHL5pec1LQVF5g== X-Google-Smtp-Source: ABdhPJwfXiQ1puBQK8B2koHcYiUq913dALcHx2IH1OWJws4SMnXAEK/gHYYdLX3SxvTZDPGhesUnEw== X-Received: by 2002:a63:2308:: with SMTP id j8mr2572783pgj.166.1627001541816; Thu, 22 Jul 2021 17:52:21 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id l10sm7888396pjg.11.2021.07.22.17.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 17:52:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , anatoly.burakov@intel.com, Tyler Retzlaff Date: Thu, 22 Jul 2021 17:52:18 -0700 Message-Id: <20210723005218.134328-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210713201221.301248-1-stephen@networkplumber.org> References: <20210713201221.301248-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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" The first argument to rte_bsf32_safe was incorrectly declared as a 64 bit value. The code only works on 32 bit values and the underlying function rte_bsf32 only accepts 32 bit values. This was a mistake introduced when the safe version was added and probaly cause by copy/paste from the 64 bit version. 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 Acked-By: Tyler Retzlaff --- v2 - add suggested release note doc/guides/rel_notes/release_21_08.rst | 4 ++++ lib/eal/include/rte_common.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_21_08.rst b/doc/guides/rel_notes/release_21_08.rst index e2c5ccbf7d90..148405891fcb 100644 --- a/doc/guides/rel_notes/release_21_08.rst +++ b/doc/guides/rel_notes/release_21_08.rst @@ -196,6 +196,10 @@ API Changes to be thread safe; all Rx queues affected by the API will now need to be stopped before making any changes to the power management scheme. +* eal: ``rte_bsf32_safe`` now takes a 32 bit value for its first + argument. This fixes warnings about loss of precision when used + with some compilers settings. + ABI Changes ----------- 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