Re: [PATCH packetdrill 2/2] net-test: pacetkdrill: Add ecn_mode, AccECN status, and tcpi_option2 in tcpi

0 views
Skip to first unread message

Neal Cardwell

unread,
Jan 19, 2026, 5:24:18 PM (9 days ago) Jan 19
to chia-y...@nokia-bell-labs.com, packe...@googlegroups.com, i...@kernel.org, koen.de_...@nokia-bell-labs.com, g.w...@cablelabs.com, ingemar.s...@ericsson.com, mirja.ku...@ericsson.com, ches...@apple.com, rs....@gmx.at, Jason_L...@comcast.com, vidhi...@apple.com
On Mon, Jan 19, 2026 at 1:56 PM <chia-y...@nokia-bell-labs.com> wrote:
>
> From: Chia-Yu Chang <chia-y...@nokia-bell-labs.com>
>
> 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. Also, 2-bit tcpi_accecn_opt_seen and 4-bit
> tcpi_accecn_fail_mode are added to indicate AccECN option status and
> AccECN fail mode, respectively.
>
> 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 already been used.
>
> Signed-off-by: Chia-Yu Chang <chia-y...@nokia-bell-labs.com>
> Co-developed-by: Neal Cardwell <ncar...@google.com>
> Signed-off-by: Neal Cardwell <ncar...@google.com>
> ---
> gtests/net/packetdrill/code.c | 4 ++++
> gtests/net/packetdrill/tcp.h | 25 +++++++++++++++++++++++--
> 2 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/gtests/net/packetdrill/code.c b/gtests/net/packetdrill/code.c
> index 7254fe4a4a0a..d90bffabcfe6 100644
> --- a/gtests/net/packetdrill/code.c
> +++ b/gtests/net/packetdrill/code.c
> @@ -207,6 +207,10 @@ static void write_tcp_info(struct code_state *code,
> emit_var(code, "tcpi_total_rto", info->tcpi_total_rto);
> emit_var(code, "tcpi_total_rto_recoveries", info->tcpi_total_rto_recoveries);
> emit_var(code, "tcpi_total_rto_time", info->tcpi_total_rto_time);
> + emit_var(code, "tcpi_ecn_mode", info->tcpi_ecn_mode);
> + emit_var(code, "tcpi_accecn_opt_seen", info->tcpi_accecn_opt_seen);
> + emit_var(code, "tcpi_accecn_fail_mode", info->tcpi_accecn_fail_mode);
> + emit_var(code, "tcpi_options2", info->tcpi_options2);
> emit_var(code, "tcpi_received_ce", info->tcpi_received_ce);
> emit_var(code, "tcpi_delivered_e1_bytes",
> info->tcpi_delivered_e1_bytes);
> diff --git a/gtests/net/packetdrill/tcp.h b/gtests/net/packetdrill/tcp.h
> index 12a4d11ebcf2..544d06e8d1b0 100644
> --- a/gtests/net/packetdrill/tcp.h
> +++ b/gtests/net/packetdrill/tcp.h
> @@ -113,6 +113,24 @@
>
> #define TCP_MD5_DIGEST_LEN 16 /* bytes in RFC2385 TCP MD5 digest */
>
> +/* 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)
> +
> /* A portable TCP header definition (Linux and *BSD use different names). */
> struct tcp {
> __be16 src_port;
> @@ -243,14 +261,17 @@ struct _tcp_info {
> * in milliseconds, including any
> * unfinished recovery.
> */
> - __u32 tcpi_received_ce; /* # of CE marks received */
> + __u32 tcpi_ecn_mode:2,
> + tcpi_accecn_opt_seen:2,
> + tcpi_accecn_fail_mode:4,
> + tcpi_options2:24;
> + __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;
> -
> };
>
> /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */
> --
> 2.34.1

Merged as the following commit:

https://github.com/google/packetdrill/commit/9ee1eb4e607391f09c71c37cfac94bcc616c7c0a

neal
Reply all
Reply to author
Forward
0 new messages