Page MenuHomeFreeBSD
Feed Advanced Search

Dec 23 2022

melifaro updated the diff for D37736: netlink: add snl(3) - simple netlink library.

Add a bit more accessors.
Move NETLINK_ROUTE specific helpers to a separate file.
Update the manpage.

Dec 23 2022, 2:56 PM
melifaro accepted D37784: ifnet/DrvAPI: Move if_t typedef to a better place.
Dec 23 2022, 2:05 PM
melifaro added a comment to D37784: ifnet/DrvAPI: Move if_t typedef to a better place.

Q: What blockers prevent moving the accessors outside of if_var.h?

Nothing, really. Just doing this piecemeal. I noticed in some of my conversions that keeping the if_t typedef in if_var.h necessitated pulling it in where it wasn't needed beyond getting if_t, so pulled it out. The current users of struct ifnet beyond a forward declaration already include if_var.h so there's no gain or loss there.

Got it, make sense. Do you have any tentative timeline in mind for the stage when these accessors can be moved outside if_var.h ?

I'd actually spend some time removing if_var.h header from the inside the stack as well :-)

Maybe later. Some people may have concerns about performance in the stack by using the accessors inside the stack, so save that for a later time.

SURE. I'm sorry for not being detailed enough.
Currently, if_var.h is used in ~270 files in the base (grep -RI if_var.h sys | grep -v sys/dev | wc -l). The performance argument is an absolutely valid one, but it affects ~10-15 files out of these 270.
What I meant was cleaning the remaining 200+ files. I wasn't suggesting you should do it - sorry if it read that way. That's something I have had on my list for quite some time.

Dec 23 2022, 2:05 PM

Dec 22 2022

melifaro added a comment to D37783: netlink: add netlink to GENERIC.

Netlinks is a communication protocol ...

Netlink

currently used in Linux kernel to modify, read and subscribe for nearly all networking state.

Maybe we can specify RFC 3549 first? Sure it originated in Linux, but the fact that it has an RFC gives additional credence to implementing it, and enabling it by default, IMO.

I updated the description, thank you! I hope it reads better now.

Netlink support was added in D36002.

When committing this ought to be the git hash instead of original review

Sure!

Dec 22 2022, 5:49 PM
melifaro updated the summary of D37783: netlink: add netlink to GENERIC.
Dec 22 2022, 5:48 PM
melifaro retitled D37783: netlink: add netlink to GENERIC from netlink: add to netlink to GENERIC to netlink: add netlink to GENERIC.
Dec 22 2022, 5:34 PM
melifaro added a comment to D37784: ifnet/DrvAPI: Move if_t typedef to a better place.

Q: What blockers prevent moving the accessors outside of if_var.h?
I'd actually spend some time removing if_var.h header from the inside the stack as well :-)

Dec 22 2022, 4:19 PM
melifaro accepted D37779: GEOM: Remove redundant NULL pointer check before g_free().
Dec 22 2022, 4:11 PM
melifaro retitled D37783: netlink: add netlink to GENERIC from netlink: add netlink to GENERIC to netlink: add to netlink to GENERIC.
Dec 22 2022, 4:08 PM
melifaro requested review of D37783: netlink: add netlink to GENERIC.
Dec 22 2022, 3:07 PM
melifaro updated the summary of D37781: netlink: allow netlink to be build in the kernel.
Dec 22 2022, 2:53 PM
melifaro requested review of D37781: netlink: allow netlink to be build in the kernel.
Dec 22 2022, 2:52 PM

Dec 21 2022

melifaro added a comment to D37757: WIP: Add scalable route caching framework.
  • extend struct route with the custom "update_cache" callback pointer

How does this callback work?

  • the callback task is to update the cached data in struct route in the "safe" fashion

I'm interested in the safe portion.

  • struct route_cache can start with struct route and is followed by the mutex, which can be used as the sync mechanism
  • PCB caching is generalised to this mechanism, so ip[6]_output() and ether_output() should call the callback instead of invalidating cache directly

