Page MenuHomeFreeBSD

zlei (Zhenlei Huang)
User

Projects (1)

User Details

User Since
Apr 1 2021, 3:21 AM (294 w, 1 d)

Recent Activity

Today

zlei committed rGbf362c1b41c8: kobj: convert KOBJOPLOOKUP() to returning pointer to function (authored by ehem_freebsd_m5p.com).
Fri, Nov 20, 10:11 AM
zlei closed D48408: kobj: convert KOBJOPLOOKUP() to returning pointer to function.
Fri, Nov 20, 10:11 AM
zlei accepted D61725: arp: Teach arp to attach and run itself in a jail.

Looks good to me.

Fri, Nov 20, 1:18 AM

Yesterday

zlei added a comment to D61687: blackhole.4: These sysctls are sysctl only.

the reason i was wondering that is in case people want to put them in loader.conf. if you put these in loader.conf they just silently do nothing since they are sysctl only.

Thu, Nov 19, 3:53 AM

Wed, Nov 18

zlei added a comment to D61687: blackhole.4: These sysctls are sysctl only.

The sysctl service runs quite early which is before /etc/rc.d/netif ( ignore dhclient right now ),

Wed, Nov 18, 2:59 AM

Mon, Nov 16

zlei added a comment to D48408: kobj: convert KOBJOPLOOKUP() to returning pointer to function.

I plan to commit this in few days. Any objection ?

Mon, Nov 16, 9:51 AM

Sun, Nov 15

zlei accepted D61517: if_bridge: Use bridge's FIB for incoming unicasts.

Looks good to me.

Sun, Nov 15, 1:38 PM

Sat, Nov 14

zlei added a comment to D61320: if_firewire: Be more robust while checking the frame size.

P.S. AFAIK the ubiquitous use of signed integers for unsigned entities that we inherited from 4.3BSD comes from late Bruce Evans. He always insisted that at machine level everything is signed, that's why. I never fully bought this point. It seems to me that by today standards all software development norms is that use unsigned types for unsigned entities. And even a very smart man can be wrong sometimes. Thus, we should do sweeping changes to get rid of this heritage. Any other opinions?

Sat, Nov 14, 5:12 PM · firewire
zlei added inline comments to D61320: if_firewire: Be more robust while checking the frame size.
Sat, Nov 14, 4:30 PM · firewire
zlei added a comment to D61517: if_bridge: Use bridge's FIB for incoming unicasts.

Emm, I guess the bridge members should inherit the default FIB number from bridge ?

Sat, Nov 14, 3:59 PM
zlei added a comment to D59849: gre(4): Add full support for gre key.

Looks good to me. Sorry for the late response.

Sat, Nov 14, 3:28 PM

Wed, Nov 11

zlei added inline comments to D61385: ip_forward: Take the nexthop reference only for ip_output().
Wed, Nov 11, 4:59 PM

Tue, Nov 10

zlei added a comment to D61320: if_firewire: Be more robust while checking the frame size.

is m_len / m_pktlen ever supposed to be negative?

They should not be negative. But buggy driver / net stack logic may lead to. Here is an example 6429199a2113 (llan: byte swap the receive queue entries) .

If it can't be negative then we could write a mbuf len comparison function that can assert/log an error, and then do the correct things with comparison.

Tue, Nov 10, 6:11 PM · firewire
zlei accepted D48408: kobj: convert KOBJOPLOOKUP() to returning pointer to function.

The change looks good to me. I do not have strong opinion on __extension__ . There're already lots of macro definition without __extension__.

Tue, Nov 10, 6:04 PM
zlei added a reviewer for D48408: kobj: convert KOBJOPLOOKUP() to returning pointer to function: kib.
Tue, Nov 10, 6:01 PM
zlei added inline comments to D61385: ip_forward: Take the nexthop reference only for ip_output().
Tue, Nov 10, 5:54 PM
zlei committed rG8910f9e5a0cc: kobj: Make the containers of pointers to base classes constant.
Tue, Nov 10, 1:29 PM
zlei closed D61297: kobj: Make the containers of pointers to base classes constant.
Tue, Nov 10, 1:29 PM

Sun, Nov 8

zlei added a comment to D61320: if_firewire: Be more robust while checking the frame size.

is m_len / m_pktlen ever supposed to be negative?

Sun, Nov 8, 6:19 PM · firewire
zlei added inline comments to D61297: kobj: Make the containers of pointers to base classes constant.
Sun, Nov 8, 5:36 PM
zlei added inline comments to D61320: if_firewire: Be more robust while checking the frame size.
Sun, Nov 8, 5:04 PM · firewire
zlei requested review of D61320: if_firewire: Be more robust while checking the frame size.
Sun, Nov 8, 4:45 PM · firewire

Sat, Nov 7

zlei requested review of D61297: kobj: Make the containers of pointers to base classes constant.
Sat, Nov 7, 5:00 PM
zlei committed rG6b38db44f0ea: sys/kobj.h: Convert macro DEFINE_CLASS to designated initializers.
Sat, Nov 7, 2:36 PM
zlei closed D61276: sys/kobj.h: Convert macro DEFINE_CLASS to designated initializers.
Sat, Nov 7, 2:36 PM

Fri, Nov 6

zlei requested review of D61276: sys/kobj.h: Convert macro DEFINE_CLASS to designated initializers.
Fri, Nov 6, 8:50 PM

Thu, Nov 5

zlei committed rG530ece453901: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Thu, Nov 5, 11:22 PM

Wed, Nov 4

zlei closed D61179: RELNOTES: Fix the name of the loader tunable kern.sched.name.
Wed, Nov 4, 7:30 PM
zlei committed rGba855bc358b9: RELNOTES: Fix the name of the loader tunable kern.sched.name.
Wed, Nov 4, 7:30 PM
zlei closed D61178: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Wed, Nov 4, 7:30 PM
zlei committed rG5e54a402f896: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Wed, Nov 4, 7:30 PM
zlei committed rG8e429142feaa: kobj: Avoid initializing pointer from boolean value.
Wed, Nov 4, 7:30 PM
zlei closed D61173: kobj: Avoid initializing pointer from boolean value.
Wed, Nov 4, 7:30 PM
zlei added inline comments to D61178: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Wed, Nov 4, 7:17 PM
zlei added a comment to D61173: kobj: Avoid initializing pointer from boolean value.
In D61173#1402811, @kib wrote:

Perhaps properly fixing it would change to use designated initializers, as a follow-up.

Wed, Nov 4, 7:11 PM
zlei added inline comments to D61179: RELNOTES: Fix the name of the loader tunable kern.sched.name.
Wed, Nov 4, 9:01 AM
zlei requested review of D61179: RELNOTES: Fix the name of the loader tunable kern.sched.name.
Wed, Nov 4, 9:00 AM
zlei requested review of D61178: sched: Add sysctl flag CTLFLAG_TUN to loader tunable kern.sched.name.
Wed, Nov 4, 8:58 AM
zlei requested review of D61173: kobj: Avoid initializing pointer from boolean value.
Wed, Nov 4, 3:54 AM

Oct 17 2026

zlei accepted D60788: ng_pppoe: fix m_pullup() logic.

Looks sane to me.

Oct 17 2026, 3:06 PM

Oct 15 2026

zlei accepted D60689: net*: use inlined m_pullup().

Looks good to me.

Oct 15 2026, 7:36 AM
zlei accepted D60738: net*: remove remnants of caddr_t.

Generally looks good to me.

Oct 15 2026, 7:24 AM
zlei accepted D60736: mbuf: remove remnants of caddr_t.

Looks good to me.

Oct 15 2026, 6:20 AM
zlei added inline comments to D60736: mbuf: remove remnants of caddr_t.
Oct 15 2026, 3:13 AM

Oct 14 2026

zlei updated subscribers of D60689: net*: use inlined m_pullup().

Generally looks good to me. Well I'd recommend fixing existing bugs prior to committing this change.

Oct 14 2026, 3:42 PM

Oct 13 2026

zlei accepted D60688: mbuf: make m_pullup() an inline over most expected case.

I like this idea !

Oct 13 2026, 1:58 AM

Oct 12 2026

