tcp: small optimization when TCP_TW_SYN is processed
Subsystems (3)
PATCH 1/1 tcp: small optimization when TCP_TW_SYN is processed
When TCP_TW_SYN is processed, we perform a lookup to find a listener and jump back in tcp_v6_rcv() and tcp_v4_rcv()
Paolo suggested that we do not have to check if the found socket is a TIME_WAIT or NEW_SYN_RECV one.
Suggested-by Paolo Abeni <[email protected]>
Signed-off-by Eric Dumazet <[email protected]>
Cc Neal Cardwell <[email protected]>
--- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +1 -1
@@ -2205,7 +2205,6 @@ int tcp_v4_rcv(struct sk_buff *skb)if (!sk) goto no_tcp_socket; -process:if (sk->sk_state ==TCP_TIME_WAIT ) goto do_time_wait;
@@ -2285,6 +2284,7 @@ int tcp_v4_rcv(struct sk_buff *skb) } } +process:if (static_branch_unlikely (&ip4_min_ttl)) {/* min_ttl can be changed concurrently from do_ip_setsockopt() */ if (unlikely (iph->ttl <READ_ONCE (inet_sk (sk)->min_ttl))) {
net/ipv6/tcp_ipv6.c +1 -1
@@ -1794,7 +1794,6 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)if (!sk) goto no_tcp_socket; -process:if (sk->sk_state ==TCP_TIME_WAIT ) goto do_time_wait;
@@ -1871,6 +1870,7 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) } } +process:if (static_branch_unlikely (&ip6_min_hopcount)) {/* min_hopcount can be changed concurrently from do_ipv6_setsockopt() */ if (unlikely (hdr->hop_limit <READ_ONCE (tcp_inet6_sk (sk)->min_hopcount))) {
Signature · 1 line
2.44.0.478.gd926399ef9-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Thu, 11 Apr 2024 08:25:29 +0000 you wrote:
When
TCP_TW_SYNis processed, we perform a lookup to find a listener and jump back intcp_v6_rcv()andtcp_v4_rcv()Paolo suggested that we do not have to check if the found socket is a
TIME_WAITorNEW_SYN_RECVone.
Quoted 6 lines
Suggested-by Paolo Abeni <[email protected]>Signed-off-by Eric Dumazet <[email protected]>Cc Neal Cardwell <[email protected]>[...]
Here is the summary with links:
- [net-next] tcp: small optimization when TCP_TW_SYN is processed
https://git.kernel.org/netdev/net-next/c/d13b05962369
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html