On 6/4/26 11:22 PM, Neil Spring wrote:
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 7995a89bafc9..fc8e886f7791 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -5020,8 +5020,10 @@ static void tcp_rcv_spurious_retrans(struct sock *sk,
>           skb->protocol == htons(ETH_P_IPV6) &&
>           (tcp_sk(sk)->inet_conn.icsk_ack.lrcv_flowlabel !=
>            ntohl(ip6_flowlabel(ipv6_hdr(skb)))) &&
> -         sk_rethink_txhash(sk))
> +         sk_rethink_txhash(sk)) {
>               NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPDUPLICATEDATAREHASH);
> +             __sk_dst_reset(sk);

Instead of touchin all the sk_rethink_txhash() call-sites, I'm wondering
if the __sk_dst_reset() could be placed directly into
sk_rethink_txhash() ? Note that this patch does not touch the
dst_negative_advice() caller.

> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index 0a88b376141d..7a2b1de7487c 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -823,6 +823,9 @@ int inet6_sk_rebuild_header(struct sock *sk)
>       fl6->flowi6_uid = sk_uid(sk);
>       security_sk_classify_flow(sk, flowi6_to_flowi_common(fl6));
>  
> +     if (ip6_multipath_hash_policy(sock_net(sk)) == 0 && sk->sk_txhash)
> +             fl6->mp_hash = (sk->sk_txhash >> 1) ?: 1;

I think you could place the above logic in a shared helper and re-use it
in several places below to avoid code duplication.

/P


Reply via email to