This patch fixes an issue in skb_gso_network_seglen where the calculated segment length includes the HBH headers of BIG TCP jumbograms despite these headers being removed before segmentation. These headers are added by GRO or by ip6_xmit for BIG TCP packets and are later removed by GSO. This bug causes MTU validation of BIG TCP jumbograms to fail. Signed-off-by: Mariusz Klimek --- net/core/gso.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/core/gso.c b/net/core/gso.c index bcd156372f4d..251a49181031 100644 --- a/net/core/gso.c +++ b/net/core/gso.c @@ -180,6 +180,10 @@ static unsigned int skb_gso_network_seglen(const struct sk_buff *skb) unsigned int hdr_len = skb_transport_header(skb) - skb_network_header(skb); + /* Jumbogram HBH header is removed upon segmentation. */ + if (skb->protocol == htons(ETH_P_IPV6) && skb->len > IPV6_MAXPLEN) + hdr_len -= sizeof(struct hop_jumbo_hdr); + return hdr_len + skb_gso_transport_seglen(skb); } -- 2.47.3 This patch removes the IP6SKB_FAKEJUMBO flag that is used as a work-around to bypass MTU validation of BIG TCP jumbograms due to a bug in skb_gso_network_seglen. This work-around is no longer required now that the bug is fixed. Signed-off-by: Mariusz Klimek --- include/linux/ipv6.h | 1 - net/ipv6/ip6_output.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 7294e4e89b79..9f076171106e 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -155,7 +155,6 @@ struct inet6_skb_parm { #define IP6SKB_L3SLAVE 64 #define IP6SKB_JUMBOGRAM 128 #define IP6SKB_SEG6 256 -#define IP6SKB_FAKEJUMBO 512 #define IP6SKB_MULTIPATH 1024 #define IP6SKB_MCROUTE 2048 }; diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index f904739e99b9..9af9ec6bdb8c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -179,8 +179,7 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk, static int ip6_finish_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb, unsigned int mtu) { - if (!(IP6CB(skb)->flags & IP6SKB_FAKEJUMBO) && - !skb_gso_validate_network_len(skb, mtu)) + if (!skb_gso_validate_network_len(skb, mtu)) return ip6_finish_output_gso_slowpath_drop(net, sk, skb, mtu); return ip6_finish_output2(net, sk, skb); @@ -323,7 +322,6 @@ int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, proto = IPPROTO_HOPOPTS; seg_len = 0; - IP6CB(skb)->flags |= IP6SKB_FAKEJUMBO; } skb_push(skb, sizeof(struct ipv6hdr)); -- 2.47.3 This patch removes the manual lowering of the client MTU in big_tcp.sh. The MTU lowering was previously required as a work-around due to a bug in the MTU validation of BIG TCP jumbograms. The MTU was lowered to 1442, but note that 1492 (1500 - 8) would of worked just as well. Now that the bug has been fixed, the manual client MTU modification can be removed entirely. Signed-off-by: Mariusz Klimek --- tools/testing/selftests/net/big_tcp.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/net/big_tcp.sh b/tools/testing/selftests/net/big_tcp.sh index 2db9d15cd45f..b5d9145296d3 100755 --- a/tools/testing/selftests/net/big_tcp.sh +++ b/tools/testing/selftests/net/big_tcp.sh @@ -32,7 +32,6 @@ setup() { ip -net $ROUTER_NS link add link2 type veth peer name link3 netns $SERVER_NS ip -net $CLIENT_NS link set link0 up - ip -net $CLIENT_NS link set link0 mtu 1442 ip -net $CLIENT_NS addr add $CLIENT_IP4/24 dev link0 ip -net $CLIENT_NS addr add $CLIENT_IP6/64 dev link0 nodad ip -net $CLIENT_NS route add $SERVER_IP4 dev link0 via $CLIENT_GW4 -- 2.47.3