[PATCH] Netlink on FreeBSD support

Alexander Chernikov melifaro at FreeBSD.org
Sat Dec 10 17:54:52 CET 2022



> On 9 Dec 2022, at 16:48, Ondrej Zajicek <santiago at crfreenet.org> wrote:
> 
> On Fri, Dec 02, 2022 at 09:21:17PM +0000, Alexander V. Chernikov wrote:
>>> On 2 Dec 2022, at 03:19, Ondrej Zajicek via Bird-users <bird-users at trubka.network.cz> wrote:
>>> 
>>> On Thu, Dec 01, 2022 at 01:48:16PM +0000, Alexander V. Chernikov via Bird-users wrote:
>>>> Dear bird developers,
>>>> 
>>>> Netlink support was added to FreeBSD recently [1].
>>>> It’s not as “full-featured” as its Linux counterpart yet, however the added subset is enough to make a routing daemon work.
>>>> Specifically, it supports multiple tables, multipath, nexthops and nexthops groups. No MPLS support yet.
>>>> It aims to be compatible (whenever possible) to minimise the netlink users adoption efforts.
>>>> The first FreeBSD releases to have netlink support will be 14.0 and 13.2. Both are planned to be released in ~Q1 2023.
>>>> 
>>>> The attached change adds 'bsd-netlink’ sysconf target, allowing to build both netlink & rtsock versions on FreeBSD.
> 
> Hi
> 
> Merged:
> https://gitlab.nic.cz/labs/bird/-/commit/a80cd4707464cedb526eb72e7704b097af20beb7
Thank you!
> 
> 
>> In FreeBSD, the default routing table is #0 and there are no special 25X tables.
>> Some attributes (like RTA_PREFSRC) are not supported. Interface address flags are not fully mapped yet & there might be some unsupported stuff w.r.t IPv6 prefixes lifetime.
>> “Prohibit” nexthops are not supported yet (as the kernel only provides blackhole / reject ATM).
>> Resilient nexthop groups are not supported yet as well.
>> 
>> I may be missing something, but I’m pretty sure that the implementation is close to supporting all of the current bird features (except mpls).
>> 
>>> Like Linux keep (and Netlink API assumes) multiple routes with different
>>> metric, and keeps source protocol.
>> Yes, metrics & source protocol works.
> 
> Does source protocol also works with the native API (krt socket)?
No. The data is in the kernel but there are no properties in the protocol to propagate it. There are some spare fields in the rt_metrics structure that can be used for that purpose, but I’d prefer not to extend rtsock anymore.
Additionally, there is no such feature in OpenBSD / NetBSD. 
> 
> 
>> Also, speaking of features - FreeBSD netlink implementation is optimised for batching & there is significant performance difference between batched-and non-batched.
>> Specifically, current bird code does ~80k routes/sec w/o netlink batching, ~180k routes/sec w/ rtsock and ~240k routes/sec w/ netlink batching (sz=16) on the same system.
>> Would you be open to adopting a not-too-invasive netlink batching patch enabled conditionally under CONFIG_NETLINK_BATCHING ?
> 
> That seems like a good idea.
Ack. Will send a patch them (probably, somewhere next week).
> 
> -- 
> Elen sila lumenn' omentielvo
> 
> Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org <mailto:santiago at crfreenet.org>)
> OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net <http://wwwkeys.pgp.net/>)
> "To err is human -- to blame it on a computer is even more so."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20221210/c5aa88a1/attachment.htm>


More information about the Bird-users mailing list