Page MenuHomeFreeBSD

zlei (Zhenlei Huang)
User

Projects (1)

User Details

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

Recent Activity

Yesterday

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

Sat, Oct 17

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

Looks sane to me.

Sat, Oct 17, 3:06 PM

Thu, Oct 15

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

Looks good to me.

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

Generally looks good to me.

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

Looks good to me.

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

Wed, Oct 14

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.

Wed, Oct 14, 3:42 PM

Tue, Oct 13

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

I like this idea !

Tue, Oct 13, 1:58 AM

Mon, Oct 12

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

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

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

Sun, Oct 11

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

Looks good to me.

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

Sat, Oct 10

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'

Sat, Oct 10, 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

May 13 2026

zlei added inline comments to D56954: rtnetlink: Check for allocation failure in nlattr_get_multipath().
May 13 2026, 3:25 AM

May 12 2026

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

Actually there are other sc members ( and other places sc->sc_count invoved ) not synchronized properly, I think on architectures with weak memory order they are easier to spot. Found that while I was working on PR 289017 .

Could you be more specific? I'm sure there are other problems, but this one is easy to trigger in practice.

May 12 2026, 7:46 PM
zlei added inline comments to D56954: rtnetlink: Check for allocation failure in nlattr_get_multipath().
May 12 2026, 10:14 AM
zlei added a comment to D56944: if_vxlan: Update *m0 after a pullup.

Emm, the if_vxlan(4) is not virtualized yet. @hrs attempted the first, me the second, and @kp the third. It is better to proceed to have tests for it.

Sorry, I don't quite follow what you're asking for?

May 12 2026, 10:05 AM

May 11 2026

zlei updated subscribers of D56944: if_vxlan: Update *m0 after a pullup.

Emm, the if_vxlan(4) is not virtualized yet. @hrs attempted the first, me the second, and @kp the third. It is better to proceed to have tests for it.

May 11 2026, 4:32 PM
zlei accepted D56944: if_vxlan: Update *m0 after a pullup.

Oops ! My stupid mistake.

May 11 2026, 4:17 PM
zlei added a comment to D56942: lagg: Handle a port count of zero.

Actually there are other sc members ( and other places sc->sc_count invoved ) not synchronized properly, I think on architectures with weak memory order they are easier to spot. Found that while I was working on PR 289017 .

May 11 2026, 3:46 PM

May 10 2026

zlei committed rGa08d321948ef: tests/carp: kill routed(8) before destroying interfaces (authored by glebius).
May 10 2026, 6:28 AM
zlei committed rG1f8eae9a7a45: tests/carp: make a 0.2 second pause before configuring second jail (authored by glebius).
May 10 2026, 6:28 AM
zlei committed rG19552d9749dd: tests/carp: make sleep interval in the wait loop smaller (authored by glebius).
May 10 2026, 6:28 AM
zlei committed rGf956c425d4c6: tests/carp: Rework unicast_v4.
May 10 2026, 6:27 AM
zlei added a comment to D55558: fix global demotion counter to VRRP advertisements.

Hi @olivier , I was about to MFC one fix to tests/sys/netinet/carp.sh and found this. Is stable/15 not affected by this issue ?

May 10 2026, 5:30 AM

May 9 2026

zlei committed rGad2fff6d6a4d: tests/carp: make a 0.2 second pause before configuring second jail (authored by glebius).
May 9 2026, 6:53 PM
zlei committed rG89096d660ea8: tests/carp: kill routed(8) before destroying interfaces (authored by glebius).
May 9 2026, 6:53 PM
zlei committed rG332485a47372: tests/carp: make sleep interval in the wait loop smaller (authored by glebius).
May 9 2026, 6:53 PM
zlei committed rG107ef0c29503: tests/carp: Rework unicast_v4.
May 9 2026, 6:53 PM
zlei updated subscribers of D55558: fix global demotion counter to VRRP advertisements.

Hi @oliver , I was about to MFC one fix to tests/sys/netinet/carp.sh and found this. Is stable/15 not affected by this issue ?

May 9 2026, 4:26 PM

May 7 2026

zlei added inline comments to D56497: virtio_p9fs: Fix kernel panic on module unload.
May 7 2026, 10:02 AM