Skip to contentSkip to conversation

app/dumpcap: replace use of __builtin_clzl

PATCH Applied Stephen Hemminger 2 participants 2 messages Oct 16, 2024 – Oct 30, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/dumpcap: replace use of __builtin_clzl

DPDK applications should avoid direct use of compiler builtin.

Fixes cbb44143be74 ("app/dumpcap: add new packet capture application")
---
 app/dumpcap/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/dumpcap/main.c +1 -1
index cb2a439f79..9ca578e27e 100644
@@ -677,7 +677,7 @@ static struct rte_ring *create_ring(void)
 
 	/* Find next power of 2 >= size. */
 	size = ring_size;
-	log2 = sizeof(size) * 8 - __builtin_clzl(size - 1);
+	log2 = sizeof(size) * 8 - rte_clz64(size - 1);
 	size = 1u << log2;
 
 	if (size != ring_size) {
Signature · 1 line
2.45.2
#1 lore raw
Quoted 6 lines · Stephen Hemminger

DPDK applications should avoid direct use of compiler builtin.

Fixes cbb44143be74 ("app/dumpcap: add new packet capture application")

Applied, thanks.

Signature · 1 line
David Marchand