]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tcp: add TCP_SYNACK_RETRANS synack_type
authorChia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Sat, 31 Jan 2026 22:25:08 +0000 (23:25 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Feb 2026 14:13:24 +0000 (15:13 +0100)
Before this patch, retransmitted SYN/ACK did not have a specific
synack_type; however, the upcoming patch needs to distinguish between
retransmitted and non-retransmitted SYN/ACK for AccECN negotiation to
transmit the fallback SYN/ACK during AccECN negotiation. Therefore, this
patch introduces a new synack_type (TCP_SYNACK_RETRANS).

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260131222515.8485-9-chia-yu.chang@nokia-bell-labs.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/tcp.h
net/ipv4/tcp_output.c

index cace4fbe38d07e01a1c9e5cc8e4232edd28160a3..6c12be2cdd4d49360a6d43caa56f2fb327163033 100644 (file)
@@ -552,6 +552,7 @@ enum tcp_synack_type {
        TCP_SYNACK_NORMAL,
        TCP_SYNACK_FASTOPEN,
        TCP_SYNACK_COOKIE,
+       TCP_SYNACK_RETRANS,
 };
 struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
                                struct request_sock *req,
index b28596655d73d6a49bbc45f6b449beaae7dc9429..a1596fe8dd9f32839dbb1340995fc741cf9acd6b 100644 (file)
@@ -3929,6 +3929,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
 
        switch (synack_type) {
        case TCP_SYNACK_NORMAL:
+       case TCP_SYNACK_RETRANS:
                skb_set_owner_edemux(skb, req_to_sk(req));
                break;
        case TCP_SYNACK_COOKIE:
@@ -4614,7 +4615,7 @@ int tcp_rtx_synack(const struct sock *sk, struct request_sock *req)
        /* Paired with WRITE_ONCE() in sock_setsockopt() */
        if (READ_ONCE(sk->sk_txrehash) == SOCK_TXREHASH_ENABLED)
                WRITE_ONCE(tcp_rsk(req)->txhash, net_tx_rndhash());
-       res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_NORMAL,
+       res = af_ops->send_synack(sk, NULL, &fl, req, NULL, TCP_SYNACK_RETRANS,
                                  NULL);
        if (!res) {
                TCP_INC_STATS(sock_net(sk), TCP_MIB_RETRANSSEGS);