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 2B4D2A054F for ; Wed, 1 Jun 2022 09:04:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2457F40DDE; Wed, 1 Jun 2022 09:04:53 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id C544340689; Wed, 1 Jun 2022 09:04:50 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E14235C0228; Wed, 1 Jun 2022 03:04:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 01 Jun 2022 03:04:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1654067087; x= 1654153487; bh=DUo4YRZ20T65o77woPkiDy48lrNfHiV2FlnHZ5ItZLY=; b=j Ff2plgaUac64xH97ng3n9d2see/9kMWeTvNQ13PxwVZCAs6DNmdlP0F7hPeV7RU4 r4iGuxiCRnn2sAkgwTcxHQ0dfd5xULA59wEcVa/desS8mjMafoK+e7r7VA5oiYWv zuVdP74IsEE1iM2rv4Jfa7TtJXQnk0rzaz2vT9VcOeyZSaFtbUcodyF+w5ILn9aT BDRie5i1MdWjKd8X2XCyPaR8XK52wuX/FeKFl9hpZGiP3JdXmisvvMo4WjjJDyaF Jp8GWn0R8B4722UCVqbMf5q+W997sUeQyEqHxnfISFq55VVg0IcpOs8/7C2D3wle i5cK318Ag05njbz5PbV7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1654067087; x= 1654153487; bh=DUo4YRZ20T65o77woPkiDy48lrNfHiV2FlnHZ5ItZLY=; b=W ACQ8JWaVzs/+YCpp0Hjf6uEsBqIon7fSkqdG5EDVbwTbE31TtqLjDqcgGvH2EL/y 2mIHJlLrgxGR34C9DIa2gKOFl9nD+U6a8Fu0Hqa2CBNZmTYOuF21JZvPGXKXo8fJ jVK+aDi83NryS2Rl7y7ULkm3HCb03/aOULO/nTq1DE0IGsYry6zRKT1HiSNJWpb3 QauOoioB/kQ8ykicPXzSRx6m4f7T1t5jaWXwmgibVjj+Jt0JmPzFDJy/AEUuKkfN vLQi8zHPRE0WYkpCHjfYnTNe49z++QIL5ATPXl8VJ+T6v1DAoTdixpMXCW1pn8ij 0yX8OgbKURS3di3SQDxMQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkeelgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Jun 2022 03:04:46 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, dpdk stable , "Medvedkin, Vladimir" Subject: Re: [PATCH] rib: fix traversal with /32 route Date: Wed, 01 Jun 2022 09:04:43 +0200 Message-ID: <4423979.cEBGB3zze1@thomas> In-Reply-To: <04cfa5fd-6e77-72df-f555-ea8f4d6a4b5b@intel.com> References: <20220414200104.245071-1-stephen@networkplumber.org> <04cfa5fd-6e77-72df-f555-ea8f4d6a4b5b@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 26/04/2022 16:30, Medvedkin, Vladimir: > Fixes: 5a5793a5ffa2 ("rib: add RIB library") > > On 26/04/2022 15:28, Medvedkin, Vladimir wrote: > > +Cc:stable@dpdk.org > > > > On 14/04/2022 21:01, Stephen Hemminger wrote: > >> If a /32 route is entered in the RIB the code to traverse > >> will not see that a a end of the tree. This is due to trying > >> to do a negative shift which is an undefined in C. > >> > >> Fix by checking for max depth as is already done in rib6. > >> > >> Signed-off-by: Stephen Hemminger > >> --- > >> lib/rib/rte_rib.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c > >> index cd9e823068d2..0603980cabd2 100644 > >> --- a/lib/rib/rte_rib.c > >> +++ b/lib/rib/rte_rib.c > >> @@ -71,6 +71,8 @@ is_covered(uint32_t ip1, uint32_t ip2, uint8_t depth) > >> static inline struct rte_rib_node * > >> get_nxt_node(struct rte_rib_node *node, uint32_t ip) > >> { > >> + if (node->depth == RIB_MAXDEPTH) > >> + return NULL; > >> return (ip & (1 << (31 - node->depth))) ? node->right : node->left; > >> } > > > > Acked-by: Vladimir Medvedkin Applied, thanks.