From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C3A6D1B50A for ; Fri, 30 Nov 2018 00:15:25 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:21:14 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW8d032075; Fri, 30 Nov 2018 01:15:19 +0200 From: Yongseok Koh To: Jerin Jacob Cc: Thomas Monjalon , dpdk stable Date: Thu, 29 Nov 2018 15:11:33 -0800 Message-Id: <20181129231202.30436-99-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal: fix build' has been queued to LTS release 17.11.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:15:26 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/01/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From 6099875bea46299385af40c77e11100a2feb0dc3 Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Wed, 7 Nov 2018 06:59:06 +0000 Subject: [PATCH] eal: fix build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 5d08fecdd39f2373713a0475b75a4126800c9acf ] Some toolchain has fls() definition in string.h as argument type int, which is conflicting uint32_t argument type. /export/dpdk.org/lib/librte_eal/common/rte_reciprocal.c:47:19: error: conflicting types for ‘fls’ static inline int fls(uint32_t x) ^~~ /opt/marvell-tools-201/aarch64-marvell-elf/include/strings.h:59:6: note: previous declaration of ‘fls’ was here int fls(int) __pure2; FreeBSD string.h also has fls() with argument as int type. https://www.freebsd.org/cgi/man.cgi?query=fls&sektion=3 Fixing the conflict by using rte version of fls. Fixes: ffe3ec811ef5 ("sched: introduce reciprocal divide") Fixes: faf2b25c9f80 ("fm10k: support VMDQ in multi-queue configuration") Suggested-by: Thomas Monjalon Signed-off-by: Jerin Jacob --- drivers/net/fm10k/fm10k_ethdev.c | 11 +++-------- lib/librte_sched/rte_reciprocal.c | 17 +---------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 58dac3894..a0263f6d7 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -483,11 +483,6 @@ fm10k_dev_configure(struct rte_eth_dev *dev) return 0; } -/* fls = find last set bit = 32 minus the number of leading zeros */ -#ifndef fls -#define fls(x) (((x) == 0) ? 0 : (32 - __builtin_clz((x)))) -#endif - static void fm10k_dev_vmdq_rx_configure(struct rte_eth_dev *dev) { @@ -1061,8 +1056,8 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private); nb_queue_pools = macvlan->nb_queue_pools; - pool_len = nb_queue_pools ? fls(nb_queue_pools - 1) : 0; - rss_len = fls(dev->data->nb_rx_queues - 1) - pool_len; + pool_len = nb_queue_pools ? rte_fls_u32(nb_queue_pools - 1) : 0; + rss_len = rte_fls_u32(dev->data->nb_rx_queues - 1) - pool_len; /* GLORT 0x0-0x3F are used by PF and VMDQ, 0x40-0x7F used by FD */ dglortdec = (rss_len << FM10K_DGLORTDEC_RSSLENGTH_SHIFT) | pool_len; @@ -1073,7 +1068,7 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) FM10K_WRITE_REG(hw, FM10K_DGLORTDEC(0), dglortdec); /* Flow Director configurations, only queue number is valid. */ - dglortdec = fls(dev->data->nb_rx_queues - 1); + dglortdec = rte_fls_u32(dev->data->nb_rx_queues - 1); dglortmask = (GLORT_FD_MASK << FM10K_DGLORTMAP_MASK_SHIFT) | (hw->mac.dglort_map + GLORT_FD_Q_BASE); FM10K_WRITE_REG(hw, FM10K_DGLORTMAP(1), dglortmask); diff --git a/lib/librte_sched/rte_reciprocal.c b/lib/librte_sched/rte_reciprocal.c index 652f0237a..385109cd5 100644 --- a/lib/librte_sched/rte_reciprocal.c +++ b/lib/librte_sched/rte_reciprocal.c @@ -38,28 +38,13 @@ #include "rte_reciprocal.h" -/* find largest set bit. - * portable and slow but does not matter for this usage. - */ -static inline int fls(uint32_t x) -{ - int b; - - for (b = 31; b >= 0; --b) { - if (x & (1u << b)) - return b + 1; - } - - return 0; -} - struct rte_reciprocal rte_reciprocal_value(uint32_t d) { struct rte_reciprocal R; uint64_t m; int l; - l = fls(d - 1); + l = rte_fls_u32(d - 1); m = ((1ULL << 32) * ((1ULL << l) - d)); m /= d; -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 15:01:49.543531612 -0800 +++ 0099-eal-fix-build.patch 2018-11-29 15:01:45.262963000 -0800 @@ -1,4 +1,4 @@ -From 5d08fecdd39f2373713a0475b75a4126800c9acf Mon Sep 17 00:00:00 2001 +From 6099875bea46299385af40c77e11100a2feb0dc3 Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Wed, 7 Nov 2018 06:59:06 +0000 Subject: [PATCH] eal: fix build @@ -6,6 +6,8 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +[ upstream commit 5d08fecdd39f2373713a0475b75a4126800c9acf ] + Some toolchain has fls() definition in string.h as argument type int, which is conflicting uint32_t argument type. @@ -25,20 +27,19 @@ Fixes: ffe3ec811ef5 ("sched: introduce reciprocal divide") Fixes: faf2b25c9f80 ("fm10k: support VMDQ in multi-queue configuration") -Cc: stable@dpdk.org Suggested-by: Thomas Monjalon Signed-off-by: Jerin Jacob --- - drivers/net/fm10k/fm10k_ethdev.c | 11 +++-------- - lib/librte_eal/common/rte_reciprocal.c | 17 +---------------- + drivers/net/fm10k/fm10k_ethdev.c | 11 +++-------- + lib/librte_sched/rte_reciprocal.c | 17 +---------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c -index c852022dd..85fb6c5cb 100644 +index 58dac3894..a0263f6d7 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c -@@ -464,11 +464,6 @@ fm10k_dev_configure(struct rte_eth_dev *dev) +@@ -483,11 +483,6 @@ fm10k_dev_configure(struct rte_eth_dev *dev) return 0; } @@ -50,7 +51,7 @@ static void fm10k_dev_vmdq_rx_configure(struct rte_eth_dev *dev) { -@@ -1030,8 +1025,8 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) +@@ -1061,8 +1056,8 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private); nb_queue_pools = macvlan->nb_queue_pools; @@ -61,7 +62,7 @@ /* GLORT 0x0-0x3F are used by PF and VMDQ, 0x40-0x7F used by FD */ dglortdec = (rss_len << FM10K_DGLORTDEC_RSSLENGTH_SHIFT) | pool_len; -@@ -1042,7 +1037,7 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) +@@ -1073,7 +1068,7 @@ fm10k_dev_dglort_map_configure(struct rte_eth_dev *dev) FM10K_WRITE_REG(hw, FM10K_DGLORTDEC(0), dglortdec); /* Flow Director configurations, only queue number is valid. */ @@ -70,11 +71,11 @@ dglortmask = (GLORT_FD_MASK << FM10K_DGLORTMAP_MASK_SHIFT) | (hw->mac.dglort_map + GLORT_FD_Q_BASE); FM10K_WRITE_REG(hw, FM10K_DGLORTMAP(1), dglortmask); -diff --git a/lib/librte_eal/common/rte_reciprocal.c b/lib/librte_eal/common/rte_reciprocal.c -index d81b11db6..f017d0c28 100644 ---- a/lib/librte_eal/common/rte_reciprocal.c -+++ b/lib/librte_eal/common/rte_reciprocal.c -@@ -41,28 +41,13 @@ +diff --git a/lib/librte_sched/rte_reciprocal.c b/lib/librte_sched/rte_reciprocal.c +index 652f0237a..385109cd5 100644 +--- a/lib/librte_sched/rte_reciprocal.c ++++ b/lib/librte_sched/rte_reciprocal.c +@@ -38,28 +38,13 @@ #include "rte_reciprocal.h"