Page MenuHomeFreeBSD

pouria (Pouria Mousavizadeh Tehrani)
Pouria

Projects

User Details

User Since
Aug 26 2022, 6:24 PM (210 w, 6 d)

Recent Activity

Today

pouria added a comment to D59567: icmp: Limit routing table updates to the FIB of the redirect.

Not sure but it might help with PR292319

Fri, Sep 11, 8:34 AM
pouria added a comment to D53742: ip_ecn: don't touch the DSCP bits and flow_id.

maybe something like this; I suppose if this is after all the includes, it's scoped only within this source file.

#undef IPV6_ECN
#define IPV6_ECN(ipv6_flow) ((ntohl(ip6_flow) >> IPV6_FLOWLABEL_LEN) & 0x03)

conversely, the setting of the ECN can be done again with a macro override in the subsequent function.
Gleb may also have some input on this kinds of shenanigans; with the macro I feel more people would more readly understand what is going on here.

Fri, Sep 11, 8:21 AM
pouria accepted D59570: raw ip: clear sin_port on bind(2).

This change is good by nature. but it would be nice to have a comment above sa_equal in case we forget the original issue

Fri, Sep 11, 7:08 AM

Yesterday

pouria added a comment to D59552: route/fib_algo: Fix nexthop index collision across families.

FYI: @bms, I redesigned the current fib_algo to support neighbor families other than extra 4o6. Subhash Murmu (MPLS GSoC student) can increase FD_MAX_NH_AF and reuse it for its own dataplane.

Thu, Sep 10, 5:13 PM
pouria added a reviewer for D59552: route/fib_algo: Fix nexthop index collision across families: bms.
Thu, Sep 10, 5:11 PM
pouria added a comment to D56637: dhclient(8): Add support for IPv6-Only option (RFC 8925).

I am still testing it 24/7 on my laptop and can confirm that dhclient with this patch is working great!

Thu, Sep 10, 3:56 PM
pouria added a comment to D59570: raw ip: clear sin_port on bind(2).

What if the application set the sin6_flowinfo too?

Thu, Sep 10, 3:53 PM
pouria committed rGc6dfeb546d8c: tests/fib_lookup: Fix compilation by adding SYSDIR (authored by pouria).
tests/fib_lookup: Fix compilation by adding SYSDIR
Thu, Sep 10, 11:03 AM
pouria accepted D59567: icmp: Limit routing table updates to the FIB of the redirect.
Thu, Sep 10, 10:57 AM
pouria added a comment to D45102: Disable ICMP (v4) redirects by default.

Is there a reason we shouldn't go ahead with this?

Thu, Sep 10, 10:47 AM

Wed, Sep 9

pouria published D59552: route/fib_algo: Fix nexthop index collision across families for review.
Wed, Sep 9, 11:38 PM

Sun, Sep 6

pouria reclaimed D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

Sorry, I think I abandon it too soon.
@glebius, do you have any suggestion?

Sun, Sep 6, 9:15 AM

Sat, Sep 5

pouria abandoned D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.
Sat, Sep 5, 9:32 PM
pouria accepted D59392: nd6: Fix the array size in union nd_opts.
Sat, Sep 5, 6:52 PM
pouria added inline comments to D59443: 14.5/errata.adoc: routing table memory leak issue.
Sat, Sep 5, 2:56 PM · releng
pouria added inline comments to D59443: 14.5/errata.adoc: routing table memory leak issue.
Sat, Sep 5, 2:20 PM · releng
pouria added inline comments to D59443: 14.5/errata.adoc: routing table memory leak issue.
Sat, Sep 5, 1:47 PM · releng
pouria added a comment to D59387: net/if: Fix ifa memory leak during vnet removal.

You definitely found the problem, but the fix doesn't seem correct. There is asymmetry in allocation/freeing. It could close the leak at some configurations without regressions, of course. But IMHO not at all configurations.

First, the stack allocates single address, but frees the entire list. Can this be made symmetrical and only ifp->if_addr is freed by the stack?
Second, allocation happens always, but freeing is under #ifdef VIMAGE.

Sat, Sep 5, 8:45 AM

Fri, Sep 4

pouria added a comment to D59387: net/if: Fix ifa memory leak during vnet removal.

But where is the leak? Shouldn't each interface be responsible for removing its addresses when it's destroyed?

Fri, Sep 4, 3:16 PM
pouria committed rGcc7901791cbc: nd6: Fix a typo on MAX_NEIGHBOR_ADVERTISEMENT comment (authored by pouria).
nd6: Fix a typo on MAX_NEIGHBOR_ADVERTISEMENT comment
Fri, Sep 4, 1:13 PM
pouria published D59387: net/if: Fix ifa memory leak during vnet removal for review.
Fri, Sep 4, 11:30 AM

