From patchwork Tue Oct 24 02:35:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhai X-Patchwork-Id: 15790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1677291vqx; Mon, 23 Oct 2023 19:36:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgZAKHuAaenxcZTvQL29qIkrulEt2T66U94x9YJBCTEvsBzLu3CtHpZ3IliC+sBWySAjWT X-Received: by 2002:a62:7911:0:b0:68b:e29c:b69 with SMTP id u17-20020a627911000000b0068be29c0b69mr13415697pfc.9.1698114972001; Mon, 23 Oct 2023 19:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698114971; cv=none; d=google.com; s=arc-20160816; b=awnz6lbZdMEO6VOAS72/vqoKwNh/BBaWC20z/35GkrSps1BtRkP1oXjqmdfq433cFu OnEAoLtU6IYyZy74jgBVuFVr8ZOJtwE5qap5W4puOzQM6Ut34XFKv7989SGctXlYCrAo +4YF7PM8HemOOMjxdmmup9tXdrr7fLXH+5n84lSoeJ0YiDjd4w38vpgz+sXGOopF5MjQ mTEO+E+Zc85g3LbST07LNgrcPHPaRCdFK6IVN4VddvLQL7uTdAk6N9bpdfjxy9wd1ASO mJhp5P8kBGEISiTz+kDJ58wu4GFKn3Q7vNhhPsdC3u6o5zDPIQiV2F8yOduVfrFIccL+ e95w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=+gVTnJsyvkPl/EqbN7quO86+jwMpzGyV8aZcsQmMn3o=; fh=pcqFZQYW2ZOvrJzL6iYbdBSsYjMBR+cDRZVlzaRzt/k=; b=z9e8+9PGwVxotKB5uFO1Qqmt4u+hua8AC4HGl+RQmBzY0YIlxPtNfNtOJB/9DP6bqN 2tYIyXxBC3mjEWRV4tbT6bqQW5d9m1SXM4VcyvqZXerw+1/43xT2DbhM5k3Y4HNShrc7 j/K9ikRWSy3JJQCrb4pkSyV0C08IHCHQWnAU5yeVhDnSnu/k/54vCYOoZvrxLJMr+7DP nJrTub01vSqYElFORxgr+fc1IVROMIYq4AmukHsKvyeG0dIeyChc8PwuUfXj9qNOeDEx L+pmRptJklDiEtaHXgjG8JaJ7Ner+jAgVXCbIMj3TO8g5Tbo8tGGxIeN1+YNs7M9kjzW 99Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=AptnH0WZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z8-20020a6553c8000000b00578c64433c9si7505538pgr.894.2023.10.23.19.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 19:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=AptnH0WZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E7DD7809BBAC; Mon, 23 Oct 2023 19:36:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232098AbjJXCfn (ORCPT + 27 others); Mon, 23 Oct 2023 22:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232023AbjJXCfk (ORCPT ); Mon, 23 Oct 2023 22:35:40 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E197A10C9 for ; Mon, 23 Oct 2023 19:35:34 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-41cc75c55f0so40937551cf.1 for ; Mon, 23 Oct 2023 19:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1698114934; x=1698719734; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=+gVTnJsyvkPl/EqbN7quO86+jwMpzGyV8aZcsQmMn3o=; b=AptnH0WZ0QYy0jCnG3Thqw16AK5RZ9P9sYgenUhjImzFJoV+yLJF9msUGUWeTMqp8K Bqf21YrgqoPWuWNNO/JCE+RhfR4N9Rm+8mC3S11H1o5s1YCMdh2AJNWIt9tVlSr1/uOn f6ByLRNTfZ8KwZ8cW4SaucuWhHP8yuiKrTBf1xk7d32iyzU3B0lvToNPrPmR2wS2NCPA DUZngWEHAYVpUlP3UkLH+Ms9cpdfKxruFeKpm9odGImG1EWfAaby/JoIF922JlHldSsh vZty9D0kZF3041uHLiyQYH62jtNVxZVnX6DRswgq4lBGsT6VLJSSgBRvphZaVkoJ0WEP DCKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698114934; x=1698719734; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+gVTnJsyvkPl/EqbN7quO86+jwMpzGyV8aZcsQmMn3o=; b=eRM7rQIKtAnvputXcnRTd+wE6uiq5Xzd9v81fv5wnSKV/K+Euc6RZ64/SYosOm+59c MCRhNJEyioAHS4rNKGzi1nVS1q/cbu5vMKWj/1xwqkWdEpimcQn8VJZajIhc3kA1L52M tUk54kS5quLdUJ+gd6yU+qbcL46BspY8syK/r3BdOTSmvtXQzha0xdcCK3PRtMgD+7/u ooHVIM7ONBJGiW/1DBkPygtIOVZguW0nvDEBsgfxVBvWOzUCE/G1kNzk8lWCxH82W16r 8sa9qTqoOGd79v6d5WM0+wR+HzNyt1NpOd6sDHXMP+7IYqmiDD39ERXHomoniOEvw12g Aflg== X-Gm-Message-State: AOJu0YxbuWGe1DF6tnVEsuT5XyCCkZuYH6nXaMX1EbAbc9FB/fYCHEnq dPXePY4KYmn/aBwbH/eBgXCnlr4DXeput19PbG939w== X-Received: by 2002:ac8:5a54:0:b0:403:abf5:6865 with SMTP id o20-20020ac85a54000000b00403abf56865mr15110377qta.18.1698114933933; Mon, 23 Oct 2023 19:35:33 -0700 (PDT) Received: from debian.debian ([140.141.197.139]) by smtp.gmail.com with ESMTPSA id kr25-20020ac861d9000000b004181c32dcc3sm3144313qtb.16.2023.10.23.19.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 19:35:33 -0700 (PDT) Date: Mon, 23 Oct 2023 19:35:32 -0700 From: Yan Zhai To: netdev@vger.kernel.org Cc: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Aya Levin , Tariq Toukan , linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Florian Westphal , Willem de Bruijn , Alexander H Duyck Subject: [PATCH v4 net-next 0/3] ipv6: avoid atomic fragment on GSO output Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 19:36:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780602604952489284 X-GMAIL-MSGID: 1780602604952489284 When the ipv6 stack output a GSO packet, if its gso_size is larger than dst MTU, then all segments would be fragmented. However, it is possible for a GSO packet to have a trailing segment with smaller actual size than both gso_size as well as the MTU, which leads to an "atomic fragment". Atomic fragments are considered harmful in RFC-8021. An Existing report from APNIC also shows that atomic fragments are more likely to be dropped even it is equivalent to a no-op [1]. The series contains following changes: * drop feature RTAX_FEATURE_ALLFRAG, which has been broken. This helps simplifying other changes in this set. * refactor __ip6_finish_output code to separate GSO and non-GSO packet processing, mirroring IPv4 side logic. * avoid generating atomic fragment on GSO packets. Link: https://www.potaroo.net/presentations/2022-03-01-ipv6-frag.pdf [1] change log: V3 -> V4: cleaned up all RTAX_FEATURE_ALLFRAG code, rather than just drop the check at IPv6 output. V2 -> V3: split the changes to separate commits as Willem de Bruijn suggested V1 is incorrect and omitted V3: https://lore.kernel.org/netdev/cover.1697779681.git.yan@cloudflare.com/ V2: https://lore.kernel.org/netdev/ZS1%2Fqtr0dZJ35VII@debian.debian/ Yan Zhai (3): ipv6: drop feature RTAX_FEATURE_ALLFRAG ipv6: refactor ip6_finish_output for GSO handling ipv6: avoid atomic fragment on GSO packets include/net/dst.h | 7 ----- include/net/inet_connection_sock.h | 1 - include/net/inet_sock.h | 2 +- include/uapi/linux/rtnetlink.h | 2 +- net/ipv4/tcp_output.c | 20 +------------ net/ipv6/ip6_output.c | 45 ++++++++++++++++-------------- net/ipv6/tcp_ipv6.c | 1 - net/ipv6/xfrm6_output.c | 2 +- net/mptcp/subflow.c | 1 - 9 files changed, 28 insertions(+), 53 deletions(-)