So PCB caching employ struct route_cache rather than struct route[_in6] ?

What do you think?

Dec 21 2022, 4:28 PM
melifaro added a comment to D37757: WIP: Add scalable route caching framework.

First of all, I'd like to thank you for working on this. Caching routes/nexthops for the tunnels is a thing we should have in base and I'd really love to have it landed.
I like the part of the diff where you establish a clear KPI to register/unregister/use cached routes.

Dec 21 2022, 10:47 AM

Dec 20 2022

melifaro retitled D36529: netstat: make netstat -rn use netlink instead of rtsock from [WIP] netstat: make netstat -rn use netlink instead of rtsock to netstat: make netstat -rn use netlink instead of rtsock.
Dec 20 2022, 10:50 AM
melifaro updated the diff for D36529: netstat: make netstat -rn use netlink instead of rtsock.

Update to use the snl(3) api.

Dec 20 2022, 10:45 AM
melifaro accepted D37664: DrvAPI: Extend driver KPI with more accessors.

I apologise for the belated response.
Thank you for addressing the comments!
The only remaining thing I'd prefer to discuss a bit more is the setcaps2 thing. I'd rather prefer to move these bits to a dedicated review. It would be easier to iron out KPIs around that (I can come up with the one if you're okay with it).
The rest I'm totally fine with - and I'd love to see that landed.

Dec 20 2022, 10:36 AM

Dec 19 2022

melifaro added a comment to D37736: netlink: add snl(3) - simple netlink library.

Also: thank you for the review & feedback! It helps greatly.

Dec 19 2022, 8:45 PM
melifaro added inline comments to D37736: netlink: add snl(3) - simple netlink library.
Dec 19 2022, 8:43 PM
melifaro updated the diff for D37736: netlink: add snl(3) - simple netlink library.
  • Address comments.
  • Update snl(3) library.
Dec 19 2022, 8:43 PM

Dec 18 2022

melifaro updated the summary of D37736: netlink: add snl(3) - simple netlink library.
Dec 18 2022, 5:45 PM
melifaro added reviewers for D37736: netlink: add snl(3) - simple netlink library: network, bapt, manpages.
Dec 18 2022, 5:35 PM
melifaro requested review of D37736: netlink: add snl(3) - simple netlink library.
Dec 18 2022, 5:35 PM
melifaro accepted D37732: jail: Fix output of IPv[46] addresses of DDB `show prison`.

LGTM!
Do you think it would be possible to convert PR_IP to be static inline function, so that kind of erros are spotted by the compiler?

Dec 18 2022, 2:52 PM
melifaro accepted D37730: netlink: Use NET_EPOCH_[CALL|WAIT] macros.
Dec 18 2022, 2:44 PM
melifaro accepted D37729: routing: Use NET_EPOCH_[CALL|WAIT] macros.
Dec 18 2022, 2:43 PM

Dec 16 2022

melifaro added a comment to D37664: DrvAPI: Extend driver KPI with more accessors.

>> Some questions -

  1. When some action happens (like, a user sets the MTU), then (a) driver-specific internal structures and HW state are updated, (b) actual ifp datastructed gets updated, and (c) network-stack-specific staff is triggered (eventhandler etc).

In the current KPI most of the if_set() functions do just (b), but there are examples of functions doing all 3 items (if_setlladdr()). Any thoughts on differentiating between these two classes?

I'm mixed on this. I think it requires further thinking of how drivers and the stack interact, and how other things interact with the stack. if_setlladdr() for instance looks like it needs to be hardware and stack oriented, to keep everything in sync. Unless we make the KPI a "set" and "commit" style. Thoughts on that direction?

It certanly requires thinking. Also, there are also interaction inside the current stack that should be considered w.r.t KPI changes. Specifically, I mean the change notifications that needs to be propagated to the other parts of kernel and/or userland programs.
Set&commit may bring some benefits. I don't see any way that wouldn' add significant complexity both to the underlying implementation and the KPI users. I don't think it's worth the effort.

  1. Any thoughts on locking for setters?

Maybe for the next iteration of things? Right now just doing the naive approach to get the KPI in place and get drivers ported over.

Sure, I don't expect it to be the scope of this change - more curious abouth the thoughts on the general approach.

  1. Any plans to update ifnet(9)? :-)