Thu, Sep 3

pouria committed rG26164de409a0: route/fib_algo: Free leaked radix_masks in radix_lockless (authored by pouria).
route/fib_algo: Free leaked radix_masks in radix_lockless
Thu, Sep 3, 11:03 PM
pouria committed rGe5a9ad7cbf24: route/fib_algo: Free leaked radix_masks in radix_lockless (authored by pouria).
route/fib_algo: Free leaked radix_masks in radix_lockless
Thu, Sep 3, 11:02 PM

Mon, Aug 31

pouria added a reviewer for D59289: ifnet: Traverse interface groups under the network epoch: zlei.
Mon, Aug 31, 5:41 PM
pouria added a comment to D59289: ifnet: Traverse interface groups under the network epoch.

I'm not sure if this is the right approach because if_detach_internal() is not the only consumer of if_delgroup. But since we're using ck_queue here, I think it should be fine.
I prefer to have other opinions on this change as well.

Mon, Aug 31, 4:00 PM

Sun, Aug 30

pouria committed rGc006c8dac0e5: if_bridge: Fix NULL softc dereference in bridge_input() (authored by acesp25).
if_bridge: Fix NULL softc dereference in bridge_input()
Sun, Aug 30, 6:05 PM

Thu, Aug 27

pouria committed rG901a242269b2: ifconfig: Add netlink support for reading ifgroup (authored by pouria).
ifconfig: Add netlink support for reading ifgroup
Thu, Aug 27, 1:28 PM
pouria committed rG2f8f892ca344: rtnetlink: Add FreeBSD-specific IFLAF_GROUP support (authored by pouria).
rtnetlink: Add FreeBSD-specific IFLAF_GROUP support
Thu, Aug 27, 1:28 PM
pouria closed D58644: ifconfig: Add netlink support for reading ifgroup.
Thu, Aug 27, 1:28 PM
pouria closed D58643: rtnetlink: Add FreeBSD-specific IFLAF_GROUP support.
Thu, Aug 27, 1:27 PM

Wed, Aug 26

pouria committed rGea7c339e8b04: routing: Use fib-aware ifa lookup in ifa_ifwithroute() (authored by pouria).
routing: Use fib-aware ifa lookup in ifa_ifwithroute()
Wed, Aug 26, 2:02 PM
pouria closed D59128: routing: Use fib-aware ifa lookup in ifa_ifwithroute().
Wed, Aug 26, 2:01 PM

Tue, Aug 25

pouria added a comment to D59160: netinet6: add per-interface MLD report suppression (ifconfig no_mld).

@pouria MLD's role is informing snooping switches and multicast routers where to forward group traffic so they can prune instead of flooding (RFC 4541). So "ND relies on MLD" holds on fabrics whose switches prune by snooping

Tue, Aug 25, 2:33 PM · network
pouria requested changes to D59160: netinet6: add per-interface MLD report suppression (ifconfig no_mld).

Thank you for your contribution.
I understand your concern.
I've encountered similar policies at multiple IXPs as well. (ofc not for MLD)

Tue, Aug 25, 8:11 AM · network

Mon, Aug 24

pouria accepted D59142: tcp: minor cleanup.

LGTM

Mon, Aug 24, 10:03 AM

Sun, Aug 23

pouria requested review of D59128: routing: Use fib-aware ifa lookup in ifa_ifwithroute().
Sun, Aug 23, 5:56 PM
pouria committed rG790817f5a7a6: route/fib_algo: Free leaked radix_masks in radix_lockless (authored by pouria).
route/fib_algo: Free leaked radix_masks in radix_lockless
Sun, Aug 23, 7:39 AM
pouria closed D59112: route/fib_algo: Free leaked radix_masks in radix_lockless.
Sun, Aug 23, 7:39 AM

Sat, Aug 22

pouria updated the summary of D59112: route/fib_algo: Free leaked radix_masks in radix_lockless.
Sat, Aug 22, 8:54 PM
pouria requested review of D59112: route/fib_algo: Free leaked radix_masks in radix_lockless.
Sat, Aug 22, 8:46 PM

Fri, Aug 21

pouria committed rGf71abf3f650f: netstat(1): Add nexthop statistics support with -os flag (authored by pouria).
netstat(1): Add nexthop statistics support with -os flag
Fri, Aug 21, 2:21 PM
pouria closed D58538: netstat(1): Add nexthop statistics support with -os flag.
Fri, Aug 21, 2:21 PM

