All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <rjarry@redhat.com>, <mb@smartsharesystems.com>,
	<maxime@leroys.fr>, <konstantin.ananyev@huawei.com>
Subject: Re: [RFC PATCH v2 0/7] VRF support in FIB library
Date: Thu, 15 Oct 2026 15:17:31 +0100	[thread overview]
Message-ID: <c9df7898-78ca-4dc6-a19d-23c120aee2b5@intel.com> (raw)
In-Reply-To: <20261014155540.33820187@phoenix.local>

Hi Stephen,

On 10/14/2026 11:55 PM, Stephen Hemminger wrote:
> On Wed, 14 Oct 2026 18:39:14 +0000
> Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:
>
>> This series adds multi-VRF support to the IPv4 FIB, allowing a single FIB
>> instance to host multiple isolated routing tables.
>>
>> Today a FIB instance is a single routing table, so an application serving
>> several VRFs needs one FIB per VRF. In a burst oriented datapath packets of
>> one burst can belong to different VRFs, and the application either does
>> per-packet lookups in different FIBs or regroups the burst by VRF before
>> the lookup. Both are expensive. With this series all the VRFs live in one
>> FIB, the bulk lookup takes a VRF ID per address, and the existing API
>> operates on VRF 0.
>>
>> v1 replicated the 16M entry tbl24 per VRF. That kept the lookup on par with
>> the single VRF case, but memory grew linearly with the number of VRFs,
>> which was the main concern raised on v1. v2 resolves the issue by adding
>> of two dataplane algorithms with different memory/lookup trade-offs.
>>
>> DIR8-16-8 is a new three level variant of DIR-24-8 with 8, 16 and 8 bit
>> strides. Only the 256 entry root table (2 KB) is replicated per VRF; the
>> tbl16 and tbl8 groups come from pools shared by all the VRFs, so memory
>> follows the routes actually installed rather than the number of VRFs. The
>> cost is an extra memory access for prefixes longer than /8.
>>
>> DIR-24-8 gets multi-VRF support by resolving the VRF after the longest
>> prefix match, along the lines Konstantin suggested on v1. Instead of a
>> vector of next hops per prefix, a single tbl24_8 shared by all the VRFs
>> returns an internal prefix ID, and a hash table keyed by {VRF, prefix ID}
>> returns the next hop, a miss meaning the VRF default next hop. The aim is
>> to resolve the VRF with a single memory access, so buckets hold 8 records
>> and there is no probing beyond the bucket.
>
> The problem with existing FIB lookups is they are space intensive.
comparing to what?
> They tradeoff memory for cache misses. Every level of indirection adds
> another cache miss.
This is not always a case. Also that's why we are using prefetching.
>
> Not sure they work well for VRF case at all.
I suspect this objection is applied for v1? v2 should resolve the issue
>   Normal LPM is more compact.
  more compact compared to what? Under "Normal LPM" I assume rte_lpm 
library, if so, then comparing to existing FIB, which uses DIR24_8 with 
4 byte nexthops (apples to apples), the memory footprint is exactly the 
same.
> For normal mortal size machines having multiple VRF's is going to be huge.
> How big are you envisioning this?

 From my experience when I was working as a network engineer in network 
operators, an average PE router could have 2 big VRFs (about 800k 
prefixes for v4) and thousands small VRFs with about hundreds prefixes each.

With this input an average size of a dataplane struct with:

DIR8_16_8 could be around 2Kb*1000 (VRFs) + 2*256*64k*8b(TBL16 for 2 
VRFs with full view) + 1000*4*64k*8b(small VRFs needs around 4 TBL16 - 3 
for RFC1918 + 1 customer public net) + 1000*100(prefixes more specific 
than /24, off the top of my head)*256*8b. This corresponds to TBL0: 2Mb, 
TBL16: ~2.5Gb, TBL8:~200Mb, so under 3Gb of RAM.