Definitely need to do that. Thanks for reminding me.

That's great!

Dec 16 2022, 1:29 PM
melifaro closed D37708: netlink: connect netlink tests to the build.
Dec 16 2022, 12:04 PM
melifaro committed rG3873bdc2f28f: netlink: connect netlink tests to the build (authored by melifaro).
netlink: connect netlink tests to the build
Dec 16 2022, 12:04 PM

Dec 15 2022

melifaro added a comment to D37708: netlink: connect netlink tests to the build.
In D37708#857530, @ngie wrote:

Thank you for the review!

Hot take: the PEP8 tools used by phabricator should be updated to ignore inline type hints. It might also be a good idea to update the config to work with black’s defaults (<=88 columns).

Would be really nice, though I'm not sure where do we store the configs.

Dec 15 2022, 2:00 PM
melifaro updated the diff for D37708: netlink: connect netlink tests to the build.

address comments

Dec 15 2022, 1:58 PM
melifaro added reviewers for D37708: netlink: connect netlink tests to the build: network, tests.
Dec 15 2022, 12:40 PM
melifaro requested review of D37708: netlink: connect netlink tests to the build.
Dec 15 2022, 12:39 PM
melifaro committed rG3636a967f310: route: allow RTM_CHANGE notifications in rt_routemsg(). (authored by melifaro).
route: allow RTM_CHANGE notifications in rt_routemsg().
Dec 15 2022, 10:41 AM

Dec 14 2022

melifaro committed rG80f03e63d67e: netlink: improve interface handling (authored by melifaro).
netlink: improve interface handling
Dec 14 2022, 7:54 PM
melifaro closed D37668: netlink: improve interface handling.
Dec 14 2022, 7:53 PM
melifaro added a reviewer for D37668: netlink: improve interface handling: network.
Dec 14 2022, 7:43 PM

Dec 13 2022

melifaro added a comment to D37588: net/bird2: add netlink flavor.

I could add this patch to the upcoming new 2.0.11 bird port. This version already includes the merged sysdep/linux/netlink.c and sysdep/cf/bsd-netlink.h (only missing sysdep/bsd-netlink/Makefile).

That would be awesome!

Dec 13 2022, 2:33 PM

Dec 10 2022

melifaro added a comment to D37664: DrvAPI: Extend driver KPI with more accessors.

First of all, I fully support the ifnet KPI approach and love to see this (and the other relevant) reviews landed. Thank you for doing this!
Some questions -

  1. When some action happens (like, a user sets the MTU), then (a) driver-specific internal structures and HW state are updated, (b) actual ifp datastructed gets updated, and (c) network-stack-specific staff is triggered (eventhandler etc).

In the current KPI most of the if_set() functions do just (b), but there are examples of functions doing all 3 items (if_setlladdr()). Any thoughts on differentiating between these two classes?

  1. Any thoughts on locking for setters?
Dec 10 2022, 5:47 PM
melifaro requested review of D37668: netlink: improve interface handling.
Dec 10 2022, 4:38 PM

Dec 9 2022

melifaro added inline comments to D37400: wg: Re-add basic if_wg(4) tests..
Dec 9 2022, 7:26 PM
melifaro closed D37597: netlink: add interface notification on link status / flags change..
Dec 9 2022, 11:23 AM
melifaro committed rG1bcd230f9508: netlink: add interface notification on link status / flags change. (authored by melifaro).
netlink: add interface notification on link status / flags change.
Dec 9 2022, 11:23 AM

Dec 3 2022