Thu, Aug 20

pouria updated the diff for D58538: netstat(1): Add nexthop statistics support with -os flag.

netstat.1: Remove -N/-M options in -o/-O, but keep the -j/--libxo for those options.

Thu, Aug 20, 9:21 PM
pouria updated the diff for D58538: netstat(1): Add nexthop statistics support with -os flag.

Address @kfv comments. Thank you!

Thu, Aug 20, 7:53 PM

Wed, Aug 19

pouria added a comment to D58776: rtnetlink: Add native SR-IOV VF status.

Thank you!

Wed, Aug 19, 10:51 PM
pouria added a comment to D58538: netstat(1): Add nexthop statistics support with -os flag.

Friendly ping @ziaee

Wed, Aug 19, 9:58 PM
pouria updated the diff for D58644: ifconfig: Add netlink support for reading ifgroup.

Rebase on top of D58775 and replace struct iflaf_group with snl_parray

Wed, Aug 19, 9:50 PM
pouria updated the diff for D58643: rtnetlink: Add FreeBSD-specific IFLAF_GROUP support.

Rebase on top of D58775 and replace struct iflaf_group with snl_parray

Wed, Aug 19, 9:50 PM
pouria accepted D58775: netlink: Parse repeated nested attributes.

LGTM
Thank you!
I'll rebase D58644 on top of this and replace my parray to multi-attr.
It *might* also need a version bump.

Wed, Aug 19, 7:40 PM
pouria committed rGba27b63c4477: linux: Add STF type and convert some if_type to ARPHRD (authored by pouria).
linux: Add STF type and convert some if_type to ARPHRD
Wed, Aug 19, 7:08 PM
pouria closed D58573: linux: Add STF type and convert some if_type to ARPHRD.
Wed, Aug 19, 7:08 PM
pouria retitled D58573: linux: Add STF type and convert some if_type to ARPHRD from linux: Add STF type and convert if_bridge and if_vlan to ARPHRD_ETHER to linux: Add STF type and convert some if_type to ARPHRD.
Wed, Aug 19, 7:06 PM
pouria updated the diff for D58573: linux: Add STF type and convert some if_type to ARPHRD.

Address @kfv comment. Thanks!

Wed, Aug 19, 7:02 PM
pouria added a reviewer for D58538: netstat(1): Add nexthop statistics support with -os flag: kfv.
Wed, Aug 19, 7:00 PM
pouria added a reviewer for D58573: linux: Add STF type and convert some if_type to ARPHRD: kfv.
Wed, Aug 19, 6:24 PM
pouria committed rGa6e9e4cb259c: nhop.9: Rewrite relics of rtentry.9 into nhop.9 (authored by pouria).
nhop.9: Rewrite relics of rtentry.9 into nhop.9
Wed, Aug 19, 6:20 PM
pouria closed D58564: nhop.9: Rewrite relics of rtentry.9 into nhop.9.
Wed, Aug 19, 6:19 PM

Sat, Aug 15

pouria added a reviewer for D58855: namei: retry absolute symlink expansions from the native root: kib.
Sat, Aug 15, 10:14 AM

Fri, Aug 14

pouria closed D58544: netinet6: Fix check for pktinfo outgoing ifindex in route cache.
Fri, Aug 14, 8:26 PM
pouria committed rG7753a59fdf19: netinet6: Fix check for pktinfo outgoing ifindex in route cache (authored by pouria).
netinet6: Fix check for pktinfo outgoing ifindex in route cache
Fri, Aug 14, 8:26 PM
pouria added a reviewer for D53742: ip_ecn: don't touch the DSCP bits and flow_id: glebius.
Fri, Aug 14, 5:31 PM
pouria added inline comments to D53742: ip_ecn: don't touch the DSCP bits and flow_id.
Fri, Aug 14, 4:38 PM
pouria updated subscribers of D55777: ng_eiface: protect private data from ioctl access.
Fri, Aug 14, 4:03 PM
pouria added a comment to D53742: ip_ecn: don't touch the DSCP bits and flow_id.

friendly ping @tuexen @rscheff

Fri, Aug 14, 4:03 PM
pouria added a reviewer for D58803: route/fib_algo: Use refcount(9) for fib_lookup_module: kfv.
Fri, Aug 14, 3:58 PM
pouria updated the diff for D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

Delay lock in fib_module_unregister.

Fri, Aug 14, 3:57 PM
pouria updated the diff for D58643: rtnetlink: Add FreeBSD-specific IFLAF_GROUP support.

Address @markj comments.