zlei added a comment to D59450: loopback: set MTU to IF_MAXMTU.

Hi @glebius , I made a mistake while doing the benchmark -:)

Oct 12 2026, 5:54 PM
zlei added inline comments to D59849: gre(4): Add full support for gre key.
Oct 12 2026, 10:14 AM

Oct 11 2026

zlei accepted D60616: Makefile.inc1: Demote root build message to .info.

Looks good to me.

Oct 11 2026, 3:00 PM
zlei added a reviewer for D60616: Makefile.inc1: Demote root build message to .info: jhb.
Oct 11 2026, 3:00 PM
zlei added inline comments to D50352: build: Emit a warning for build targets run as root.
Oct 11 2026, 1:32 PM

Oct 10 2026

zlei added a comment to D58742: qlnx: Report SR-IOV VF status.

@kbowling I have the hardware ( QLogic FastLinQ QL41000 ) which is supported by this driver. Do you want me to test with this new feature ?

Yes please. Create some VFs with iovctl and use 'ifconfig -v'

Oct 10 2026, 1:01 PM

Sep 30 2026

zlei added a comment to D59748: Jail init process and virtual reboot.

I think this is a nice feature !

Sep 30 2026, 4:39 AM

Sep 27 2026

zlei accepted D59919: net: Fix handling of sockaddrs in the SIOC{ADD,DEL}MULTI handlers.

Looks good to me.

Sep 27 2026, 2:12 PM

Sep 24 2026

zlei added inline comments to D59919: net: Fix handling of sockaddrs in the SIOC{ADD,DEL}MULTI handlers.
Sep 24 2026, 7:09 AM

Sep 17 2026

zlei added a comment to D59450: loopback: set MTU to IF_MAXMTU.
In D59450#1370998, @cc wrote:

For the case of MTU=64KB, in FreeBSD you have to change the net.inet.tcp.sendspace value from default 32KB to 64KB or larger to make sense of using MSS=64KB. If so, you also have to increase the net.inet.tcp.recvspace value from default 64KB to a larger value.

Reference:
https://wiki.freebsd.org/chengcui/tcp_loopback_perf

Sep 17 2026, 9:01 AM

Sep 16 2026

zlei accepted D59567: icmp: Limit routing table updates to the FIB of the redirect.

I have not tested this change yet, but it looks reasonable!

Sep 16 2026, 8:56 AM
zlei accepted D59589: website: Restore "The Power to Serve" on homepage.
Sep 16 2026, 6:32 AM
zlei added a comment to D58742: qlnx: Report SR-IOV VF status.

@kbowling I have the hardware ( QLogic FastLinQ QL41000 ) which is supported by this driver. Do you want me to test with this new feature ?

Sep 16 2026, 2:19 AM
zlei added a comment to D59450: loopback: set MTU to IF_MAXMTU.

@glebius I think this is not a breaking change, but it improves the performance significantly ( now with a larger default MTU ). Does it deserve a change log or release note ?

Sep 16 2026, 2:06 AM
zlei accepted D59450: loopback: set MTU to IF_MAXMTU.

Some time ago I was wondering why the MTU of loopback interface was limited to 16K, I thought a larger one should have better performance so I did a simple test ( iperf3 on lo0 ). It was weird that I saw performance degrees when increasing the MTU to 64K.

Sep 16 2026, 1:52 AM
zlei added inline comments to D59387: net/if: Fix ifa memory leak during vnet removal.
Sep 16 2026, 1:27 AM

Aug 2 2026

zlei added inline comments to D58591: mtest: Use ntohl() when assigning IPv4-mapped addresses for IPv6 sockets..
Aug 2 2026, 6:46 PM

Jul 24 2026

zlei accepted D58423: netinet6/nd6: Sprinkle missing prefix refcounting.

Looks good to me. @markj Do you plan to MFC ?

Jul 24 2026, 6:29 AM

Jul 20 2026

zlei added a comment to D58294: netlink: Add RTA_PREFSRC support.

Nice feature!

Jul 20 2026, 2:59 AM

Jul 13 2026

