Re: [PATCH net-next v2 1/2] tcp: add net.ipv4.tcp_l3mdev_exempt_ports sysctl

From: Kalash Nainwal

Date: Fri Nov 27 2026 - 17:14:31 EST


> [Severity: Medium]
> Could the commit message explain why a new UAPI knob was chosen instead
> of fixing the selection order in inet_lhash2_lookup() and
> inet6_lhash2_lookup()?

Yes, v3 adds that to the commit message. With both listeners present,
existing setups get a stable result that depends on creation order and
address family, and making the bound listener always win would change
that for every tcp_l3mdev_accept user. So the new behavior is opt-in
per port.

The SO_BINDTODEVICE case without a VRF is a fair point. The same
early return applies there, and this sysctl does not cover it, since
it is scoped to l3mdev traffic. A change to the lookup itself would
cover both cases.

Maintainers: if you would rather fix the selection order in
inet_lhash2_lookup() and inet6_lhash2_lookup() so that a matching
device-bound listener always wins, I am happy to rework the series that
way and drop the sysctl.

> [Severity: Low]
> Should the document leave the fast path columns empty for this field?

Yes, fixed in v3.