Fri, Aug 14, 11:10 AM
pouria abandoned D57268: rtnetlink: Don't send RTA_PRIORITY if has default value.
Fri, Aug 14, 6:39 AM

Thu, Aug 13

pouria added inline comments to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.
Thu, Aug 13, 8:01 PM
pouria updated the diff for D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

Unlock earlier in fib_check_best_algo.

Thu, Aug 13, 7:59 PM
pouria added inline comments to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.
Thu, Aug 13, 7:48 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

You can dig deeper: where are the lock acquisitions coming from? Use stack(). Is there actual lock contention? Use lockstat:::adaptive-spin/adaptive-block to look for this. See dtrace_lockstat(4).

Thu, Aug 13, 7:43 PM
pouria accepted D58826: routing: Fix table sizes.
Thu, Aug 13, 7:02 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

Something like dtrace -n 'lockstat:::adaptive-acquire /args[0]->lock_object.lo_name == "algo list mutex"/{printf("hi");}' can be used to get a sense for how often this lock is acquired.

Thu, Aug 13, 10:27 AM
pouria added reviewers for D58544: netinet6: Fix check for pktinfo outgoing ifindex in route cache: bz, zlei.
Thu, Aug 13, 7:35 AM
pouria added a comment to D58564: nhop.9: Rewrite relics of rtentry.9 into nhop.9.

friendly ping @melifaro

Thu, Aug 13, 7:34 AM
pouria added reviewers for D58573: linux: Add STF type and convert some if_type to ARPHRD: dteske, emaste.
Thu, Aug 13, 7:33 AM

Wed, Aug 12

pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

But why do this? What do we gain? These operations are rare. In such code, it is better to keep things simpler and "obviously correct." You're right that we can now probably drop that one use of the fib module lock, but now the code is harder to reason about and debug, and we do not gain anything in return (that I can see, at least).

Unfortunately, if you're using the radix[6]_lockless algorithm, which is usually true for IPv6, these operations happen frequently.
This is what I found while debugging PR297339.

You can test it yourself, set sysctl net.route.algo.debug_level=8 and try to keep a simple routing daemon for routes under 10k.
Then you see these functions are frequently run must of the time.
Since radix[6]_lockless rebuilds itself on every change.

I'm trying to cleanup fib_algo file.
It's too hard to work on it with radix_lockless.

What does "frequently" mean? Once a second? Ten thousand times a second? Does the change actually help performance in some measurable way?

Ok, I just run the dtrace below on my IXP router (unmodified CURRENT kernel).
This might answer your question:
[...]
dtrace.s:

fbt:kernel:fib_unref_nhop:entry
{
fib_calls++;
}

BTW, this is racy, see the note here https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/dtrace-guide/variables-dtrace.html

Better would be to use an aggregation: @calls = count();

tick-1s
{
printf("%Y | fib_unref_nhop calls/sec: %d\n", walltimestamp, fib_calls);
fib_calls = 0;
}

Ok, but fib_unref_nhop() doesn't acquire the module lock.

Wed, Aug 12, 8:53 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

I had to restart my router because of radix6_lockless memory leak.
The output below is RIGHT after boot with DPDK:

[pouria@nanali] [~] % uptime
11:29PM  up 45 secs, 1 user, load averages: 2.25, 0.55, 0.20
[pouria@nanali] [~] % kldload dtraceall
kldload: can't load dtraceall: Operation not permitted
[pouria@nanali] [~] % mdo kldload dtraceall
[pouria@nanali] [~] % mdo dtrace -s stats.d
2026 Aug 12 23:29:39 | fib_unref_nhop calls/sec: 6932
2026 Aug 12 23:29:40 | fib_unref_nhop calls/sec: 6580
2026 Aug 12 23:29:41 | fib_unref_nhop calls/sec: 7452
2026 Aug 12 23:29:42 | fib_unref_nhop calls/sec: 8890
2026 Aug 12 23:29:43 | fib_unref_nhop calls/sec: 6836
2026 Aug 12 23:29:44 | fib_unref_nhop calls/sec: 6776
2026 Aug 12 23:29:45 | fib_unref_nhop calls/sec: 5161
2026 Aug 12 23:29:46 | fib_unref_nhop calls/sec: 9029
2026 Aug 12 23:29:47 | fib_unref_nhop calls/sec: 8917
2026 Aug 12 23:29:48 | fib_unref_nhop calls/sec: 7426
2026 Aug 12 23:29:49 | fib_unref_nhop calls/sec: 3824
Wed, Aug 12, 8:02 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