zlei accepted D58151: libnetmap: fix extra indirection in nmreq_remove_option.
Jul 13 2026, 7:28 AM
zlei added a reviewer for D58151: libnetmap: fix extra indirection in nmreq_remove_option: vmaffione.
Jul 13 2026, 7:28 AM
zlei accepted D58150: libnetmap: fix error path in nmport_extmem_from_file.
Jul 13 2026, 7:26 AM
zlei added a reviewer for D58150: libnetmap: fix error path in nmport_extmem_from_file: vmaffione.
Jul 13 2026, 7:25 AM
zlei added a comment to D58132: netinet6: Fix ND link-layer address option layout for IPoIB (stable/15).

@adrian Hi, could you please MFC this one into stable/15?
I'm not sure how to apply this patch from phabricator while cherry-picking it from CURRENT..

Jul 13 2026, 7:17 AM
zlei added a comment to D58096: netinet6: fix ND link-layer address option layout for IPoIB.

It's really hard to MFC this change to stable/15.

Jul 13 2026, 7:15 AM · network
zlei committed rG37340348b9a8: iflib: Add a missing CURVNET_RESTORE() in the error path (authored by Peter Ganzhorn <peter.ganzhorn@gmail.com>).
Jul 13 2026, 1:42 AM

Jul 8 2026

zlei accepted D58062: lagg: re-check port caps after bringing up a port.

Looks good to me.

Jul 8 2026, 5:09 AM
zlei accepted D58054: if_epair: support IFCAP_MEXTPG.

Looks good to me.

Jul 8 2026, 3:46 AM

Jun 30 2026

zlei accepted D57755: bsdinstall: add a hardening knob for unprivileged kenv access.

Looks good to me.

Jun 30 2026, 1:58 AM

Jun 21 2026

zlei accepted D57697: kern: add a security knob to disable unprivileged access to kenv.

Looks good to me.

Jun 21 2026, 3:48 PM

Jun 20 2026

zlei added a comment to D57669: if_gre(4): Fix races by changing initialization order and locks.

I'd recommend to split this to multiple commits. For example the removal of GRE_RLOCK() / GRE_RUNLOCK() in gre_transmit() is an optimization and does not look like a FIX.

Jun 20 2026, 7:59 AM
zlei added inline comments to D57697: kern: add a security knob to disable unprivileged access to kenv.
Jun 20 2026, 7:16 AM

Jun 15 2026

zlei added reviewers for D57519: netlink: Add sync path in user-kernel interface: emaste, pouria, markj.
Jun 15 2026, 8:22 AM

Jun 10 2026

zlei added a comment to D57233: tty: Add sysctl knob to globally disable TIOCSTI.

Any plans to MFC this to stable branches ?

Yes, in a couple of days.

Jun 10 2026, 2:07 AM
zlei added a comment to D57233: tty: Add sysctl knob to globally disable TIOCSTI.

Any plans to MFC this to stable branches ?

Jun 10 2026, 1:40 AM

Jun 8 2026

zlei retitled D57496: firewire: Fix watchdog_clock aliasing and fw_tl2xfer UAF race from fix(firewire): fix watchdog_clock aliasing and fw_tl2xfer UAF race
Jun 8 2026, 7:38 AM · drivers, firewire
zlei retitled D57495: fwip: Fix M_PKTHDR loss in fwip_async_output broadcast path from fix(fwip): fix M_PKTHDR loss in fwip_async_output broadcast path
Jun 8 2026, 7:37 AM · drivers, firewire
zlei accepted D57496: firewire: Fix watchdog_clock aliasing and fw_tl2xfer UAF race.

The part watchdog_clock of this change looks good to me.

Jun 8 2026, 7:36 AM · drivers, firewire
zlei accepted D57495: fwip: Fix M_PKTHDR loss in fwip_async_output broadcast path.

Looks sane to me.

Jun 8 2026, 6:45 AM · drivers, firewire
zlei added a comment to D57459: fix(fwe): add missing net epoch around ether_input.

hm, good question, should we do it per frame or in batches?

Jun 8 2026, 2:50 AM · firewire, network

Jun 3 2026

zlei accepted D57342: ip6: Drop dead code in ip6_input_hbh().

Looks good to me.

