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 56045A0524 for ; Thu, 4 Feb 2021 12:30:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E44A24071A; Thu, 4 Feb 2021 12:30:08 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 1A8BB24071A for ; Thu, 4 Feb 2021 12:30:07 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7cpo-00052K-GC; Thu, 04 Feb 2021 11:30:04 +0000 From: Christian Ehrhardt To: Vladimir Medvedkin Cc: David Marchand , dpdk stable Date: Thu, 4 Feb 2021 12:27:36 +0100 Message-Id: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'rib: fix insertion in some cases' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/06/21. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/579a8b4fa111171133d32e2eb7cb20534cc33c1e Thanks. Christian Ehrhardt --- >From 579a8b4fa111171133d32e2eb7cb20534cc33c1e Mon Sep 17 00:00:00 2001 From: Vladimir Medvedkin Date: Tue, 8 Dec 2020 17:00:04 +0000 Subject: [PATCH] rib: fix insertion in some cases [ upstream commit e682b020840a9035beacd24cba4f6baabcfaf5ff ] According to GCC documentation for __builtin_clz: Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined. __builtin_clz will be called with 0 if the existing prefix address matches the one we want to insert. Fixes: 5a5793a5ffa2 ("rib: add RIB library") Reported-by: David Marchand Signed-off-by: Vladimir Medvedkin --- lib/librte_rib/rte_rib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_rib/rte_rib.c b/lib/librte_rib/rte_rib.c index 55d612dc2e..07b3c068ed 100644 --- a/lib/librte_rib/rte_rib.c +++ b/lib/librte_rib/rte_rib.c @@ -301,7 +301,7 @@ rte_rib_insert(struct rte_rib *rib, uint32_t ip, uint8_t depth) /* closest node found, new_node should be inserted in the middle */ common_depth = RTE_MIN(depth, (*tmp)->depth); common_prefix = ip ^ (*tmp)->ip; - d = __builtin_clz(common_prefix); + d = (common_prefix == 0) ? 32 : __builtin_clz(common_prefix); common_depth = RTE_MIN(d, common_depth); common_prefix = ip & rte_rib_depth_to_mask(common_depth); -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-04 12:04:28.273878971 +0100 +++ 0001-rib-fix-insertion-in-some-cases.patch 2021-02-04 12:04:27.766789473 +0100 @@ -1 +1 @@ -From e682b020840a9035beacd24cba4f6baabcfaf5ff Mon Sep 17 00:00:00 2001 +From 579a8b4fa111171133d32e2eb7cb20534cc33c1e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e682b020840a9035beacd24cba4f6baabcfaf5ff ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 2a370d7f84..6c29e1c49a 100644 +index 55d612dc2e..07b3c068ed 100644