But why do this? What do we gain? These operations are rare. In such code, it is better to keep things simpler and "obviously correct." You're right that we can now probably drop that one use of the fib module lock, but now the code is harder to reason about and debug, and we do not gain anything in return (that I can see, at least).

Unfortunately, if you're using the radix[6]_lockless algorithm, which is usually true for IPv6, these operations happen frequently.
This is what I found while debugging PR297339.

You can test it yourself, set sysctl net.route.algo.debug_level=8 and try to keep a simple routing daemon for routes under 10k.
Then you see these functions are frequently run must of the time.
Since radix[6]_lockless rebuilds itself on every change.

I'm trying to cleanup fib_algo file.
It's too hard to work on it with radix_lockless.

What does "frequently" mean? Once a second? Ten thousand times a second? Does the change actually help performance in some measurable way?

Wed, Aug 12, 7:59 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

But why do this? What do we gain? These operations are rare. In such code, it is better to keep things simpler and "obviously correct." You're right that we can now probably drop that one use of the fib module lock, but now the code is harder to reason about and debug, and we do not gain anything in return (that I can see, at least).

Wed, Aug 12, 7:23 PM
pouria updated the diff for D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

Wanted to make sure, here is the removal of FIB_MOD_LOCK in unref_algo.

Wed, Aug 12, 7:06 PM
pouria added a comment to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.

That would make sense if you also got rid of FIB_MOD_LOCK() at least for some of the operations. The change as is just adds synchronization inside sections that are already synchronized by the mutex.

Wed, Aug 12, 6:52 PM
pouria added inline comments to D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.
Wed, Aug 12, 6:51 PM
pouria requested review of D58803: route/fib_algo: Use refcount(9) for fib_lookup_module.
Wed, Aug 12, 6:47 PM

Aug 11 2026

pouria updated subscribers of D58775: netlink: Parse repeated nested attributes.

Overall, this is a great change. I also wanted to rename parray structure from nexthop-specific names to something more generic too, considering we really need the multi-attr parser in our library too. specially for cases like D58643.

Aug 11 2026, 5:34 PM
pouria accepted D58774: linuxulator: map IFF_LOWER_UP through NETLINK_ROUTE for Linux apps.
Aug 11 2026, 5:14 PM

Aug 8 2026

pouria added inline comments to D58564: nhop.9: Rewrite relics of rtentry.9 into nhop.9.
Aug 8 2026, 3:38 PM
pouria updated the diff for D58564: nhop.9: Rewrite relics of rtentry.9 into nhop.9.

Address @ziaee comment on macro.

Aug 8 2026, 3:38 PM
pouria closed D58565: route.4: Add RTV_METRIC flag to rt_metrics.
Aug 8 2026, 6:38 AM
pouria committed rGc521b16752c5: route.4: Add RTV_METRIC flag to rt_metrics (authored by pouria).
route.4: Add RTV_METRIC flag to rt_metrics
Aug 8 2026, 6:37 AM
pouria added a comment to D58565: route.4: Add RTV_METRIC flag to rt_metrics.

What would be helpful is a Fixes: commit message trailer so we knew how far back this needs to MFC and when.

Aug 8 2026, 6:28 AM
pouria committed rGb3e20e1a0386: rtadvd(8): Fix RA flag inconsistency messages (authored by pouria).
rtadvd(8): Fix RA flag inconsistency messages
Aug 8 2026, 6:21 AM
pouria committed rGc3a70b0319d9: rtadvd(8): Fix RA flag inconsistency messages (authored by pouria).
rtadvd(8): Fix RA flag inconsistency messages
Aug 8 2026, 6:17 AM

Aug 7 2026

pouria added a comment to D58643: rtnetlink: Add FreeBSD-specific IFLAF_GROUP support.

ping @glebius @markj

Aug 7 2026, 4:03 PM
pouria added a comment to D58573: linux: Add STF type and convert some if_type to ARPHRD.

ping @kib

Aug 7 2026, 4:03 PM
pouria updated subscribers of D58565: route.4: Add RTV_METRIC flag to rt_metrics.

ping @glebius @ziaee

Aug 7 2026, 4:02 PM
pouria added a comment to D58564: nhop.9: Rewrite relics of rtentry.9 into nhop.9.

ping @glebius

Aug 7 2026, 4:02 PM
pouria added a comment to D58544: netinet6: Fix check for pktinfo outgoing ifindex in route cache.

ping @glebius @markj

Aug 7 2026, 4:02 PM
pouria added a comment to D58538: netstat(1): Add nexthop statistics support with -os flag.

ping @glebius @markj

Aug 7 2026, 4:02 PM