DIR24_8: single DIR24_8 with joint prefixes for all VRFs and 4b entries 
- 64mb for TBL24 + a few Mb for TBL8 (since all prefixes are joint) + 
hash table of size from 8Mb to 1Gb.

This sounds like mortal machine RAM usage to me.

-- 
Regards,
Vladimir


  reply	other threads:[~2026-10-15 14:17 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-22 15:42 [RFC PATCH 0/4] VRF support in FIB library Vladimir Medvedkin
2026-03-22 15:42 ` [RFC PATCH 1/4] fib: add multi-VRF support Vladimir Medvedkin
2026-03-23 15:48   ` Konstantin Ananyev
2026-03-23 19:06     ` Medvedkin, Vladimir
2026-03-23 22:22       ` Konstantin Ananyev
2026-03-25 14:09         ` Medvedkin, Vladimir
2026-03-26 10:13           ` Konstantin Ananyev
2026-03-27 18:32             ` Medvedkin, Vladimir
2026-03-22 15:42 ` [RFC PATCH 2/4] fib: add VRF functional and unit tests Vladimir Medvedkin
2026-03-22 16:40   ` Stephen Hemminger
2026-03-22 16:41   ` Stephen Hemminger
2026-03-22 15:42 ` [RFC PATCH 3/4] fib6: add multi-VRF support Vladimir Medvedkin
2026-03-22 15:42 ` [RFC PATCH 4/4] fib6: add VRF functional and unit tests Vladimir Medvedkin
2026-03-22 16:45   ` Stephen Hemminger
2026-03-22 16:43 ` [RFC PATCH 0/4] VRF support in FIB library Stephen Hemminger
2026-03-23  9:01   ` Morten Brørup
2026-03-23 11:32     ` Medvedkin, Vladimir
2026-03-23 11:16   ` Medvedkin, Vladimir
2026-03-23  9:54 ` Robin Jarry
2026-03-23 11:34   ` Medvedkin, Vladimir
2026-03-23 11:27 ` Maxime Leroy
2026-03-23 12:49   ` Medvedkin, Vladimir
2026-03-23 14:53     ` Maxime Leroy
2026-03-23 15:08       ` Robin Jarry
2026-03-23 15:27         ` Morten Brørup
2026-03-23 18:52           ` Medvedkin, Vladimir
2026-03-23 18:42       ` Medvedkin, Vladimir
2026-03-24  9:19         ` Maxime Leroy
2026-03-25 15:56           ` Medvedkin, Vladimir
2026-03-25 21:43             ` Maxime Leroy
2026-03-27 18:27               ` Medvedkin, Vladimir
2026-04-02 16:51                 ` Maxime Leroy
2026-03-23 19:05 ` Stephen Hemminger
2026-10-14 18:39 ` [RFC PATCH v2 0/7] " Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 1/7] fib: fix return value of a nexthop update Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 2/7] app/test-fib: fix lookup of the last burst Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 3/7] app/test-fib: fix size of the tables for large counts Vladimir Medvedkin
2026-10-14 22:52     ` Stephen Hemminger
2026-10-15 14:21       ` Medvedkin, Vladimir
2026-10-14 18:39   ` [RFC PATCH v2 4/7] fib: add DIR8-16-8 algorithm Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 5/7] fib: add multi-VRF support Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 6/7] fib: split DIR24-8 table update from the FIB wrapper Vladimir Medvedkin
2026-10-14 18:39   ` [RFC PATCH v2 7/7] fib: add hash based VRF support for DIR24-8 Vladimir Medvedkin
2026-10-14 22:55   ` [RFC PATCH v2 0/7] VRF support in FIB library Stephen Hemminger
2026-10-15 14:17     ` Medvedkin, Vladimir [this message]
2026-10-16 22:54   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c9df7898-78ca-4dc6-a19d-23c120aee2b5@intel.com \
    --to=vladimir.medvedkin@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@huawei.com \
    --cc=maxime@leroys.fr \
    --cc=mb@smartsharesystems.com \
    --cc=rjarry@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.