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 6E0CF45702; Wed, 31 Jul 2024 17:53:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5547C40E13; Wed, 31 Jul 2024 17:53:58 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by mails.dpdk.org (Postfix) with ESMTP id CD9D540A71 for ; Wed, 31 Jul 2024 17:53:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722441236; x=1753977236; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=oRNwJl91Qqs53F95Q7XhdEgjrf6D9eK1aAJRwjxhkAg=; b=HLqkCo02pwiwriEUk5a3Zfuj7caTQhYS7I2k6/4z7HntAuGR9TeYGCrM 19Qk7n38/XBGPBe+RZzLMwRj8Rr7sc9YPmD7g9iQmFEQSzAZ8hUaTys76 qhoNMy3lEvNwSCYkBmsHikAtI6WMRenOPK7BdlHeWvlHdEMzck58Np/Hf uAxqGQJ5ZFrKEGXuWW6N0wUl5aS5I1LKGhBHZ3qjd6akQDNmOGDbllODb lKqqLJogAbkytEF4uNr+zGQbdsJGuctsMytZ9XqVn71bYNippjHnjlJQl VOoX4hNUCJJKV+1EcM8yUvkNFr4nzHIE3bsZq8wJIdJmm7GPx/9XSiJd2 A==; X-CSE-ConnectionGUID: 7jxUlzJYRY+hseNRZTI0oQ== X-CSE-MsgGUID: lScwYrWUT1KtdCNPDHGOFA== X-IronPort-AV: E=McAfee;i="6700,10204,11150"; a="31723194" X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="31723194" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2024 08:53:53 -0700 X-CSE-ConnectionGUID: H9i4RTC2ShGPTWjKvRexuA== X-CSE-MsgGUID: mJYKZMnTTCurglQ6bfdxZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,251,1716274800"; d="scan'208";a="77995073" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 Jul 2024 08:53:53 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 31 Jul 2024 08:53:52 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 31 Jul 2024 08:53:52 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 31 Jul 2024 08:53:52 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) 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.2507.39; Wed, 31 Jul 2024 08:53:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WTUUNT6f7xn9R2momjqfmeai3Zrp1S+QqiEqMdX31FSiw11W5NIVU4iaClfpozsNbD6zLJIuDtH0Y/P9wM0nhtxnI/WT1Txqi820zXkaVBPe3+Kn9BlibZPUqA274sj3Au4vqjwfsRRVEwJAmQu3dV7K5Kjz9xW6KnjSXBvtJvWdK5hfs/jb+fEMm8OuQEV2uz6cForH1ec/OZg7/YzCkxJ8Z0m+44m7vMv5FT4AhYiQaHJhHaB1DZRxzTN5pX5JyXhqNbobDjVR/4RpQzV0MiXuRA2Ff947DUZSRWzvdAJlZAnRbS4bllsfQ+B/mld1keW8NOHEYXofYoe+eDSV3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nXTNcKswugrP76irsT8lmhDcmPGIyvVeghLgqTjeCTM=; b=r7Df5Nag8dOEx7P7WPtY5LQOI7H6yqnA7a09UGOGeE+MwLP/uTPZMs0YBRqTABEmH3AvZ2nVVcFBjLwjy6i297hLArjeDBknp1eItSxJdaRu0dCa80w08zvXpkX5xWsHfMTYhKCoxU/hbyQPL8150AaxLaHAj1flek58JsJeDsJICJieKbhAI9NrcI+hhXSe01mV8w63gJGXJ+9EUwMQxmXB9tkfOKJDG7P8lb6IKVdWt0Bj1tFm96LOVe00WMdR9xVzo+hdx7gJRgVONkTS78Mgf6cu0MXzP34mNPxStqzASzAh9WbB1nd0upd8T47iSDyRTMeUaz+KW/VJss9KnA== 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 LV8PR11MB8485.namprd11.prod.outlook.com (2603:10b6:408:1e6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Wed, 31 Jul 2024 15:53:49 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5851:319:3da6:850b%4]) with mapi id 15.20.7807.026; Wed, 31 Jul 2024 15:53:49 +0000 Message-ID: <7bd3a529-fe59-421d-9399-a5b8d8804771@intel.com> Date: Wed, 31 Jul 2024 16:53:44 +0100 User-Agent: Mozilla Thunderbird Subject: Re: fib/rib: allow storing void * instead of nexthop index To: Robin Jarry CC: Thomas Monjalon , , Bruce Richardson References: Content-Language: en-US From: "Medvedkin, Vladimir" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DUZP191CA0065.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4fa::6) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5772:EE_|LV8PR11MB8485:EE_ X-MS-Office365-Filtering-Correlation-Id: 12e13d76-b467-4066-3037-08dcb178f7e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?K0JaWnhQWGxqOWM1MGVWZzFNS3BOUExJd3liVzc4Vm1oLzg0eHkrUG8yeThY?= =?utf-8?B?MHhpNW8vU1Fvbm8zZjNGd2dNaCtEUnByREhOZENvRkZHSmlna0lyT21WMUxw?= =?utf-8?B?WlE5QzlHSW9TTzdubi9kNldJK0ZMRVBYNDlVTWdqejlaSEVPZjZaUlVQNE1n?= =?utf-8?B?YXNqeFlIWnZPbGw4STlEK2c0MzZrMThocDloNGRweUFzOHBnYllUdGVOZXM5?= =?utf-8?B?Y1I5NTdleG03MGhRN1o3Zm5Wdzh6Q0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GdRVWhCS0U2OHZNaWVSNjVYMVJEd0t6dTlDWE9ab0pZRVl1K21r?= =?utf-8?B?SGJhUGVoZERxa2ZaM3RLZWEyY3kvTUV5a1A3K1pIeXA0NzZjWVpLL0xQc0dz?= =?utf-8?B?Q1hjWVpnY2pGRmhnNWtKdENVajEwNVNqdzBFQVRJZm1hN1hlck9WNjlLMkVJ?= =?utf-8?B?VHpZRVFLUG1SbkNEUEh0YlltVTRjYmtXRXZ5MFQ0VlZiVEJjdFhVSUpMS1ZI?= =?utf-8?B?RVBmSkFDSkkwQVAraXJnMzMrdXgxYTZwbVMzRU11RlJFc1NyRy9kT2pDSS9G?= =?utf-8?B?RXlNY3FPcTQ4d0pLeVUvM1RHTzNvNHQrc3h1WjNjb0VueTBaRDBjNUhmSWpy?= =?utf-8?B?di8yeDJITm9oeXVuN0crenFWdzNKUnVhTDAwWVFjdWFsM005bzRabmVJT25q?= =?utf-8?B?VnZQYmVVSHJnTDhtVTVsU0pKcHJrTTVncEU3RGg4QUhOTTIxSC83QmluRVpu?= =?utf-8?B?R2Y5cENqYzQrNjMxQ0ZEV0pKaDlIWnMwbzZ1VjRlWi84N0d2ZkpqSkxldDZa?= =?utf-8?B?OWRxTUpJRFJ1WTZFd1pGNXhva2lVVWRuNlNyeFgvbDNQdFdQZUUyRUF5Slpv?= =?utf-8?B?UVUzNnNSblZxUnRLakV1UXhGQzhwblJrMk5vSHRnM1p5UkczTTErdWJRaCtx?= =?utf-8?B?TXNFUDhwT056RE9JQm1lZz09?= 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:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UVIrVTRrUWdLdUJmL2FhV1FQa1FjaE9LQ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=?utf-8?B?TU42MXpSanIvek5WSGhZQS92bjZwVHhQMVFySGVPT0ZxT2w2YlF2RWR0cUR6?= =?utf-8?B?ZG9tZFM5a0sxQXpXSDVsVldNd1hCUDhPejJVVG0xS1pRekNidE9vTG1JbFZP?= =?utf-8?B?T1M0SUREb0tCNjRLZlV5MmlReW9kRUh2U3BQQ0NnVEVrcFZCeWNLa3ZQUXFH?= =?utf-8?B?SWtEK0JtSDRiRithVUZUUnI3KzlEUHpGYXBLb1pYYzQ1dW1DQURiUzdKWEU2?= =?utf-8?B?QjlQcUdEWDJOVjd0NHdhQVJGaG53Z0s4TlZiZ0xPaFlWTzVKSml1eTFCSkNR?= =?utf-8?B?N1gxZFFjMHdyQmRTWE55dnRNT09PRzF0SnZ5QlZ0WFdqWnVsbkxjVk53d1Nj?= =?utf-8?B?ZWc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 12e13d76-b467-4066-3037-08dcb178f7e3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2024 15:53:49.5396 (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: yOsNEKjDGMdmGk3cZ1ZjwXoNUebe5cc8i2Uczp5VddcgnvA1epQ1WMWFT916kJAo49WFRaSualzNrcdC/TLrNkrjimDaPRMP+dlCOf/Bpk0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR11MB8485 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 Hi Robin, On 31/07/2024 16:04, Robin Jarry wrote: > Hi Vladimir, > > I noticed that the fib/rib APIs (both IPv4 and IPv6) require the next > hops to be represented as integer indexes. Reading the code, I noticed > that they are stored as uint64_t with the MSB used for internal purposes. I believe you are asking about FIB, not RIB. In current FIB implementation 1 LSB is used for internal purposes. > > This require either having a contiguous array of nexthop objects and > choose an index in that array, As far as I know that's what most of "l3 forward" applications (aka routers) are doing, if they are interested in performance. Not only DPDK powered. > or store pointer offsets as nexthop indexes and do pointer arithmetics > to reconstruct the real pointers. Both are not very practical and/or > hacky. > > Would it be possible to store arbitrary pointers? That would mean > moving that 64th bit information elsewhere. For arbitrary pointer - no, since it needs to store 1 more bit for internal purpose. However, if you have 2 byte aligned pointer you can store the pointer shifted right by 1 bit, and after lookup just shift the result back. > > I'd love to hear what you think on the matter. > > Cheers, > Robin > -- Regards, Vladimir