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.
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -226,6 +226,24 @@ enum tcp_ca_state { · 225 unmodified lines | |||
| 226 | #define TCPF_CA_Loss (1<<TCP_CA_Loss) | 226 | #define TCPF_CA_Loss (1<<TCP_CA_Loss) |
| 227 | }; | 227 | }; |
| 228 | 228 | ||
| 229 | /* Values for tcpi_ecn_mode after negotiation */ | ||
| 230 | #define TCPI_ECN_MODE_DISABLED 0x0 | ||
| 231 | #define TCPI_ECN_MODE_RFC3168 0x1 | ||
| 232 | #define TCPI_ECN_MODE_ACCECN 0x2 | ||
| 233 | #define TCPI_ECN_MODE_PENDING 0x3 | ||
| 234 | |||
| 235 | /* Values for accecn_opt_seen */ | ||
| 236 | #define TCP_ACCECN_OPT_NOT_SEEN 0x0 | ||
| 237 | #define TCP_ACCECN_OPT_EMPTY_SEEN 0x1 | ||
| 238 | #define TCP_ACCECN_OPT_COUNTER_SEEN 0x2 | ||
| 239 | #define TCP_ACCECN_OPT_FAIL_SEEN 0x3 | ||
| 240 | |||
| 241 | /* Values for accecn_fail_mode */ | ||
| 242 | #define TCP_ACCECN_ACE_FAIL_SEND BIT(0) | ||
| 243 | #define TCP_ACCECN_ACE_FAIL_RECV BIT(1) | ||
| 244 | #define TCP_ACCECN_OPT_FAIL_SEND BIT(2) | ||
| 245 | #define TCP_ACCECN_OPT_FAIL_RECV BIT(3) | ||
| 246 | |||
| 229 | struct tcp_info { | 247 | struct tcp_info { |
| 230 | __u8 tcpi_state; | 248 | __u8 tcpi_state; |
| 231 | __u8 tcpi_ca_state; | 249 | __u8 tcpi_ca_state; |
| @@ -316,15 +334,17 @@ struct tcp_info { · 84 unmodified lines | |||
| 316 | * in milliseconds, including any | 334 | * in milliseconds, including any |
| 317 | * unfinished recovery. | 335 | * unfinished recovery. |
| 318 | */ | 336 | */ |
| 319 | __u32 tcpi_received_ce; /* # of CE marks received */ | 337 | __u32 tcpi_received_ce; /* # of CE marked segments received */ |
| 320 | __u32 tcpi_delivered_e1_bytes; /* Accurate ECN byte counters */ | 338 | __u32 tcpi_delivered_e1_bytes; /* Accurate ECN byte counters */ |
| 321 | __u32 tcpi_delivered_e0_bytes; | 339 | __u32 tcpi_delivered_e0_bytes; |
| 322 | __u32 tcpi_delivered_ce_bytes; | 340 | __u32 tcpi_delivered_ce_bytes; |
| 323 | __u32 tcpi_received_e1_bytes; | 341 | __u32 tcpi_received_e1_bytes; |
| 324 | __u32 tcpi_received_e0_bytes; | 342 | __u32 tcpi_received_e0_bytes; |
| 325 | __u32 tcpi_received_ce_bytes; | 343 | __u32 tcpi_received_ce_bytes; |
| 326 | __u16 tcpi_accecn_fail_mode; | 344 | __u32 tcpi_ecn_mode:2, |
| 327 | __u16 tcpi_accecn_opt_seen; | 345 | tcpi_accecn_opt_seen:2, |
| 346 | tcpi_accecn_fail_mode:4, | ||
| 347 | tcpi_options2:24; | ||
| 328 | }; | 348 | }; |
| 329 | 349 | ||
| 330 | /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */ | 350 | /* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */ |