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 9908EA050B; Tue, 26 Apr 2022 16:30:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D93A427FE; Tue, 26 Apr 2022 16:30:38 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id E1905406A2; Tue, 26 Apr 2022 16:30:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650983437; x=1682519437; h=message-id:date:subject:from:to:references:in-reply-to: content-transfer-encoding:mime-version; bh=b4yJaxQyBAMrnvIazAkFtXH6MjEvybRT8gl1L7LXf3U=; b=GRxryqQWp4o2buCWUdNQpcleKGTC+IjI35GiXf25UzWdP9qYSEPSWtzV zxYSTSQXnywXt0l6jJ0/j0M5/1lPwg4ohPT1g+F3Sm+4e7pQCOivdw+dl vd0WQBuSFHO61ZVSIm+rcDiY2h7PS7TuUBioQwf90aletNU6dBEvW0lWZ P5yZY7zPvjdZiyRhfnaX1FctkvRTBqN1HCHtXCwScXto8K+Z2lv0w3Z+K kP0BHxK2S01UAnbRd6gUAOnWSezdMFynrFCKtyJZVaP3gM8kbLl0S18f5 9Pxi93te4COVPqBk6xjPGHk72HEZq7ZjdoeZkbtfJU8QEpLk6BSwgs0us w==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="252971193" X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="252971193" 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:30:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,291,1643702400"; d="scan'208";a="874693640" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 26 Apr 2022 07:30:35 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) 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:30:34 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx604.amr.corp.intel.com (10.22.229.17) 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:30:34 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.103) 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:30:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e8t9PBI3KHT/A7OXdoYimB3PoxhT3XTgBAWsbPtahh7lz5X0nS6rD01JeY4mAK4enEZUnsgBBDh7jQp5oFCzEqJBrng/AP2c+X/46MZ769vdUkO8yCg5im5jVA5qKLsYJM1pFpqy3hMlqEQnN7LGN6eT0NB7bMFkgqhWvudPaMG3Z7pgncmn7oPZYniBJ4NlqmkJj2gBBoNAJEzeTa1I7/LZ1J2hw0UAqu5+RzY/Jfkgc5AOFN/GyMkCkn93mzNBNA9LWrUFNH+PIWUgLZj3NyiPH1t2qhN3Nmu/ekdgirsjrrjnFs10/pTZS7ng6Ry3Auf/jWKRlkntoftA+t+22w== 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=JZmneBmNhuHAgdTjgJIlrkfk34Nujr2t2auvWBLSwa0=; b=JJYWbUxNRFug3speMQJDp+IeHcmbcN1nAvj1RFL5mlEPsDLgNJjOzo8m6C1Q7eIDo7Ylwem0n6b3vwzR6UmWwyZHJGBk5zsfwfMYBoLlQrNXyb9XGsu+kRKtQmUmNIVyfNVktCvU8zu31RmiDyKXqdNL9rMRTcReVNq0mYyoOPhE3ifRuZug0nJBO6j1bt7C4WKoCnzKRjJgEXA4svdCFeHmIWSSW+LCNTeUnQaRVRQVkGcTA5+YjI8NyYvY95BQwL4R9twgrye2vxfI6OiovK8ne0MKy3fuVYh3QFEtsR9QdQnqIGjk2ou267KRPfyqGMrLNMlqL0dpqfjx+ZCE3g== 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 DS7PR11MB5967.namprd11.prod.outlook.com (2603:10b6:8:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Tue, 26 Apr 2022 14:30:32 +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:30:32 +0000 Message-ID: <04cfa5fd-6e77-72df-f555-ea8f4d6a4b5b@intel.com> Date: Tue, 26 Apr 2022 15:30:27 +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 From: "Medvedkin, Vladimir" To: Stephen Hemminger , , "dpdk stable" References: <20220414200104.245071-1-stephen@networkplumber.org> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0426.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::17) 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: a2f17a75-d426-4b42-d705-08da279151ba X-MS-TrafficTypeDiagnostic: DS7PR11MB5967: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: zP9hylAxMR0iQQJBaEq0sL+Aqwr/fK45Hka76UANv82FcWf8n/jxcORCdDwkTDSwUXHeQPhfamu+7wIY0meJC+QwZdkBaIZ0dVqcMzFuX1MQ+va9swSx3EKVMM9HZyKZQfhWzZRlxIgHdKCySrqaBBM+Enc7j0xBp/eqwGfDaVhmZqlJe8SyzOeeDmvdBWNGPNCw3mCiLKogYszSUNGB9XDkzs+HKrSwWrqo9edtokYk/ZlamP1fyKCp42rQ6bMieF7XEee6NH3V58zSFKMaI+G8Ocf832DVxz7OfBUGg0EVW/8CHcEoz/FNp3tHC09cHJ+AO6m08RsvbEXOrI7MunSBLB9QG4yz8RTKPHz+3w1jPrAQOvQz0AoR5W0GJ2J0EyrNhSmm0x5zPh5nc6lOiv9ciPWEtCF5RHVCaL20x22Vo5If80d2wKS4YGHUte049bV7u/MhjJV4N4+CocfPl+JcAKT6LbovNkVxH6nBuNK/ve2LtMza2eBslxSH/6EkDcjpWGrjbaIHeHol69ImEgWAIxPjm88MulUZIKI/aeJtwtSdM9XB81KgC/gd4CRCnwXDXWReAVv9yOKjeRouTCqWIOfdUY/Vkl3r7RqEzrHf/6M/c/sRk/NUuPA1x43J4S6hHL6kSYt8hCgCnmyvh54tl85GvJfmVM4B6ikYKY8KmLjXH3LV0Iz7jvKP9L2kaTmjkEWgc5iWu6WjtFqexz7VcpaRtmm8RzI0Fucwqj8= 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)(6666004)(6486002)(316002)(8936002)(110136005)(6506007)(2906002)(186003)(36756003)(6512007)(26005)(31686004)(66556008)(66946007)(8676002)(66476007)(2616005)(82960400001)(31696002)(38100700002)(86362001)(508600001)(5660300002)(53546011)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aE9mMVArMm43dGZWOExnOWxyL0U3Vm9SYWF3enFvay9iU3RVM0VnTmhYM0hn?= =?utf-8?B?T3pNaEpZTEFvbEM2MFdKZ3d4TWs2dDdXaWVTYUo0dzNKL3JVTlFrdnduVjJw?= =?utf-8?B?RmJVVkFYOU1yUkNqVmhCMjlPTlAvRWovSDRIaVZKamRySGxCZDBpLzJsNm0v?= =?utf-8?B?UWZ3eUlzbWJBMTZzU08rbk1OdnpZcFVQb040TVpVUGpISW1peXZDL1l3Qmhm?= =?utf-8?B?MkF5Q1dDVVpsYnI0MjY4TTUxV0dKeEtGQkp0VkhJeHhla2NiWVNDaG9KRm5P?= =?utf-8?B?Nnc1NEhnVEEzV21pUkxqc2RqT1ZPd1lYQVpLQjNrbXIyZ28yQTdQQUJFUnQx?= =?utf-8?B?bDU4b0VzdElUVjVtN3lSMERsdVNlWEVQYWZvZTBOVklrVm9OMm1aZElubGVJ?= =?utf-8?B?eGZIcTFlKzRPNjRObUNnTVpsTDVNQUtsVi9YWDQrQUVIRDZVK0gzSUxsQ3Bz?= =?utf-8?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KMlJr?= =?utf-8?B?OWp0NS9RSWJVZmVmSzhMNWRyb0NISUZwUEFYVmQyTTEvMGQ5M3VvRzhJYVdP?= =?utf-8?Q?z+KrqNG/Kq3aeAyo=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: a2f17a75-d426-4b42-d705-08da279151ba 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:30:32.3473 (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: B3OnyzL0DcThKNuJRt6jM7XjC7O4v1MvvDjwhi5QshcXn3QLTJfNVvtQIwp5vGBYhLPb38T96iOApu+nP0wNmKei3qAum9ga3c2hkw164so= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB5967 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 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 > -- Regards, Vladimir