melifaro updated the summary of D37597: netlink: add interface notification on link status / flags change..
Dec 3 2022, 5:26 PM
melifaro requested review of D37597: netlink: add interface notification on link status / flags change..
Dec 3 2022, 5:11 PM

Dec 2 2022

melifaro committed rG6ab87ec483e9: netlink: fix non-multipath build (authored by melifaro).
netlink: fix non-multipath build
Dec 2 2022, 10:21 PM
melifaro committed rGcc2be311772d: netlink: store user-provided rtm_protocol (authored by melifaro).
netlink: store user-provided rtm_protocol
Dec 2 2022, 8:09 PM
melifaro committed rG42f8123a4fa8: routing: provide dedicated function for nhgrp creation and linking. (authored by melifaro).
routing: provide dedicated function for nhgrp creation and linking.
Dec 2 2022, 8:09 PM

Dec 1 2022

melifaro added a reviewer for D37588: net/bird2: add netlink flavor: olivier.
Dec 1 2022, 6:02 PM
melifaro requested review of D37588: net/bird2: add netlink flavor.
Dec 1 2022, 6:01 PM
melifaro added a comment to D37574: nlsysevent: add a genetlink(4) module to report kernel events.
In D37574#854409, @bapt wrote:

Thank you for addressing the comments!
Added a couple of nitpicks that can be addressed at the commit time.

Q: what do you think of providing these notifications to each VNET? This can be addressed later, especially given the support should be implemented in the core netlink code. For now, I'm more curious about the concept.

I don't know, so far I don't see any message going through devctl_notify which should be vnet aware, but let's see how this get used in the future

Oh, sorry, let me be a bit more specific.
I'm talking about the case when a user wants to put some notification consumer to jail (for example, as a part of jail-service-by-default) with VNET. Currently, such a service won't be able to receive any notifications as it's not in the default VNET anymore.
So the questions is that if this behaviour is desired or not. If not, how should we proceed (have per-jail tunable to allow events passing etc) ?

Dec 1 2022, 2:00 PM
melifaro closed D37566: net: add if_allocdescr() to permit updating interface description from the kernel.
Dec 1 2022, 11:33 AM
melifaro committed rG984b27d879e1: net: add if_allocdescr() to permit updating iface description from the kernel (authored by melifaro).
net: add if_allocdescr() to permit updating iface description from the kernel
Dec 1 2022, 11:33 AM
melifaro accepted D37574: nlsysevent: add a genetlink(4) module to report kernel events.

Thank you for addressing the comments!
Added a couple of nitpicks that can be addressed at the commit time.

Dec 1 2022, 11:29 AM

Nov 30 2022

melifaro added a comment to D37574: nlsysevent: add a genetlink(4) module to report kernel events.

Generally LGTM!
Please see some minor comments inline.

Nov 30 2022, 6:07 PM
melifaro updated the diff for D37566: net: add if_allocdescr() to permit updating interface description from the kernel.

.

Nov 30 2022, 2:57 PM
melifaro added a comment to D37566: net: add if_allocdescr() to permit updating interface description from the kernel.
In D37566#853879, @kp wrote:

Does this abstract enough to be worth it? Where is it intended to be used?

I have a larger diff that allows netlink to update interface properties, such as description. Given we already have if_freedescr(), I moved towards the if_allocdescr() instead of exposing M_IFDESCR.

Nov 30 2022, 2:41 PM
melifaro retitled D37566: net: add if_allocdescr() to permit updating interface description from the kernel from net: add if_allocdescr() to permit updating description from the kernel to net: add if_allocdescr() to permit updating interface description from the kernel.
Nov 30 2022, 1:51 PM
melifaro updated the summary of D37566: net: add if_allocdescr() to permit updating interface description from the kernel.
Nov 30 2022, 1:50 PM
melifaro requested review of D37566: net: add if_allocdescr() to permit updating interface description from the kernel.
Nov 30 2022, 1:50 PM
melifaro committed rGf4d3aa749084: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent (authored by melifaro).
netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent
Nov 30 2022, 1:26 PM
melifaro closed D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent.
Nov 30 2022, 1:26 PM
melifaro updated the diff for D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent.

