From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id DCB942B92 for ; Mon, 19 Nov 2018 13:25:46 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id r10so14300270wrs.10 for ; Mon, 19 Nov 2018 04:25:46 -0800 (PST) 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=dMZuPiw8oAlD2qiwXM86OVuPDTo7Su8M77p+q4y8feA=; b=B5lIkJoRZZXeVTUBiRG7/VZz9NZsRwNCJGpVbOJ69S40C9JrM8COFDCySspHxFYdPS IKaLcdfdhrrxYOEEXivYx5PrP73zohXEm2K+OnzTiH1DGXtvaH1L7KSf+gqQ39Nqzm0B E2JkSmuuvgdfPbdJr6OcdF+kvx42yJIW7teKQCo9vdL6zOJfpT56hmAg3cjeergU2PJF yO4+MHZnA5N9Npb/yfJga5EyQQn7dR16ozta522IAfcfOY6Qt7PUIkReA3auAM/NexZM C4a14vObDm5V/edmB61oUgkBvTXdswBQDXMjGIChQ5l3Lxr8yMT+9cDcarnIhBHhNog1 v37g== X-Gm-Message-State: AA+aEWaoWxO6m14Wne96uXptRsjcbYpNo+WJ6OLsZTzKGG7U4OIuAnnx 0EL42TAophFrVDGS8RBfdh1W/ZlK X-Google-Smtp-Source: AFSGD/VSPA/Vw1WAOkfoI3qO3DQpwawMyeKI1YwDY3NM61d1eC2S3yGnBvYt1t+JDZYKU2tj3Y7L6Q== X-Received: by 2002:adf:9341:: with SMTP id 59-v6mr4295203wro.204.1542630346409; Mon, 19 Nov 2018 04:25:46 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id w9sm11693627wme.47.2018.11.19.04.25.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:45 -0800 (PST) From: Luca Boccassi To: Jerin Jacob Cc: Thomas Monjalon , dpdk stable Date: Mon, 19 Nov 2018 12:25:19 +0000 Message-Id: <20181119122538.14207-2-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119122538.14207-1-bluca@debian.org> References: <20181108180111.25873-1-bluca@debian.org> <20181119122538.14207-1-bluca@debian.org> 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 16.11.9 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: Mon, 19 Nov 2018 12:25:47 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/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. Luca Boccassi --- >>From 7aabb9ba5a2f4a03d063e11e83cac06b441ad079 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 0fac816f9..f8f6d37d7 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -482,11 +482,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) { @@ -1059,8 +1054,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; @@ -1071,7 +1066,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.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-19 12:15:18.147417342 +0000 +++ 0001-eal-fix-build.patch 2018-11-19 12:15:18.067611434 +0000 @@ -1,4 +1,4 @@ -From 5d08fecdd39f2373713a0475b75a4126800c9acf Mon Sep 17 00:00:00 2001 +From 7aabb9ba5a2f4a03d063e11e83cac06b441ad079 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 0fac816f9..f8f6d37d7 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) +@@ -482,11 +482,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) +@@ -1059,8 +1054,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) +@@ -1071,7 +1066,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"