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 59B1DA0508; Tue, 26 Apr 2022 16:29:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FA8D41109; Tue, 26 Apr 2022 16:29:05 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6990240E78; Tue, 26 Apr 2022 16:29:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650983343; x=1682519343; h=message-id:date:subject:to:references:from:in-reply-to: content-transfer-encoding:mime-version; bh=tE0rffrMBLFMxdpL3TmTuEKqABcdNyO5X8EgtMarR6g=; b=jR9SRl5Pbg7IshAB6UsE1I5tprH3hjszoX4PAu2uIOD3f/r6DlBNUjog KxXUGxCNNMuM2eS3UiR2VkgZglcYwHXM8Mzd2khXi0bzigsYs3dP861+S Se0PVnnwVrpuDNNwkRWCdjpSYUA5UZY75fH5h/cAhc6djjKxR9qpWdTzx bXIfokDGUYffEs6QbgMv1e5wJSsSHRTAvjXyUVNpXQXQW2+lOT83hP33V qpkmxc/s8U+g1h9h7DsrqwowbicS/g7HhYwIjvhyW9+J65SVtSn7Ontg+ lVY+cmeJGYO2tBFywdGoWOSzlaGYM6VFeM8tQ/p9KvYzr7ZmRaK2d19/F Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="252970868" X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="252970868" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 07:29:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="874691185" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 26 Apr 2022 07:29:02 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 26 Apr 2022 07:29:01 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 26 Apr 2022 07:29:01 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.176) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 26 Apr 2022 07:29:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNhhTEpKzTGnIuqw7w3Q+uawaZFSj+0c9UVSsAFXxw3hoG8kvX8IRQwm7Vy5vCasp6txtSubKfMwYbokkECVNOHMK1tsrdT8K+8zpL07nVgvTTwdvjx967kYPAoYfpTjhpHzR9PnIcuGu5em+lCySYkwajYLdRvqUgvw1mQpy2CA73XH/QLaPFqgw/gFKdTwuOq6j4YJzBMtv7T+KL+VaxxHfG+4q7YHPDnjmKg6HAFvAO3gOEQMLgDH7KpsfAufuK2BzZiJEpcjVFNz6TyMWonom4p0A0PyZW+YsEYKia0UYCWtdpyJvX5mAswLC22yyn1cHRUuUpXa9B++mfq7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I+GBnXv3gJ4YU7R2zoOqg0szax72KhpRO/IkKIzAcMQ=; b=Bwmj8YWke1MiI6oSlcts9+psAR82YTIYnPEagcipJS+7Vz3WoYfvyfD7+Rz/Rkcikc+5WCC3ZtfaZWER5olR6NFN2MjXE8vNkud+jKjUDtK0pIVdnKg/SdGGwUxci7G/AL/3UwjzChrcsIY541kN9QCeB8Snovonep5oQ8XQ6t8Gj1uxsAs/TA3Ck38EgqlSoVbBObcxhzUKsqaPkwOVKordi2d06gKcSjz3vK607blHr4YCxM4AXXOJHgYOVJpLPY2oe58AWFa6KsMuKfBY9zN/uX9Xe+l8oTuthT7YcaeACH2eTdx3UmJTEMY4MuLovj3FJgL+5IxoE2i3UWQ9fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) by CY4PR11MB1304.namprd11.prod.outlook.com (2603:10b6:903:2c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.18; Tue, 26 Apr 2022 14:29:00 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::b433:a97d:da56:c168]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::b433:a97d:da56:c168%4]) with mapi id 15.20.5186.021; Tue, 26 Apr 2022 14:29:00 +0000 Message-ID: Date: Tue, 26 Apr 2022 15:28:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.0 Subject: Re: [PATCH] rib: fix traversal with /32 route Content-Language: en-US To: Stephen Hemminger , , "dpdk stable" References: <20220414200104.245071-1-stephen@networkplumber.org> From: "Medvedkin, Vladimir" In-Reply-To: <20220414200104.245071-1-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0051.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::15) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16b44c83-577b-4791-08f1-08da27911abf X-MS-TrafficTypeDiagnostic: CY4PR11MB1304:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3xeN+ty0A8u3EH5COcDCO/NHVlS4x1xItha4XxMdfNaaOjJGgRs87n8iUBGugfxZDrh7AQvZPEXfGMEKBa/P7trBH+JUVYq0yh+zh/ObPD+yAYUBzbYY861E2qsT7KziRupJO35Oj6aLQ612XoQY9HY/TX2J3s0Ey9wUl9Ogcs7dwAexmwrDSa+XJCIf5PtKUrw5hO3I5wEsfVJ7GPf/8h84S4GostNJbuf+ObjS0DhW8Cr7dnBZh4VAVFkM2m7flGaWc4JBajAsNWAoHghV/Hn2srnl9q/xIbyU8VoJIwO0ofoiDPQZuRqIN+TKIYzA+iKSElnGO60H6L2WZcfu7xIn/pCItNo9W2nVvw6JPfkKYdLH8NkZi9Z1kB48DRq/y/gnhuOe/06f00joW0TETNliYFczM1aKKRxC2meOGwe+lso02MWBIu74eBB4G4VxIVCQyxpVipWNftRej5hv7hj4uI1I/0hiQfGHSZ4Wr1093785VhqKNBYCH+OemT/W3pJdIcTqwRYOVeMm0QM2bvhHTJU/9E03ZaL7Zd9l8h2oQaD9Xyf9WQSS6E70oSc9NizISeb6k0XWJ/V5jPbT3GbKC4K7uWHqQZesr2qnKLfMLw2xgWwJ7LiRNBjY44H5IjOq79fQYROw3BbR01rln/BQcBNbQxOalsMoQjAQ1Qkxp1VzkJpcX4svWyFgwxcg7TQesQk3ihimSTEncXfmW8zqT0QZswbIL6IqbVa+QGY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5772.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38100700002)(2906002)(186003)(8936002)(82960400001)(4744005)(8676002)(6486002)(66476007)(66946007)(66556008)(5660300002)(36756003)(53546011)(316002)(2616005)(6666004)(6506007)(6512007)(110136005)(26005)(508600001)(31696002)(86362001)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VUYzK2V0MjJKbmJWeXNzSURlVVlOOU00cEl5MDAvME9zTVhWd2tZUTBXb0lP?= =?utf-8?B?NlpJQ3d6TlJKT2lyT1NNdlgzOUxreUtOT1p6UlIrQjBYNmxBMmNtMnU0a1FR?= =?utf-8?B?NlFwbU1tQWJjdzhjYUxVa3p4cUZTYjFtNHZSMnE2Qk1WSlBHL0ZrR0hNb3RI?= =?utf-8?B?eUtvZEozUDRKNG8ybG0vcUxYYUNVbHd3MU1laTMvbU1sU1lMRXZPVFZGTTRR?= =?utf-8?B?bVVVSlBsanMwUG9JSk8xb2VWRlRlV1hscjdmTFU1cUIwWkppcnorV24wQXVF?= =?utf-8?B?TEZBRUI0bC8yOEtDM3JmODV6c1dkRkRha2FnaTE3SG1YVUtwQVduOXNZaXRS?= =?utf-8?B?UmtlWmNkV291YVFJMXlTaUZFY3hwYVQwdXFuUktMMW9QaXVrZ3pROU94ZWxo?= =?utf-8?B?QmNRS1JRU2ptelJaY1o0alBBYlBCc2RQMnpKc3Bjb1Fqbm5TNUFoUmxJQVFs?= =?utf-8?B?R2hDUzJKZU9pd2tyRjFRe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wWVRjTmVtZG9vbEFEeWYzeThoRjFy?= =?utf-8?B?YkJscUxxSnc4NFRPR1Z3T05nQ3c0MVIzSGdva3pmdmIvMm9WeE1qWHhYYWV4?= =?utf-8?Q?pNrpUZS+xieA6HmM=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 16b44c83-577b-4791-08f1-08da27911abf X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2022 14:28:59.9908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DCGTZF69Sh4QumNOvbSuF5XY4Jzgt3phhdngMxzDdU74Jw5P8kof5pdsZnHWudWWkG6VqfwDzxeVR9o+Ja8VT4EOLVJXclcRnzc3Z5ZvD/4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1304 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org +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 -- Regards, Vladimir