Page MenuHomeFreeBSD
Feed Advanced Search

Jun 13 2023

melifaro closed D40438: ifconfig: remove global 'name' variable..
Jun 13 2023, 6:28 AM
melifaro committed rGc6f0602f2349: ifconfig: pass if_ctx instead of socket to the tunnel handlers. (authored by melifaro).
ifconfig: pass if_ctx instead of socket to the tunnel handlers.
Jun 13 2023, 6:28 AM
melifaro closed D40432: ifconfig: pass if_ctx instead of socket to the tunnel handlers..
Jun 13 2023, 6:28 AM
melifaro committed rG4106282ec41d: ifconfig: remove global 'printifname' variable. (authored by melifaro).
ifconfig: remove global 'printifname' variable.
Jun 13 2023, 6:28 AM
melifaro closed D40431: ifconfig: renove global printifname variable..
Jun 13 2023, 6:28 AM
melifaro committed rGc6885dbda739: ifconfig: eliminate global 'verbose' and 'printkey' variables (authored by melifaro).
ifconfig: eliminate global 'verbose' and 'printkey' variables
Jun 13 2023, 6:28 AM
melifaro closed D40427: ifconfig: eliminate global 'verbose' variable.
Jun 13 2023, 6:27 AM
melifaro closed D40426: ifconfig: add if_ctx argument to the generic and ifclone callbacks..
Jun 13 2023, 6:27 AM
melifaro committed rG74b426116181: ifconfig: add if_ctx argument to the generic and ifclone callbacks. (authored by melifaro).
ifconfig: add if_ctx argument to the generic and ifclone callbacks.
Jun 13 2023, 6:27 AM
melifaro committed rGab4d1b73cbf8: route(8): teach route to attach to jails (authored by nyan_myuji.xyz).
route(8): teach route to attach to jails
Jun 13 2023, 6:08 AM
melifaro closed D40377: Teach route(8) to run in jails.
Jun 13 2023, 6:08 AM · Jails
melifaro committed rG0eb0d2333546: ktest: make ktest work with Netlink loaded as a module. (authored by melifaro).
ktest: make ktest work with Netlink loaded as a module.
Jun 13 2023, 6:05 AM

Jun 11 2023

melifaro updated the diff for D40488: ipfw(8): add ioctl/instruction generation tests.

Fix keep_state test.

Jun 11 2023, 10:17 PM
melifaro updated the summary of D40490: ipfw: simplify action case parser.
Jun 11 2023, 10:17 PM
melifaro updated the test plan for D40488: ipfw(8): add ioctl/instruction generation tests.
Jun 11 2023, 10:17 PM
melifaro requested review of D40490: ipfw: simplify action case parser.
Jun 11 2023, 10:17 PM
melifaro added a reviewer for D40488: ipfw(8): add ioctl/instruction generation tests: tests.
Jun 11 2023, 10:17 PM
melifaro updated the summary of D40488: ipfw(8): add ioctl/instruction generation tests.
Jun 11 2023, 10:17 PM
melifaro requested review of D40488: ipfw(8): add ioctl/instruction generation tests.
Jun 11 2023, 10:17 PM

Jun 8 2023

melifaro added inline comments to D40317: carp: add a 'SUPPRESS' state.
Jun 8 2023, 2:09 PM

Jun 7 2023

melifaro accepted D40445: ndp: Prepare for pending tcpdump update.
Jun 7 2023, 4:36 PM

Jun 6 2023

melifaro requested review of D40441: ifconfig: remove 'newaddr' global variable.
Jun 6 2023, 1:44 PM
melifaro requested review of D40440: ifconfig: start ifconfig context from main().
Jun 6 2023, 1:41 PM
melifaro added a reviewer for D40439: ifconfig: remove global_args: network.
Jun 6 2023, 1:04 PM
melifaro requested review of D40439: ifconfig: remove global_args.
Jun 6 2023, 1:03 PM
melifaro updated the diff for D40438: ifconfig: remove global 'name' variable..

remove 'extern name[]'

Jun 6 2023, 1:02 PM
melifaro updated the diff for D40438: ifconfig: remove global 'name' variable..

Fix build w/o Netlink.

