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 7F6B443CB2; Tue, 19 Mar 2024 21:38:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 402AD400D7; Tue, 19 Mar 2024 21:38:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3BCE340ED2 for ; Tue, 19 Mar 2024 21:38:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710880717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c6tyY9DVklnulPh8KzAYcZpuP6+piI4EjzYd1ATwDTM=; b=JyhU/ALAsrcaJbSz+Nkw3GgaBVlGuQphEvXvdd0Ul3izHOZcNNKTm2T4/OCyX9PlIkrT3E I0lwhW3/VjdORWXX4jg3dtKy6Odmjcoylq9TPgp5QdvJPrBL38UvTdXQr7BGgVbfsYkXUx NdDUK/PA/22JTC4uVmP4P1rCRwdU/2c= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-37-VpXYrGqkPtero-Z3rRwvEg-1; Tue, 19 Mar 2024 16:38:36 -0400 X-MC-Unique: VpXYrGqkPtero-Z3rRwvEg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-41403d4de74so25007865e9.1 for ; Tue, 19 Mar 2024 13:38:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710880715; x=1711485515; h=in-reply-to:references:user-agent:to:from:cc:subject:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=c6tyY9DVklnulPh8KzAYcZpuP6+piI4EjzYd1ATwDTM=; b=QJNgVTkE/ZMTFykb7MH6N4Big4HVTQjw6IY6K30hwWzzrU2tH9DJj4ujAuS9RSLmOG tGRzkaOxFDH3EaKw8HpH8pY5o3E+eWtUjKCa+dRHA37slw62x0OWXJKV6/h4xda3l3Q9 d8sEnpgImTdVl+LpUiU7kFNFAOyytno2pVxVYvXTdVubaR+U1okabqNbUhaKVFygoPbT /hFUxPtzAJI/X0LyuFGSCFNlucNmpnYMCyqPOmdKlNbdS/y02d6T7yv5Jr7t1EeW4X9R 0TT2vPfm86Pq9DW+I2XozMMbsB/hgUzEmiMd8SZqgle11+X85eBPIGalDeDxDuiVq78t Pqwg== X-Gm-Message-State: AOJu0Yy4rS9mwlnVstiA7ovFtyt4Y5iDht/O0xbzvltAJFwGUxoftpbd qitn22pecDLsnMK6HFM34jFX8GPiEsRNzbhAt2BYx6ninA3odMZ1v3XEEEOq+HLzG6PaVzsCJg0 H+NVslcpvLIT1Ky89ghBKu0QfJOnk2QFiIsoktqVD X-Received: by 2002:a05:600c:4587:b0:413:812:ce7b with SMTP id r7-20020a05600c458700b004130812ce7bmr3099956wmo.24.1710880715170; Tue, 19 Mar 2024 13:38:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8YmNfKEiIEsbzss7ddkdhPmPC1DUixADucJacVJAr97xoG9JcHzPZhhkJiD8FW1EDMeekLQ== X-Received: by 2002:a05:600c:4587:b0:413:812:ce7b with SMTP id r7-20020a05600c458700b004130812ce7bmr3099946wmo.24.1710880714709; Tue, 19 Mar 2024 13:38:34 -0700 (PDT) Received: from localhost (2a01cb000f8b9700ffd8872f0c4ad9d4.ipv6.abo.wanadoo.fr. [2a01:cb00:f8b:9700:ffd8:872f:c4a:d9d4]) by smtp.gmail.com with ESMTPSA id f19-20020a05600c155300b00414105c4cd9sm7748244wmg.21.2024.03.19.13.38.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Mar 2024 13:38:34 -0700 (PDT) Mime-Version: 1.0 Date: Tue, 19 Mar 2024 21:38:33 +0100 Message-Id: Subject: Re: fib{,6}: questions and proposals Cc: , "Bruce Richardson" From: "Robin Jarry" To: "Medvedkin, Vladimir" User-Agent: aerc/0.17.0-81-gd2764918eb55 References: In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 Vladimir, Medvedkin, Vladimir, Mar 19, 2024 at 18:16: > > 2) Is it OK/safe to modify a fib from a control thread (read/write)=20 > > while it is used by data path threads (read only)? > > This part is a bit more complicated. In practice, I would say yes,=20 > however, there is a possibility that if the lookup thread is preempted=20 > in the middle of the lookup process, and at the same time the control=20 > thread deletes the corresponding route, then the lookup result may=20 > return outdated data. This problem is solved in LPM with RCU enabled.=20 > I have plans to implement it in the near future in the FIB. OK that's good to know, thanks. > > 3) There is no public API to list/walk all configured routes in=20 > > a fib. Would that be possible/easy to implement? > > Yes, it already there. FIB under the hood uses rte_rib to hold=20 > existing routes. So walking through can be implemented like: I had tried it and got confusing results out of this. This must have=20 been before I had realized that all addresses needed to be in host=20 order... I tried again and it works as advertised with a small missing detail:=20 after configuring a default route, e.g.: rte_fib_add(fib, RTE_IPV4(2, 2, 0, 0), 16, RTE_IPV4(1, 2, 3, 4)); rte_fib_add(fib, RTE_IPV4(3, 3, 3, 0), 24, RTE_IPV4(4, 3, 2, 1)); rte_fib_add(fib, RTE_IPV4(0, 0, 0, 0), 0, RTE_IPV4(9, 9, 9, 9)); It is not returned by rte_rib_get_nxt() successive calls. I only see the=20 other two routes: 2.2.0.0/16 via 1.2.3.4 3.3.3.0/24 via 4.3.2.1 Is this expected? > > 4) In rte_fib, every IPv4 address (route *and* next hop) needs to be=20 > > in host order. This is not consistent with fib6 where addresses=20 > > are stored in network order. It took me quite a while to figure=20 > > out what was wrong with my code.=20 > > This API behavior was created in such a way that it is the same as=20 > LPM. > > As for LPM, I think it was done this way for performance reasons=20 > because in some scenarios you only working with the host order ipv4=20 > addresses. This should really be advertised in strong capital letters in the API=20 docs. Or (preferably) hidden to the user. I don't see any valid scenario=20 where you would work with host order IPv4 addresses. Do you think we could change that API or at least add a flag at FIB/RIB=20 creation to make it transparent to the user and consistent between IPv4=20 and IPv6? Thanks!