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 49E62432CA; Tue, 7 Nov 2023 20:10:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3168642C24; Tue, 7 Nov 2023 20:10:14 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3EC5E40F16 for ; Tue, 7 Nov 2023 20:10:08 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 7FD3B20B74C4; Tue, 7 Nov 2023 11:10:07 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7FD3B20B74C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699384207; bh=uKEGi0ejpYKKgvp84kKllYei9w9cTolmgccmjfgGSL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=svEAlUkOD/BP6dU9KRDpNHlphPs2d4/lQQ/wgYUrF9GURWDp9AhR9GbiKXjI/29dF 0Ji7N7B2eNWHkg38cgNDwjs7aE/bbDEesSUnKbK9Gh/CWKqxNXC8KgwrssuWjRLq/W ILV7KHu/ZXkoEZUTLs3gsAsykaGfxUsqrz8ZkMUo= 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 v2 4/5] rcu: use abstracted bit count functions Date: Tue, 7 Nov 2023 11:10:04 -0800 Message-Id: <1699384205-12999-5-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1699384205-12999-1-git-send-email-roretzla@linux.microsoft.com> References: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> <1699384205-12999-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