Jun 6 2023, 12:55 PM
melifaro added reviewers for D40438: ifconfig: remove global 'name' variable.: network, kp, bz.
Jun 6 2023, 12:51 PM
melifaro added reviewers for D40432: ifconfig: pass if_ctx instead of socket to the tunnel handlers.: network, kp.
Jun 6 2023, 12:51 PM
melifaro added reviewers for D40431: ifconfig: renove global printifname variable.: network, kp.
Jun 6 2023, 12:50 PM
melifaro requested review of D40438: ifconfig: remove global 'name' variable..
Jun 6 2023, 12:49 PM
melifaro requested review of D40432: ifconfig: pass if_ctx instead of socket to the tunnel handlers..
Jun 6 2023, 8:15 AM
melifaro requested review of D40431: ifconfig: renove global printifname variable..
Jun 6 2023, 7:37 AM

Jun 5 2023

melifaro updated the diff for D40427: ifconfig: eliminate global 'verbose' variable.

.

Jun 5 2023, 9:19 PM
melifaro added reviewers for D40427: ifconfig: eliminate global 'verbose' variable: network, bz.
Jun 5 2023, 9:13 PM
melifaro requested review of D40427: ifconfig: eliminate global 'verbose' variable.
Jun 5 2023, 9:12 PM
melifaro updated the summary of D40426: ifconfig: add if_ctx argument to the generic and ifclone callbacks..
Jun 5 2023, 8:35 PM
melifaro requested review of D40426: ifconfig: add if_ctx argument to the generic and ifclone callbacks..
Jun 5 2023, 8:29 PM
melifaro added a comment to D40301: ifconfig: fix comparison in printmimo().

Also reported in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269075

Jun 5 2023, 10:36 AM

Jun 2 2023

melifaro added a comment to D40317: carp: add a 'SUPPRESS' state.

In other words: this patch cannot go in as-is (or at least not until the IFF_UP issues are addressed).

I ran into that when using netlink to configure interfaces. I guess we need to issue an eventhandler contification if some of interface flags were changed. I’ll take a look at that

I've raised D40332 to address lack of notifications to carp and the rest of the system.

This one got committed.

Jun 2 2023, 4:50 PM
melifaro added a comment to D39865: cxgbe: use new cloners KPI..
In D39865#909198, @np wrote:

Almost there. Now the new ifnet is created successfully but there is an extra 0 in its name. The ifnet should have been t6nex0 and not t6nex00.

Are you sure it's t6nex0 without this change? Could you share what's the if_dunit value of this interface?
I'm struggling to understand the code path here :-(

# ifconfig t6nex0 create                                                             
t6nex00 
# ifconfig t6nex00
t6nex00: flags=840<RUNNING,SIMPLEX> metric 0 mtu 1500
       ether 00:00:00:00:00:00
       groups: tXnex
       media: Ethernet none <full-duplex>
       status: active
       nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Jun 2 2023, 2:34 PM
melifaro added a comment to D39614: ifnet: fix use-after-free by ignoring post-detach ifp link events..
In D39614#907626, @kp wrote:
In D39614#902547, @kp wrote:

The fix to this particular issue depends on the answers of the above (or can be a bandaid as in diff if we want to kick the can down the road).

Those are all good questions, but I think in this case our issue is that the ifnet goes away between the task being enqueued and executed. There are a number of other places where we see things like that, and that's the 'general problem' I was referring to.

Ack! I was looking into it from a different angle. The mental model of "safe detach" to me is a) set the demarcation point that signals "no more data accepted", b) ensure no data is indeed accepted and c) clear the queued data. I'm a bit unsure if we can or should generalise the implementations for the different datapaths and control plane. The current code mostly have everything implemented - IFF_DYING flag is set, marking the end of the era and the taskq is cleaned from the link tasks matching this interface. The remaining part is rejecting new changes.

We can indeed do an MPASS() check in the enqueue code to reject such code patterns if that's what we agree with.

What do you folks think?

So that seems like a sane general approach, but I'm not clear on how it'd work here. We'd have to make sure the ifp sticks around until the task queue no longer has any if_linktasks remaining, and I don't think we have a mechanism for that currently.

