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 22C0F43CEC; Tue, 19 Mar 2024 18:16:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14B88402D5; Tue, 19 Mar 2024 18:16:33 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mails.dpdk.org (Postfix) with ESMTP id 716F040298 for ; Tue, 19 Mar 2024 18:16:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710868592; x=1742404592; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=NJ8LG/h4mQkZovIN+bY6sUN1IuPQuu5bvY0ZxaEyKc8=; b=QNrBtsscWmR4O7eW+EVJBCEZRbs7JG592QjrertimCc0bRwnzEmTuI2m y/bjS527umI+9FAqe3jEWJpp/93EgsMlQQ7OmuBKpNNBi0MbZ5MDK6IHb be3VRvYFH6o3m4tLjiQrfyDZWfLzZpMY31dp+BekCH5diUWqxaHArA0CH 5DHMabCfFkkw2MDgKDcdr7LKluhRkD9c302/t9wUtJJflnHRrLlXrGfxp qG7/+fAIOye5bujI7jH8IjgtCCtA+oc2UOdkmqGWyNVNQUMEUGzJhtegL R3VRFCxOnQF1ZgprIfIN790YTCGY4rmJE0PNka/FiejHLU1Z4W21Kxig5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11018"; a="16305096" X-IronPort-AV: E=Sophos;i="6.07,137,1708416000"; d="scan'208";a="16305096" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 10:16:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,137,1708416000"; d="scan'208";a="13863952" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Mar 2024 10:16:25 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) 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.2507.35; Tue, 19 Mar 2024 10:16:23 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2507.35 via Frontend Transport; Tue, 19 Mar 2024 10:16:23 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.40) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 19 Mar 2024 10:16:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=em5+hBUtDNOAvlf3XLtR9OxJ/LpNcF5P/5mxi7+Ec+NPrV+zYxz86o75V+HZ9vgEhZpNHt+eRihX1lx9WpQtqkTZMZe6JqxwFQpk59OPwbZsqE60YWqjpgJMFlvsOk3cYwi15GJ34qwmwdbXEn5ahuvFDUzJ5ia9f+rJAFB0M6UDhGYZ+kn358fZ4N55OEW9eAp5xYdDtXeDs5mtfBRH7QOSuXcqLhccZhLikU70DTLFMU5FhVPzbqmY5DatkuXlzVPhfiWw19ptO10BOpMDIEuyUD9dAyrhHFM3xn4GypiHz/F6QBITvMMkQsT6rcIVKIsuHf9Xx78vgHcPUgFWag== 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=6ghBM8HaBrtFtKyV/2sySHe9+zzmpvTT8W7KoCn6jVQ=; b=ElGR020ytrRPsbetHxew3G1rVGu1fbl/0lUw0qfQExUXmLr5G0u76ySFqEuUivmdUB8X73KeTN6cX3zbZX7n83CliJ5/Z9z2Eap6oyT53OcqlrN+Iq9B/KFSdVfDJRBS3yDxSE2r85fXhtz/8+12IPqIkiQ50sIVIW0+m/anY3deeMSHdW/E0dCetYxhE2q3csx6Z6LpyJYJ/fM0A9Vk6JEZbpe5hn/t5EIpivcs6KNsCxiXjtOTYxJXflVkUPTX/0lPw0HIRFatD0QEKqSXZfDZgYxqqwdaBJVW6P6NUPYfBvpHcU/Fur8cKNfBR763GApqNdrCAIpKJa1RtN+d/g== 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 DS0PR11MB7262.namprd11.prod.outlook.com (2603:10b6:8:13c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.11; Tue, 19 Mar 2024 17:16:21 +0000 Received: from SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5344:9a0c:2f3d:98c8]) by SJ0PR11MB5772.namprd11.prod.outlook.com ([fe80::5344:9a0c:2f3d:98c8%6]) with mapi id 15.20.7409.010; Tue, 19 Mar 2024 17:16:21 +0000 Message-ID: Date: Tue, 19 Mar 2024 17:16:16 +0000 User-Agent: Mozilla Thunderbird Subject: Re: fib{,6}: questions and proposals To: Robin Jarry CC: , 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: 8bit X-ClientProxiedBy: DB3PR08CA0012.eurprd08.prod.outlook.com (2603:10a6:8::25) To SJ0PR11MB5772.namprd11.prod.outlook.com (2603:10b6:a03:422::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR11MB5772:EE_|DS0PR11MB7262:EE_ X-MS-Office365-Filtering-Correlation-Id: 6305d7fa-29c2-40f9-c78d-08dc48384c08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aQIWnNfLq3JmxOhj1poPCypAAeiH1xuQME9wIcVA2XQWfeNY1vEWTHGNGyiE1sqq72VWZ6DmiYh15esC46FieJq2cCSP+syd/343n10qYinZplbrfYRtWOoLsx7GQM3zqAbaYXLK8f+Rg4wE9/J2SI0ccGjvJSSlETqQR7CHao1QmPIsdeM7cTFIbFTKq1Jd3v+yLY0lPQR3LzR5y925hPZ9oe9ovhODzkKpXx6F/hqTLB9B39QpyTYEtUD8v5tCTTqKHpRKPk9E0J26RD9nzBhdwLcyS0PRoMgeJWDxGxtgb5t3amv6rcNLKts27mdupmmR8xdC6952HkrJ/kOUf60gagdtxZ5bMzBz+/7hVnV9wA0R3H/XPZf5rdDOSL/qK4VBR9W7HFhfzB2f6OM4Eoa63yPPcBTTTkQ7wy1x856pn29rXE9P20nEpEe6UlrevxwJZRuTksjJERgIbdaFU+x0/PiA006mPEtO1ZZD0LovmG7ujroOkPP9cdQe1VUa2IBG3z+zZd4atBX2824xt4m4QHWp0XI1TSoC9hR87atvGqYWvDeASF4BdohmK4dBZTH6Ev9WjAFrXIU/ukVR/nlhIp25hMQpJAJmUApmO83dv+y88YzMbMfzB7M7pZC+pHBOeUrCskmngNlLT6tKApbXPPwUANXyELQwmtjrlkyPBBURsStq6yu2qFiwxFXpDa02jtotaJXvdbIG8DhpxQ== 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:(13230031)(1800799015)(366007)(376005)(3613699003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M01HbFZvemYzRkFPaFVRZ0kvZE5XNmpqR04reGdySlB6QkxXZ25lNGh5TE5z?= =?utf-8?B?NkN6TDNSdFV0aGd5UUUyaWgyRGQrN21kbmF1TGxRSmpBcjBSMEhoTDlDQTh6?= =?utf-8?B?M3l3NktRa2VjYlNvaklHekhSRzhXTUNiRVBMbm5mRzVKUjRRUGltQ2Y1Nko1?= =?utf-8?B?bCtyeGMrUVJVTlZjNnhPVGJGK2ZNNmwrWTJRaURBZUw3REY5Yk1RNVdtZGtV?= =?utf-8?B?enpkcmpTMjFZSFNRT3dRZGg2Sy9iQnF4T1BBeGVsRkJ2YXk4UG9WVVVabXAw?= =?utf-8?B?bnpsM2JkZ3dFY3N4VE0vRktMRXhKRWZOL3F2SWFMS0RYYTJjcFk2WlJEZGRQ?= =?utf-8?B?eld4MlZjVXd1MXB2dFBURllkZXE5b2R4VGQrdHYvbm1LeTlhaHZlMUNGaVlo?= =?utf-8?B?ODltem1MaG9SZ0h0ckJxbGVkbDNaZHJBSlhLVEYwVXBGS2lNeEJQZTVmK3Bo?= =?utf-8?B?Y3ZrMVZ3RXNtbS83TlIyaHNLbjdER0dRb01HaUx1VUV1QW1qRVp6TUh1SUlo?= =?utf-8?B?MGZxWkUvb0NTUGN1VjdFWk1qZ2hyUURYUHdkTlcyNTJaUVRqL0plODRIdjFj?= =?utf-8?B?K0lJV1pzODgzQyt2eFpVNHU5dEJUUHR1TFhZQUo1M2dMV2xSWEQycXQ3VGdh?= =?utf-8?B?cE42a2dIbXJMSEV0ZzJiU0E0MHpOcmJ4RXdET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C9yRTh0YlNLbzBjRUVsWlo2c1kz?= =?utf-8?B?R09iOVd1bWRQZ01TWmMvcVFJU0VjZFc3bHdHbEVHaUt2bHBNYUJzUHQyQzlL?= =?utf-8?B?VTZTeHprRGN6UmRDTytDTzI3anQ1clNFeGl6ZkpFZEQ5ZEFXTU5KMStMaUEx?= =?utf-8?B?STRqNmQxWGpjbmNPL3I4MjVWWEJ2dHU0THBuN01IWFVQZkpTWExFc2plcVZl?= =?utf-8?B?ZVQ3NmVzbUpJREVacWY3VmRuQXpjYWxYNmdZLzVCYnVYL3ltNjJBVGZuWHQ0?= =?utf-8?B?Vy9KQ0RSQUZKTmFMc1B4NlhNYU1KS0VveEVUakw5bXYwTDdqSVN2c1d3aXZF?= =?utf-8?B?aXQ4cjFpRzNJTkI4NGl2elgrMjBBNlE2TmtGSlNVTmFRRE5pMDdvUTBSVnkv?= =?utf-8?B?N0dyQ3BUSlc2WUtvTm80dEVCM1FMT1gvVk5ORzNxWG9VRVdQdlYyK1M1UHYr?= =?utf-8?B?T2JRbTJxaCtXY3c4Nm0zcVFjK0EwZ0ZmZ0Z3U25VTjBJUkF0QnlLcEJ3NGlI?= =?utf-8?B?TmtYT2xiQ0lXN0p4UndqNm8rZjBuMngwcTlSczdkSDZoNCtFVUVRejlHdDd3?= =?utf-8?B?WEE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6305d7fa-29c2-40f9-c78d-08dc48384c08 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5772.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 17:16:21.3653 (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: anooX+3sgG5pQZ6cLJwXZTz0yLGhHjeUI9psTmJEaH4g5iuCLouzZ30/UNY0JDybutHg4lEucdOp90qmt/W/9lJACF3Al6XYWbiIm+q0SKk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7262 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 19/03/2024 08:30, Robin Jarry wrote: > Hi Vladimir, > > I have been using rte_fib for a while and stumbled upon a few quirks. > I was wondering if you would answer some questions: > > 1) Is it OK/safe to share the same fib to perform route lookups from   > multiple lcores in parallel? So far my observations seem to validate   > that assumption but I would like your opinion :) Yes, 100% :) > > 2) Is it OK/safe to modify a fib from a control thread (read/write)   > while it is used by data path threads (read only)? This part is a bit more complicated. In practice, I would say yes, however, there is a possibility that if the lookup thread is preempted in the middle of the lookup process, and at the same time the control thread deletes the corresponding route, then the lookup result may return outdated data. This problem is solved in LPM with RCU enabled. I have plans to implement it in the near future in the FIB. > > 3) There is no public API to list/walk all configured routes in a fib. >   Would that be possible/easy to implement? Yes, it already there. FIB under the hood uses rte_rib to hold existing routes. So walking through can be implemented like: struct rte_fib fib; .... struct rte_rib rib = rte_fib_get_rib(fib); struct rte_rib_node *cur = NULL; do { cur = rte_rib_get_nxt(rib, RTE_IPV4(0,0,0,0) /*this is supernet where you'd like to iterate*/, 0 /*and this is depth*/, cur, RTE_RIB_GET_NXT_ALL); if (cur)     printf... } while (cur) > > 4) In rte_fib, every IPv4 address (route *and* next hop) needs to be > in   host order. This is not consistent with fib6 where addresses are >   stored in network order. It took me quite a while to figure out what >   was wrong with my code. > >   I assume this is because DIR24 needs host order integers and not   > TRIE. Why was this not hidden in the API? > >   Could we add a flag to rte_fib_conf to change the behaviour? This   > would avoid error prone ntohl/htonl juggling. This API behavior was created in such a way that it is the same as LPM. As for LPM, I think it was done this way for performance reasons because in some scenarios you only working with the host order ipv4 addresses. > > Thanks in advance for your replies :) > -- Regards, Vladimir