Re: [bisected] xfrm: TCP connection initiating PMTU discovery stalls on v3.

Eric Dumazet
2014-12-10T19:10:06Z

On Wed, 2014-12-10 at 19:34 +0100, Wolfgang Walter wrote:

> So gso is on. When the hang happens sk_setup_caps is called from
> inet_sk_rebuild_header(). Now the path
>
> sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
>
> is taken as dst->header_len is now non zero.
>
> This is the reason why later calls of sk_can_gso() return false.
>
> I'll try to change the above patch to
>
> @@ -1585,6 +1585,8 @@ void sk_setup_caps(struct sock *sk, struct dst_entry
> *dst) sk->sk_gso_max_size = dst->dev->gso_max_size;
> sk->sk_gso_max_segs = dst->dev->gso_max_segs;
> }
> }
> + if (sk_can_gso(sk)) {
> + sk->sk_gso_max_segs = 1;
> }
> }
> EXPORT_SYMBOL_GPL(sk_setup_caps);
>
> so that the case that GSO is disabled because of dst->header_len != 0 sets
> sk_gso_max_segs, too.

Sounds good, or maybe simply :

diff --git a/net/core/sock.c b/net/core/sock.c
index 9a56b2000c3f374fb95aedada3327447816a9512..edca31319dfee57cabe5b376505324bea07f767a 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1577,6 +1577,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
if (sk->sk_route_caps & NETIF_F_GSO)
sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
sk->sk_route_caps &= ~sk->sk_route_nocaps;
+ sk->sk_gso_max_segs = 1;
if (sk_can_gso(sk)) {
if (dst->header_len) {
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;