I think we have something in if.c:if_detach_internal() for that ( https://cgit.freebsd.org/src/tree/sys/net/if.c#n1145 ):

Jun 2 2023, 1:28 PM
melifaro committed rGc1839039b193: netlink: use netlink mbufs in the mbuf chains. (authored by melifaro).
netlink: use netlink mbufs in the mbuf chains.
Jun 2 2023, 1:20 PM
melifaro closed D40368: netlink: use netlink mbufs in the mbuf chains..
Jun 2 2023, 1:19 PM
melifaro added inline comments to D40331: netlink: dump interface capabilities with other interface data.
Jun 2 2023, 12:54 PM
melifaro updated the diff for D40331: netlink: dump interface capabilities with other interface data.

Address comments.

Jun 2 2023, 12:50 PM
melifaro added a comment to D40380: Modularize some IPv4/IPv6 protocol code.

I love the part of this diff that creates the modular encap KPI, that's really awesome and I love to see this in base.
What I'm not sure about is the creation of compile-in options. I'm not sure I completely understand the rationale here. Flexibility is good, but I guess people compile out certain functionality either to save space or to address security concerns (or both). It would be nice to add more datapoints in that regard (for example, "disabling feature X gives Y kilobytes on amd64 kernel" or "feature X can be seen as unsecure b/c .." and there is no good/simple way to disabling it in the runtime other that compiling out). It also comes up with the maintenance cost attached - ifdefs, build system conditionals and more code variation to test.
On the implementation side, number of people use custom kernel configs. Landing these changes will make them automatically build kernels without IPv6 extensions and other encaps. This silent feature disappearing worries me, actually.

Jun 2 2023, 10:29 AM

Jun 1 2023

melifaro accepted D40377: Teach route(8) to run in jails.
Jun 1 2023, 7:30 PM · Jails
melifaro added inline comments to D37574: nlsysevent: add a genetlink(4) module to report kernel events.
Jun 1 2023, 4:16 PM
melifaro added a comment to D40377: Teach route(8) to run in jails.

Thank you for working on this! Conceptually it LGTM, please see a comment on the implementation part.

Jun 1 2023, 3:58 PM · Jails
melifaro committed rGe32221a15f08: netinet6: make IPv6 fragment TTL per-VNET configurable. (authored by melifaro).
netinet6: make IPv6 fragment TTL per-VNET configurable.
Jun 1 2023, 12:08 PM
melifaro closed D35755: netinet6: make IPv6 fragment TTL per-VNET configurable..
Jun 1 2023, 12:08 PM
melifaro closed D40303: ifconfig: fix warnings #2.
Jun 1 2023, 11:55 AM
melifaro committed rG0c2beef72d1a: ifconfig: fix warnings #2 (authored by melifaro).
ifconfig: fix warnings #2
Jun 1 2023, 11:55 AM
melifaro abandoned D40348: netlink: retry mbuf allocation in different pool on failure.

D40356 was committed instead.

Jun 1 2023, 11:53 AM
melifaro closed D40332: ifnet: consistently call hooks when the interface gets up..
Jun 1 2023, 11:52 AM
melifaro committed rGa77facd27368: ifnet: consistently call hooks when the interface gets up. (authored by melifaro).
ifnet: consistently call hooks when the interface gets up.
Jun 1 2023, 11:52 AM
melifaro committed rG54b955f4df5e: netlink: add support for decoding genl ops/groups in pytest (authored by melifaro).
netlink: add support for decoding genl ops/groups in pytest
Jun 1 2023, 10:46 AM
melifaro updated the summary of D40368: netlink: use netlink mbufs in the mbuf chains..
Jun 1 2023, 8:15 AM
melifaro requested review of D40368: netlink: use netlink mbufs in the mbuf chains..
Jun 1 2023, 8:14 AM
melifaro closed D40356: netlink: use custom uma zone for the mbuf storage.
Jun 1 2023, 7:09 AM
melifaro committed rGd18715475071: netlink: use custom uma zone for the mbuf storage. (authored by melifaro).
netlink: use custom uma zone for the mbuf storage.
Jun 1 2023, 7:09 AM

May 31 2023

melifaro added a comment to D40348: netlink: retry mbuf allocation in different pool on failure.

I just experienced a similar scenario and complained to melifaro that netlink stopped working in that scenario. The ideal situation would be that netlink would just malloc memory, or use its own dedicated zone rather than mbufs.

Netlink by itself is opaque to underlying memory type (and uses plain malloc for linux app buffers / cases when the requested netlink message size is > 2k). I'd also prefer not to use mbufs at all, but that's the current way of interacting with socket buffers. To switch from that, one needs to implement routines like soreceive_generic, which is gigantic 500-line function. I'm looking into the alternative approaches, but for now let's try to get maximum from the current implementation

It is possible to provide an alternate allocator for mbufs. m_free() will invoke a custom destructor for M_EXT mbufs, so you can bypass the normal UMA zones used for network packets.

Ack. Thank you for the hint, I've created D40356, implementing this approach. It looks better than the current fix, so I'd prefer to land the new diff instead.

May 31 2023, 6:05 PM
melifaro added reviewers for D40356: netlink: use custom uma zone for the mbuf storage: network, glebius, markj, adrian, gallatin.
May 31 2023, 6:04 PM
melifaro requested review of D40356: netlink: use custom uma zone for the mbuf storage.
May 31 2023, 6:03 PM
melifaro added a comment to D40348: netlink: retry mbuf allocation in different pool on failure.

I think having a separate dedicated allocator for netlink messages is the better call. Don't make your control plane reliant on your data plane's memory management.

May 31 2023, 4:28 PM
melifaro added a comment to D40348: netlink: retry mbuf allocation in different pool on failure.

I just experienced a similar scenario and complained to melifaro that netlink stopped working in that scenario. The ideal situation would be that netlink would just malloc memory, or use its own dedicated zone rather than mbufs.

Netlink by itself is opaque to underlying memory type (and uses plain malloc for linux app buffers / cases when the requested netlink message size is > 2k). I'd also prefer not to use mbufs at all, but that's the current way of interacting with socket buffers. To switch from that, one needs to implement routines like soreceive_generic, which is gigantic 500-line function. I'm looking into the alternative approaches, but for now let's try to get maximum from the current implementation

May 31 2023, 4:14 PM
melifaro added inline comments to D40102: pfsync: Transport over IPv6 Unicast support.
May 31 2023, 2:58 PM
melifaro added reviewers for D40348: netlink: retry mbuf allocation in different pool on failure: network, gallatin, glebius.
May 31 2023, 2:41 PM
melifaro requested review of D40348: netlink: retry mbuf allocation in different pool on failure.
May 31 2023, 2:40 PM
melifaro committed rG4e9a97de01a5: netlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition (authored by melifaro).
netlink: fix ifconfig P2P inet ADDR ADDR netmask 255.255.255.255 addition
May 31 2023, 10:39 AM

May 30 2023

melifaro added a comment to D40256: netinet*: Fix redirects for connections from localhost.

No concerns from my side.

May 30 2023, 12:32 PM
melifaro added inline comments to D40332: ifnet: consistently call hooks when the interface gets up..
May 30 2023, 12:26 PM
melifaro added a comment to D40317: carp: add a 'SUPPRESS' state.

In other words: this patch cannot go in as-is (or at least not until the IFF_UP issues are addressed).

I ran into that when using netlink to configure interfaces. I guess we need to issue an eventhandler contification if some of interface flags were changed. I’ll take a look at that

I've raised D40332 to address lack of notifications to carp and the rest of the system.

May 30 2023, 12:18 PM
melifaro added reviewers for D40332: ifnet: consistently call hooks when the interface gets up.: network, kp.
May 30 2023, 12:17 PM
melifaro requested review of D40332: ifnet: consistently call hooks when the interface gets up..
May 30 2023, 12:16 PM
melifaro retitled D40331: netlink: dump interface capabilities with other interface data from netlink: add support for getting ifcaps to netlink: dump interface capabilities with other interface data.
May 30 2023, 10:58 AM
melifaro requested review of D40331: netlink: dump interface capabilities with other interface data.
May 30 2023, 10:47 AM
melifaro added inline comments to D40330: genl: add new command to list genetlink(4).
May 30 2023, 10:30 AM
melifaro accepted D40330: genl: add new command to list genetlink(4).

Wow, that's nice!
LGTM, though I'd suggest trying to add structured output from day one. I managed to convert ndp(8) ( D35677 ), so if you could consider looking into that option, that would be awesome!

May 30 2023, 10:25 AM

May 29 2023

melifaro added a comment to D40317: carp: add a 'SUPPRESS' state.
In D40317#917957, @kp wrote:

There's a rather annoying bug left in this. If we add a carp address on an interface that's down (i.e. IFF_UP is not set) the interface will come up during this, but remain in SUPPRESS state.

That's because the SIOCSIFADDR ioctl is passed to ether_ioctl(), which sets IFF_UP in ifp->if_flags directly, without any event handling. Ordinarily we'd call if_up(), which gives carp a chance to react to the interface coming up. That's not the case here, so it stays in SUPPRESS.

Initial attempts to fix this, by replacing ifp->if_flags |= IFF_UP in ether_ioctl() with if_up(ifp) resulted in ifconfig: ioctl (SIOCAIFADDR): File exists when trying to set an address on the interface. There's clearly an order of operations problem around this, but I don't fully understand it.

In other words: this patch cannot go in as-is (or at least not until the IFF_UP issues are addressed).

I ran into that when using netlink to configure interfaces. I guess we need to issue an eventhandler contification if some of interface flags were changed. I’ll take a look at that

May 29 2023, 3:58 PM

May 27 2023

melifaro updated the summary of D40303: ifconfig: fix warnings #2.
May 27 2023, 2:12 PM
melifaro requested review of D40303: ifconfig: fix warnings #2.
May 27 2023, 2:12 PM
melifaro committed rGc90901245e9c: netlink: update rta_multipath conditions in arp/ndp after 656a39c1a062 (authored by melifaro).
netlink: update rta_multipath conditions in arp/ndp after 656a39c1a062
May 27 2023, 1:27 PM
melifaro updated the summary of D40301: ifconfig: fix comparison in printmimo().
May 27 2023, 12:43 PM
melifaro requested review of D40301: ifconfig: fix comparison in printmimo().
May 27 2023, 12:40 PM
melifaro committed rG30376771fc79: netlink: fix build (authored by melifaro).
netlink: fix build
May 27 2023, 12:30 PM
melifaro committed rG7ee6b0f125a0: netlink: add snl(3) support for listing genetlink multicast groups (authored by melifaro).
netlink: add snl(3) support for listing genetlink multicast groups
May 27 2023, 11:15 AM
melifaro committed rG656a39c1a062: netlink: use newly-added snl(3) array parsing for handling multipath (authored by melifaro).
netlink: use newly-added snl(3) array parsing for handling multipath
May 27 2023, 11:15 AM
melifaro committed rG5f19f790b392: netlink: add snl(3) support for parsing unknown-size arrays (authored by melifaro).
netlink: add snl(3) support for parsing unknown-size arrays
May 27 2023, 11:14 AM
melifaro closed D40282: netlink: add support for parsing arrays of objects.
May 27 2023, 11:14 AM
melifaro committed rG99ea21744b9f: netlink: fix bulding with NOINET6 (authored by melifaro).
netlink: fix bulding with NOINET6
May 27 2023, 10:47 AM
melifaro committed rGdfc15e761b84: netlink: call IPv6 hook after the ifaddr operation when ifp is brought (authored by melifaro).
netlink: call IPv6 hook after the ifaddr operation when ifp is brought
May 27 2023, 10:45 AM

May 26 2023

melifaro resigned from D40236: Fix NULL deref in ip_output during route change.

I'm afraid I won't be able to review this in the foreseeable future. I think I completely forgot pre-nexthop routing logic.

May 26 2023, 3:04 PM
melifaro added a comment to D39865: cxgbe: use new cloners KPI..

Ping :-)
I'd love to get rid of if_clone_advanced() before 14 and cxgbe is the only remaining user :-)

May 26 2023, 2:44 PM
melifaro added a comment to D40183: build: Reduce the cost of supporting NO<INET|INET6|IP>* variants of the kernel..

I would like to try to have another iteration of the discussion :-)

May 26 2023, 2:08 PM
melifaro accepted D40256: netinet*: Fix redirects for connections from localhost.
May 26 2023, 1:59 PM
melifaro added reviewers for D40282: netlink: add support for parsing arrays of objects: network, bapt.
May 26 2023, 1:02 PM
melifaro requested review of D40282: netlink: add support for parsing arrays of objects.
May 26 2023, 1:01 PM

May 25 2023

melifaro committed rG6d204407ec6e: ifconfig: fix ifconfig IFX inet[6] ADDR -alias (authored by melifaro).
ifconfig: fix ifconfig IFX inet[6] ADDR -alias
May 25 2023, 3:04 PM