Jun 3 2026, 2:51 PM

Jun 1 2026

zlei added a comment to D56942: lagg: Handle a port count of zero.

I'm OK with this revision, although I think an explicit memory barrier while increasing / decreasing sc->sc_count will make the code more clear than a NULL check in the reader side (lagg_rr_start).

A memory barrier isn't sufficient. For sc_count and length(sc_ports) to be consistent with each other, you need a mutex.

The writer side is lagg_port_create() and lagg_port_destroy(). They are serialized. The reader side always checks sc_count before accessing sc_ports, so this order should be sufficient for the writer side,

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 0333162da0d4..226565633b3a 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -879,7 +879,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
                CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries);
        else
                CK_SLIST_INSERT_HEAD(&sc->sc_ports, lp, lp_entries);
-       sc->sc_count++;
+       atomic_add_rel_int(&sc->sc_count, 1);
 
        lagg_setmulti(lp);
 
@@ -962,8 +962,8 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport)
        }
 
        /* Finally, remove the port from the lagg */
+       atomic_add_rel_int(&sc->sc_count, -1);
        CK_SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries);
-       sc->sc_count--;
 
        /* Update the primary interface */
        if (lp == sc->sc_primary) {

The reader side use atomic_load_acq_int() to get sc_count, then iterate sc_ports.

This is still not sufficient. The barrier just enforces an ordering of memory accesses.

Suppose a reader loads sc_count into a register, and then an interrupt arrives and the reader thread is preempted for a long time. Meanwhile, writer threads are updating the port list. When the reader resumes execution, the list might be completely different.

Jun 1 2026, 5:12 PM
zlei added inline comments to D57342: ip6: Drop dead code in ip6_input_hbh().
Jun 1 2026, 4:51 PM
zlei added a comment to D56942: lagg: Handle a port count of zero.

I'm OK with this revision, although I think an explicit memory barrier while increasing / decreasing sc->sc_count will make the code more clear than a NULL check in the reader side (lagg_rr_start).

A memory barrier isn't sufficient. For sc_count and length(sc_ports) to be consistent with each other, you need a mutex.

Jun 1 2026, 4:21 PM
zlei accepted D57154: net: Fix handling of unmapped user pages in if_getgroup().

Looks good to me.

Jun 1 2026, 3:52 PM
zlei added a comment to D57154: net: Fix handling of unmapped user pages in if_getgroup().
In D57154#1310272, @bms wrote:

This is giving me 2003 flashbacks.

Jun 1 2026, 3:35 PM
zlei accepted D56942: lagg: Handle a port count of zero.

I'm OK with this revision, although I think an explicit memory barrier while increasing / decreasing sc->sc_count will make the code more clear than a NULL check in the reader side (lagg_rr_start).

Jun 1 2026, 3:27 PM

May 22 2026

zlei abandoned D42647: tcp: Prefer EINVAL in case function not found.
May 22 2026, 12:06 PM
zlei added a comment to D57094: tests/net: Run all tests with execenv=jail and enable parallelism.

After @zlei work on VNET. I think it's better to remove is_exclusive=true.
Tested, LGTM

May 22 2026, 10:49 AM
zlei added a comment to D57154: net: Fix handling of unmapped user pages in if_getgroup().

@glebius
Of course acquiring per-interface lock is better than global one and looks like in this case it is possible.

Yes, that is perfect.

May 22 2026, 9:39 AM

May 18 2026

zlei added inline comments to D56942: lagg: Handle a port count of zero.
May 18 2026, 7:42 PM

May 15 2026

zlei added inline comments to D56942: lagg: Handle a port count of zero.
May 15 2026, 9:09 PM
zlei added a comment to D55203: svc_vc.c: Add support for an xp_extpg boolean.

Could you please take another look at this?
kib@ seems to think this is preferred to just
enabling it for all NICs.

I understand that it is only a "hint", since
routing can change at any time.
However, for an NFS server, routing is
unlikely to change without a NFS server
restart.

May 15 2026, 8:55 PM
zlei requested review of D57023: lagg: Fix SIOCSLAGG ioctl.
May 15 2026, 6:59 PM