Re: [PATCH net-next v4] tcp: add TCP_ECN and TCP_ECN_OPTION socket options
From: Jakub Kicinski
Date: Mon Sep 21 2026 - 18:27:12 EST
On Wed, 16 Sep 2026 10:32:55 +0530 Irlanki Sandeep wrote:
> Currently, ECN and Accurate ECN (AccECN) configurations in the Linux
> kernel are controlled globally via the net.ipv4.tcp_ecn and
> net.ipv4.tcp_ecn_option sysctl variables. This global approach lacks the
> granularity required for modern multi-application runtimes.
>
> In diverse network environments (such as mobile operating systems like
> Android), different applications route their traffic over distinct
> physical and virtual interfaces (cellular, Wi-Fi, VPNs, etc.). In the
> wild, certain legacy network paths or misconfigured middleboxes (such as
> routers, DPIs, or firewalls) are known to blackhole packets with ECN
> negotiation flags in the SYN, or silently drop packets containing AccECN
> option headers during active sessions.
My gut reaction is that we shouldn't be adding a setsockopt here.
This is a routing property, really, IIUC you're adding the setsockopt
because you want to use BPF, in which case isn't it better to add
a kfunc for this? Why go thru all the sockopt plumbing?
TCP maintainers, WDYT?