Address (most of) the comments.

Nov 30 2022, 1:23 PM
melifaro added a reviewer for D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent: manpages.
Nov 30 2022, 12:45 PM
melifaro updated the diff for D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent.

add manpage update.

Nov 30 2022, 12:45 PM
melifaro updated the summary of D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent.
Nov 30 2022, 12:35 PM
melifaro requested review of D37565: netlink: suppress sending NLMSG_ERROR if NLMSG_DONE is already sent.
Nov 30 2022, 12:34 PM

Nov 28 2022

melifaro accepted D37510: ether_demux: Defer stripping the Ethernet header..
Nov 28 2022, 8:57 AM

Nov 26 2022

melifaro accepted D37508: ipfw: Add missing 'va' code point name.
Nov 26 2022, 12:52 PM

Nov 21 2022

melifaro added a reviewer for D37436: if_lagg: Allow lagg interfaces to be used with NetMap: network.
Nov 21 2022, 3:13 PM

Nov 11 2022

melifaro accepted D37334: stand: Remove i386-only support fire firewire.
Nov 11 2022, 8:35 PM

Nov 8 2022

melifaro accepted D37308: netlink: unregister groups along with family.
Nov 8 2022, 11:35 AM

Nov 3 2022

melifaro committed rG669d63eb8506: netlink: remove private netlink_var.h header from the non-netlink core files. (authored by melifaro).
netlink: remove private netlink_var.h header from the non-netlink core files.
Nov 3 2022, 5:07 PM
melifaro committed rG4dfd380e06c5: netlink: allow more than 64 groups per netlink socket. (authored by melifaro).
netlink: allow more than 64 groups per netlink socket.
Nov 3 2022, 5:07 PM

Nov 1 2022

melifaro committed rG7366c0a49c9a: netlink: add netlink user documentation. (authored by melifaro).
netlink: add netlink user documentation.
Nov 1 2022, 5:08 PM
melifaro closed D37011: netlink: add netlink user documentation..
Nov 1 2022, 5:08 PM
melifaro added inline comments to D37011: netlink: add netlink user documentation..
Nov 1 2022, 5:04 PM
melifaro added inline comments to D37011: netlink: add netlink user documentation..
Nov 1 2022, 1:01 PM
melifaro updated the diff for D37011: netlink: add netlink user documentation..

Address the comments.

Nov 1 2022, 1:00 PM

Oct 31 2022

melifaro committed rG728ca8506dff: netlink: fix CTRL_CMD_GETFAMILY lookup/dumps. (authored by melifaro).
netlink: fix CTRL_CMD_GETFAMILY lookup/dumps.
Oct 31 2022, 5:14 PM
melifaro committed rG03de61aabb40: netlink: fix NLMSG_SPACE() macro. (authored by melifaro).
netlink: fix NLMSG_SPACE() macro.
Oct 31 2022, 3:05 PM
melifaro committed rG830352ccca23: netlink: fix genetlink CTRL_ATTR_MCAST_GRP_MAX define. (authored by melifaro).
netlink: fix genetlink CTRL_ATTR_MCAST_GRP_MAX define.
Oct 31 2022, 3:05 PM
melifaro committed rGfc47afbfafca: netlink: fix generic netlink privilege check. (authored by melifaro).
netlink: fix generic netlink privilege check.
Oct 31 2022, 1:41 PM

Oct 24 2022

melifaro accepted D36908: Split netinet shell tests into one per line..
Oct 24 2022, 7:46 PM

Oct 19 2022

melifaro accepted D36949: linprocfs(5): Add /proc/net/route.

@dchagin: want to commit it, or should I do do it?

Oct 19 2022, 7:33 PM

Oct 18 2022

