From patchwork Fri Oct 20 05:32:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhai X-Patchwork-Id: 15653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp839049vqb; Thu, 19 Oct 2023 22:33:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMVJwPF94V70SroqAzc1a21744l1rFzg5CIqlx9pWGlPHdKpmu7qIEXhwH/aNjMCSBgLfw X-Received: by 2002:a05:6358:91a1:b0:164:a5c0:46a5 with SMTP id j33-20020a05635891a100b00164a5c046a5mr839559rwa.12.1697779995934; Thu, 19 Oct 2023 22:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697779995; cv=none; d=google.com; s=arc-20160816; b=KsFREeL/Vgo0UdOGGMvbDiF2ustZRaILiRW1st5nFOZY+wocg/0adm+GpjC4L0bzDG 4qR5C7bC+9OjQF8Bym9wQFXse4V732qXobEHtvv14qBd9B7Q3qPH6t3QvqQXXHPvsBcp nH9MhMu5SjAio69BVJlMHoWSjkSmeGLjW72MBrV9AxHiCOHAvkql3b2NDDta8bGNX6bX yWfkpJpe5swuJOwnNbEvoXuRNqe5l8eZAUJ5FjW7lVJEyFDl3kyfeg15iAfxCy5QnQ+2 5eUgNpjCnTpMeA0PPRyH+htrV6zJIPZs4tOvI6SIRQnTy1hcu+i/+rP3Ho0bbJObJKaJ sFow== 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=gIgRMVZRHWuc6XXVkWqSeW2ex2b1ilZhxXYHLgoWugw=; fh=pcqFZQYW2ZOvrJzL6iYbdBSsYjMBR+cDRZVlzaRzt/k=; b=EkZVqbeng9U3SJHJazB01Gpzi/ThGfs1ri2N86T9/sK7iMfSOpzC1Tp3qyijmj8Z2A hSoBIkjJSq4UAmPasVs/P1sNc6F/LS32teHPU9WPofE/BZZXqFrrEsGoIipmzASGuKae HEJphwjtZz1H6S+CXDVytwg/RGqGDtM5vYQ4rNPgBgBa7xU0tnWDX/3ayVyks9sXfmvZ pT7EVYQyqCTnIACz2YrBxv5KaLHXKv2EKjkELOKiRt+kZYvcGpJ8WZDDmtzQALDF0idR 4UyXJbabG/rQ9qeZ42CYYEox81OSFpIVv+PSH5Xf9OBD6XF/XWfiCX5R0SWcRqLa/mRI M8ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="DOiEkaj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z186-20020a6333c3000000b005b7e70085dcsi1112749pgz.433.2023.10.19.22.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 22:33:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b="DOiEkaj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id CDDD082DC63B; Thu, 19 Oct 2023 22:33:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345176AbjJTFcv (ORCPT + 25 others); Fri, 20 Oct 2023 01:32:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbjJTFcu (ORCPT ); Fri, 20 Oct 2023 01:32:50 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E3DD119 for ; Thu, 19 Oct 2023 22:32:48 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-66cee0d62fbso3190036d6.3 for ; Thu, 19 Oct 2023 22:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1697779967; x=1698384767; 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=gIgRMVZRHWuc6XXVkWqSeW2ex2b1ilZhxXYHLgoWugw=; b=DOiEkaj/uhP6PcnrvTJGVIXCo55WXYXvwiU6o//9FErDjmw/BxHAnBrux42mxyLm5n 8uVB90n8O5iDM/YuauzEK3I/dL0LmeL/wSepWeshU3Tp8Ec4i89wCALMXjakNZOHFMFw YZAhtF7Ai0XgIdkUIe3DTLH9WzRtwca8VHdui0UwGolpRucGmeVnhjGduVzd5C4pTYrN PR0htwUij43npmf2puO5NDd380CrOVgIF20Uv/A5hLu6dKDNtzQec8Ah5z8PEWVIm5j9 62DD01Hvm7Qqy0mGhayJyPy/OOGM8njkOrwJ0tbprfAxiqBYFQW1/lsmjZXFaC4+1D42 v7FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697779967; x=1698384767; 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=gIgRMVZRHWuc6XXVkWqSeW2ex2b1ilZhxXYHLgoWugw=; b=qLu6rQpAPiMk1hzw/V9rXfNxYQP9tULFJ1LKtzbhesne2PE3f+vpgkKaPheAQgnIOA p7wp7R8DWQOOmvLV0XgsLj9W40Cvmc8CGuu4oI9dbtqbpr4a4qcCZKgd1haJ+n8roA0t K2tFZMnBTsk21LtcscQL22YvBeR6np44vtcY1SDVf6YRYsezRlOOKvGVsXp8cIbFYWTy kPtobRliVoZ+mcWxH9WIyE6xmuULqSg6f0vjPK0KcRms5tA9Ubu38pRZMRq0mlRp/eIg I39lBLkLmggpPc+x9pWOZykHnCFEOp+Gbc4lJUz4qOtPOQdm4cpaYCJRz84+xAAXugcr sxSg== X-Gm-Message-State: AOJu0Yw+WmUfSSh52FDztkAJpj4PtOCeZdYBjpxQpgub+EoWDRm+78Gu 5CqOczdzto65lDACOcIYw+cSZg== X-Received: by 2002:a05:6214:2a8e:b0:66d:51cd:d7e9 with SMTP id jr14-20020a0562142a8e00b0066d51cdd7e9mr874539qvb.43.1697779967702; Thu, 19 Oct 2023 22:32:47 -0700 (PDT) Received: from debian.debian ([140.141.197.139]) by smtp.gmail.com with ESMTPSA id vq6-20020a05620a558600b0076e672f535asm359050qkn.57.2023.10.19.22.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 22:32:47 -0700 (PDT) Date: Thu, 19 Oct 2023 22:32:46 -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 v3 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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 22:33:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780251357242607606 X-GMAIL-MSGID: 1780251357242607606 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 on IPv6 output: * drop dst_allfrag check, which is always false now * 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: V2 -> V3: split the changes to separate commits as Willem de Bruijn suggested V1 is incorrect and omitted V2: https://lore.kernel.org/netdev/ZS1%2Fqtr0dZJ35VII@debian.debian/ Yan Zhai (3): ipv6: remove dst_allfrag test on ipv6 output ipv6: refactor ip6_finish_output for GSO handling ipv6: avoid atomic fragment on GSO packets net/ipv6/ip6_output.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-)