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 42C2C432CC; Wed, 8 Nov 2023 00:38:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EAFE540041; Wed, 8 Nov 2023 00:38:26 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 9C0AB40DDC for ; Wed, 8 Nov 2023 00:38:22 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id E4EA820B74C4; Tue, 7 Nov 2023 15:38:21 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E4EA820B74C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699400301; bh=uKEGi0ejpYKKgvp84kKllYei9w9cTolmgccmjfgGSL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rbbe+aB4sTvwEMYRaea08y4ajXnlz7wccgN2ZJ6ysS+TkcUi7Uw2BUgUsrLm2mUlF VpgBJRWa+Rbt7dmIE/n0IOPsH4Be5+perxaJG34zYns4obifHiuYwy1tdF9DXM7MZi uCkZRIpUOBVsLoRlGVa+rsaw87fktMaIJQ9+Mwuo= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Cristian Dumitrescu , David Hunt , Honnappa Nagarahalli , Ruifeng Wang , Sameh Gobriel , Tyler Retzlaff , Vladimir Medvedkin , Yipeng Wang , mb@smartsharesystems.com Subject: [PATCH v3 4/7] rcu: use abstracted bit count functions Date: Tue, 7 Nov 2023 15:38:17 -0800 Message-Id: <1699400300-22545-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1699400300-22545-1-git-send-email-roretzla@linux.microsoft.com> References: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> <1699400300-22545-1-git-send-email-roretzla@linux.microsoft.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 Use rte_ctz32 or rte_ctz64 respectively instead of __builtin_ctzl depending on the resultant type of the expression passed as an argument Fixes: 18898c4d06f9 ("eal: use abstracted bit count functions") Signed-off-by: Tyler Retzlaff --- lib/rcu/rte_rcu_qsbr.c | 4 ++-- lib/rcu/rte_rcu_qsbr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c index 4dc7714..a9f3d6c 100644 --- a/lib/rcu/rte_rcu_qsbr.c +++ b/lib/rcu/rte_rcu_qsbr.c @@ -231,7 +231,7 @@ rte_memory_order_acquire); id = i << __RTE_QSBR_THRID_INDEX_SHIFT; while (bmap) { - t = __builtin_ctzl(bmap); + t = rte_ctz64(bmap); fprintf(f, "%u ", id + t); bmap &= ~(1UL << t); @@ -252,7 +252,7 @@ rte_memory_order_acquire); id = i << __RTE_QSBR_THRID_INDEX_SHIFT; while (bmap) { - t = __builtin_ctzl(bmap); + t = rte_ctz64(bmap); fprintf(f, "thread ID = %u, count = %" PRIu64 ", lock count = %u\n", id + t, rte_atomic_load_explicit( diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index 9f4aed2..13461f8 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -530,7 +530,7 @@ struct rte_rcu_qsbr_dq_parameters { id = i << __RTE_QSBR_THRID_INDEX_SHIFT; while (bmap) { - j = __builtin_ctzl(bmap); + j = rte_ctz64(bmap); __RTE_RCU_DP_LOG(DEBUG, "%s: check: token = %" PRIu64 ", wait = %d, Bit Map = 0x%" PRIx64 ", Thread ID = %d", __func__, t, wait, bmap, id + j); -- 1.8.3.1