melifaro added a comment to D36949: linprocfs(5): Add /proc/net/route.

Thank you for providing the updated version w/ rib_walk!
Looks good to me, please see some minor comments inline. Once addressed, it should be good to land.

Oct 18 2022, 10:22 PM

Oct 17 2022

melifaro accepted D37028: in6: Consolidate IN6_ARE_ADDR_EQUAL definitions.
Oct 17 2022, 9:45 PM
melifaro added inline comments to D36949: linprocfs(5): Add /proc/net/route.
Oct 17 2022, 8:12 PM
melifaro requested changes to D36949: linprocfs(5): Add /proc/net/route.
Oct 17 2022, 11:41 AM

Oct 16 2022

melifaro added a comment to D35881: new test: after destroying a jail, its vnet interfaces should be visible by host.

yes the sleep is racy, but I have no idea to fix it.
Without it, the test will always fails: There is a delay between the jail destruction and the interface being visible back from the host.

So I've tested a loop like this one:

while jls -dj jifdestroy >/dev/null 2>&1; do
        sleep 1
done

with a dummy script on 13.1-release like this one:

#!/bin/sh
#set -eu
ifconfig lo888 create
jail -c name=bug persist vnet vnet.interface=lo888
jexec bug ifconfig lo888 up
jail -R bug
while jls -dj bug >/dev/null 2>&1; do
        echo "wait"
        sleep 1
done
ifconfig lo888 destroy && echo "success" || echo "fails"

And it fails about 1 time on 5 runs:

 # sh -x ./yo.sh
+ ifconfig lo888 create
+ jail -c 'name=bug' persist vnet 'vnet.interface=lo888'
+ jexec bug ifconfig lo888 up
+ jail -R bug
+ jls -dj bug
+ ifconfig lo888 destroy
ifconfig: interface lo888 does not exist
+ echo fails
fails

So the only stable solution seems the racy sleep here.

Checking that vnet is not dying is the right thing - once vnet is destroyed you should get the interface back. I’d prefer to have this logic in the test instead of a random sleep.
If this fails (on current head) I can take a look in a ~week time

Oct 16 2022, 7:28 PM

Oct 15 2022

melifaro updated the summary of D37011: netlink: add netlink user documentation..
Oct 15 2022, 4:41 PM
melifaro requested review of D37011: netlink: add netlink user documentation..
Oct 15 2022, 4:38 PM

Oct 3 2022

melifaro added inline comments to D36729: netinet*: remove dead code from TCP, UDP, SCTP control input.
Oct 3 2022, 5:09 PM
melifaro accepted D36728: netinet: filter out invalid ICMP responses in ip_icmp().
Oct 3 2022, 4:50 PM

Oct 2 2022

melifaro committed rG356724fc931f: netlink: fix non-default builds (no INET, INET6, ROUTE_MPATH). (authored by melifaro).
netlink: fix non-default builds (no INET, INET6, ROUTE_MPATH).
Oct 2 2022, 1:14 PM

Oct 1 2022

melifaro committed rG03994c24da95: netlink: fix build without INVARIANTS (authored by melifaro).
netlink: fix build without INVARIANTS
Oct 1 2022, 9:22 PM
melifaro committed rG8d9f3e05728e: netlink: fix format strings on 32-bit platforms (authored by melifaro).
netlink: fix format strings on 32-bit platforms
Oct 1 2022, 9:17 PM
melifaro committed rGc90bff3fa7c1: netlink: fix debugging on 32-bit platforms (authored by melifaro).
netlink: fix debugging on 32-bit platforms
Oct 1 2022, 7:04 PM
melifaro committed rGdddafa8d25c6: netlink: make test-includes happy by hiding most of the header (authored by melifaro).
netlink: make test-includes happy by hiding most of the header
Oct 1 2022, 5:04 PM
melifaro committed rG11ca01e9aa47: netlink: add headers installation (authored by melifaro).
netlink: add headers installation
Oct 1 2022, 4:33 PM