diff options
| author | Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com> | 2026-01-31 23:25:13 +0100 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-02-03 15:13:25 +0100 |
| commit | 4fa4ac5e584841c0f9b01c2f7dd0c2e3caa8bca0 (patch) | |
| tree | 8f013c16118c69e87c97306fd73455feb9a6e310 /include/uapi/linux | |
| parent | 1247fb19cafee6f9fa350ae378e4e1e9965cc253 (diff) | |
tcp: accecn: add tcpi_ecn_mode and tcpi_option2 in tcp_info
Add 2-bit tcpi_ecn_mode feild within tcp_info to indicate which ECN
mode is negotiated: ECN_MODE_DISABLED, ECN_MODE_RFC3168, ECN_MODE_ACCECN,
or ECN_MODE_PENDING. This is done by utilizing available bits from
tcpi_accecn_opt_seen (reduced from 16 bits to 2 bits) and
tcpi_accecn_fail_mode (reduced from 16 bits to 4 bits).
Also, an extra 24-bit tcpi_options2 field is identified to represent
newer options and connection features, as all 8 bits of tcpi_options
field have been used.
Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Co-developed-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260131222515.8485-14-chia-yu.chang@nokia-bell-labs.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/tcp.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index dce3113787a7..03772dd4d399 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h @@ -226,6 +226,24 @@ enum tcp_ca_state { #define TCPF_CA_Loss (1<<TCP_CA_Loss) }; +/* Values for tcpi_ecn_mode after negotiation */ +#define TCPI_ECN_MODE_DISABLED 0x0 +#define TCPI_ECN_MODE_RFC3168 0x1 +#define TCPI_ECN_MODE_ACCECN 0x2 +#define TCPI_ECN_MODE_PENDING 0x3 + +/* Values for accecn_opt_seen */ +#define TCP_ACCECN_OPT_NOT_SEEN 0x0 +#define TCP_ACCECN_OPT_EMPTY_SEEN 0x1 +#define TCP_ACCECN_OPT_COUNTER_SEEN 0x2 +#define TCP_ACCECN_OPT_FAIL_SEEN 0x3 + +/* Values for accecn_fail_mode */ +#define TCP_ACCECN_ACE_FAIL_SEND BIT(0) +#define TCP_ACCECN_ACE_FAIL_RECV BIT(1) +#define TCP_ACCECN_OPT_FAIL_SEND BIT(2) +#define TCP_ACCECN_OPT_FAIL_RECV BIT(3) + struct tcp_info { __u8 tcpi_state; __u8 tcpi_ca_state; @@ -316,15 +334,17 @@ struct tcp_info { * in milliseconds, including any * unfinished recovery. */ - __u32 tcpi_received_ce; /* # of CE marks received */ + __u32 tcpi_received_ce; /* # of CE marked segments received */ __u32 tcpi_delivered_e1_bytes; /* Accurate ECN byte counters */ __u32 tcpi_delivered_e0_bytes; __u32 tcpi_delivered_ce_bytes; __u32 tcpi_received_e1_bytes; __u32 tcpi_received_e0_bytes; __u32 tcpi_received_ce_bytes; - __u16 tcpi_accecn_fail_mode; - __u16 tcpi_accecn_opt_seen; + __u32 tcpi_ecn_mode:2, + tcpi_accecn_opt_seen:2, + tcpi_accecn_fail_mode:4, + tcpi_options2:24; }; /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */ |
