[dpdk-stable] patch 'rib: fix insertion in some cases' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:14:52 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

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/07/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/73db17f246bfdb1bd44f66b1e936148025a28517

Thanks.

Luca Boccassi

---
>From 73db17f246bfdb1bd44f66b1e936148025a28517 Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
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 <david.marchand at redhat.com>
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 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 2a370d7f84..6c29e1c49a 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.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:29.614347527 +0000
+++ 0006-rib-fix-insertion-in-some-cases.patch	2021-02-05 11:18:28.586686923 +0000
@@ -1 +1 @@
-From e682b020840a9035beacd24cba4f6baabcfaf5ff Mon Sep 17 00:00:00 2001
+From 73db17f246bfdb1bd44f66b1e936148025a28517 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e682b020840a9035beacd24cba4f6baabcfaf5ff ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list