Message ID | e721c615e22fc4d3d53bfa230d5d71462ae9c9a8.1697779681.git.yan@cloudflare.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp839006vqb; Thu, 19 Oct 2023 22:33:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRfyJLuZzO0SHbTj/znjNrUi3kxNt34zy6IzT6N+Af+d+YXfShd+Z7RQ+V+sygffrc9JPl X-Received: by 2002:a05:6358:5384:b0:166:c004:f657 with SMTP id z4-20020a056358538400b00166c004f657mr773969rwe.14.1697779989553; Thu, 19 Oct 2023 22:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697779989; cv=none; d=google.com; s=arc-20160816; b=vM8+8nTptLgvyAhWPoYFN3jzSnAtKqZOGYDnrrrtbttjQEjuzisgakJztkA7V9cPTe Yb3uFPf5WptH8cN56aSuTG1TepxmzMFbvJkC3Fo/2Uhk2loBgL2nd6ffYnrTXWARmJLW Q1Of7ud1gEn2VD9CWFhTe9Ee8ztJiA31UdYyClzJaqK+CaaCUG/UsHkx0xdb/3Lh1+sZ p7iKQuVmUudrGn16WnnDw63xuQD+YoWw7oOoaVwzyc5XXTuLZcNbxgRG0B1QMOwngDMb eiUeu1cFLc9z2nHDCTE+/LEQl4Lbq2sol8Pzw7UwMbIqvQkfdlgldTSHf0IQNP02Th2n VjOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KV869UUQKRDRmnZ80A1/n7z6+idYBNckQF54inYjS5g=; fh=pcqFZQYW2ZOvrJzL6iYbdBSsYjMBR+cDRZVlzaRzt/k=; b=ndFdR14dUKkq+8h6smBTY3wgwc9rqS8ZJgfj6JpQj/EK6IGKQYSZ+9wdifpLXMl1Mu kjT1l3XAQCtZ78UM67gvahGtOJBFhDMxAsly8QMO0h0Foc/piWQysUZ5bNoN44lhliyx UyfT0/8+KZ+t9f5GmcaRafyJdBIt2yZk4OU4JIXkZs2/LPN4Vk4BKG2GpRapfgKuUKt9 T8nH95WIMFI1CCiCD4RdldqGEhqXKbuFZMWvPG8gVgtWDedl2ZQMjEh9Dtpsr500hlR/ G0tQp36n+m6mgyvJGw+LYErvAnYAuzi7g+GfMnV4evVTNdaEWb7RMXZxvW/Kosi3aS6K CElQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=HzbvMgu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id a28-20020aa7971c000000b006bd3ba8e610si1149010pfg.133.2023.10.19.22.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 22:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google09082023 header.b=HzbvMgu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 3A09981D0B75; Thu, 19 Oct 2023 22:33:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346301AbjJTFcx (ORCPT <rfc822;lkml4gm@gmail.com> + 25 others); Fri, 20 Oct 2023 01:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345460AbjJTFcv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Oct 2023 01:32:51 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E20119 for <linux-kernel@vger.kernel.org>; Thu, 19 Oct 2023 22:32:50 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-7781bc3783fso28481585a.1 for <linux-kernel@vger.kernel.org>; Thu, 19 Oct 2023 22:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google09082023; t=1697779969; x=1698384769; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KV869UUQKRDRmnZ80A1/n7z6+idYBNckQF54inYjS5g=; b=HzbvMgu0lCF6faIChfXVinjI8bdH8kCWR2utK3tXvu34fwxKuN+u7vQC/G26UceGv+ SzAlBbmmwoyVsMMJDSYTFzUfmx4HYcSpKW17SlKRor46zKxpjr6mwSaGGbxtPh0q8TgV yFKM4Ca7zSRagheV0IgDbFz4qAx4bITuix1XYKvWn7fxL9oGRbvNwfXRzE8OlLpwFzQo ypWPvQR5Vq97WzVambzsJJY1rCxxp6gIoMAoPfLEWaABiCZp25xVa0DQyTSr5qstDPcT 5/t822WT84u42eN7Th3pb3hEGHGm5n+IjmmX95weEKhR59aX+AtSUMlj/PwMdXA9gR5B QijA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697779969; x=1698384769; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KV869UUQKRDRmnZ80A1/n7z6+idYBNckQF54inYjS5g=; b=InDf4XvD41ZbSPhNdaEm3e4Boi0Hzj6IYf+Anot8dUrsuXNTVEwr6lcvzimQ1DKg3R 8ah+ooL6i1yrqtqHvjuq6rgyiLheQbBm1m4SFyoBw1pxHbw/C//cqppNX5HD/3H+HAWa EUGEBd/zLHS6IviRztucY3i+kaRZNDXHNI7wfidOTRvltcwYJX3ZqVXdseB69LjlqJ1R ksWyijcKlH1b2gObv7wseYtbmMDll0Td7Zk8EyWOlrKq+ul3shyb4KTuEVEEznzxoGnU rXJL2gdSbZ6rkkDPsndmNaHeAvSvQpywp0CT96u5tIMikNFjotT7Dg72y9bX0YH251BI 8ceA== X-Gm-Message-State: AOJu0YzOeXToSj8dBFkB7bqqaN0w1moI0iSFF27n9lFJDQspxMtuhVoP yJjHEoF5v56vZ61h48yOeUvD0Q== X-Received: by 2002:a05:6214:d66:b0:66d:1e25:9774 with SMTP id 6-20020a0562140d6600b0066d1e259774mr916666qvs.61.1697779969555; Thu, 19 Oct 2023 22:32:49 -0700 (PDT) Received: from debian.debian ([140.141.197.139]) by smtp.gmail.com with ESMTPSA id g20-20020ad457b4000000b0065d0dcc28e3sm421513qvx.73.2023.10.19.22.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 22:32:49 -0700 (PDT) Date: Thu, 19 Oct 2023 22:32:47 -0700 From: Yan Zhai <yan@cloudflare.com> To: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, David Ahern <dsahern@kernel.org>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Aya Levin <ayal@nvidia.com>, Tariq Toukan <tariqt@nvidia.com>, linux-kernel@vger.kernel.org, kernel-team@cloudflare.com, Florian Westphal <fw@strlen.de>, Willem de Bruijn <willemdebruijn.kernel@gmail.com>, Alexander H Duyck <alexander.duyck@gmail.com> Subject: [PATCH v3 net-next 1/3] ipv6: remove dst_allfrag test on ipv6 output Message-ID: <e721c615e22fc4d3d53bfa230d5d71462ae9c9a8.1697779681.git.yan@cloudflare.com> References: <cover.1697779681.git.yan@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <cover.1697779681.git.yan@cloudflare.com> 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 22:33:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780251350486325310 X-GMAIL-MSGID: 1780251350486325310 |
Series |
ipv6: avoid atomic fragment on GSO output
|
|
Commit Message
Yan Zhai
Oct. 20, 2023, 5:32 a.m. UTC
dst_allfrag was added before the first git commit:
https://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03399.html
The feature would send packets to the fragmentation path if a box
receives a PMTU value with less than 1280 byte. However, since commit
9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280"), such
message would be simply discarded. The feature flag is neither supported
in iproute2 utility. In theory one can still manipulate it with direct
netlink message, but it is not ideal because it was based on obsoleted
guidance of RFC-2460 (replaced by RFC-8200).
The feature test would always return false at the moment, so remove it
from the output path.
Signed-off-by: Yan Zhai <yan@cloudflare.com>
---
net/ipv6/ip6_output.c | 1 -
1 file changed, 1 deletion(-)
Comments
On Fri, Oct 20, 2023 at 7:32 AM Yan Zhai <yan@cloudflare.com> wrote: > > dst_allfrag was added before the first git commit: > > https://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03399.html > > The feature would send packets to the fragmentation path if a box > receives a PMTU value with less than 1280 byte. However, since commit > 9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280"), such > message would be simply discarded. The feature flag is neither supported > in iproute2 utility. In theory one can still manipulate it with direct > netlink message, but it is not ideal because it was based on obsoleted > guidance of RFC-2460 (replaced by RFC-8200). > > The feature test would always return false at the moment, so remove it > from the output path. What about other callers of dst_allfrag() ? This feature seems broken atm.
On Fri, Oct 20, 2023 at 1:06 AM Eric Dumazet <edumazet@google.com> wrote: > > On Fri, Oct 20, 2023 at 7:32 AM Yan Zhai <yan@cloudflare.com> wrote: > > > > dst_allfrag was added before the first git commit: > > > > https://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03399.html > > > > The feature would send packets to the fragmentation path if a box > > receives a PMTU value with less than 1280 byte. However, since commit > > 9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280"), such > > message would be simply discarded. The feature flag is neither supported > > in iproute2 utility. In theory one can still manipulate it with direct > > netlink message, but it is not ideal because it was based on obsoleted > > guidance of RFC-2460 (replaced by RFC-8200). > > > > The feature test would always return false at the moment, so remove it > > from the output path. > > What about other callers of dst_allfrag() ? > > This feature seems broken atm. It is broken as far as I can tell. The reason I removed just one caller here is to keep the code simpler and consistent. If I don't do so, I ought to test it for both GSO fast path and slow path to be logically consistent. Seems an overkill to me. For the removal of the rest, I'd hope it could come in as a standalone patch(set) because it is not just callers but also those unnecessary flags and tests on IP corks and sockets, not quite aligned with this patch's intention. I noted you have drafted something like this in the past: https://lkml.kernel.org/netdev/1335348157.3274.30.camel@edumazet-glaptop/ I guess it might be a good base point to work on as a new patch(set)? What's your call on this? Yan
On Fri, Oct 20, 2023 at 8:39 AM Yan Zhai <yan@cloudflare.com> wrote: > > On Fri, Oct 20, 2023 at 1:06 AM Eric Dumazet <edumazet@google.com> wrote: > > > > On Fri, Oct 20, 2023 at 7:32 AM Yan Zhai <yan@cloudflare.com> wrote: > > > > > > dst_allfrag was added before the first git commit: > > > > > > https://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03399.html > > > > > > The feature would send packets to the fragmentation path if a box > > > receives a PMTU value with less than 1280 byte. However, since commit > > > 9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280"), such > > > message would be simply discarded. The feature flag is neither supported > > > in iproute2 utility. In theory one can still manipulate it with direct > > > netlink message, but it is not ideal because it was based on obsoleted > > > guidance of RFC-2460 (replaced by RFC-8200). > > > > > > The feature test would always return false at the moment, so remove it > > > from the output path. > > > > What about other callers of dst_allfrag() ? > > > > This feature seems broken atm. > > It is broken as far as I can tell. The reason I removed just one > caller here is to keep the code simpler and consistent. If I don't do > so, I ought to test it for both GSO fast path and slow path to be > logically consistent. Seems an overkill to me. For the removal of the > rest, I'd hope it could come in as a standalone patch(set) because it > is not just callers but also those unnecessary flags and tests on IP > corks and sockets, not quite aligned with this patch's intention. I > noted you have drafted something like this in the past: > > https://lkml.kernel.org/netdev/1335348157.3274.30.camel@edumazet-glaptop/ > > I guess it might be a good base point to work on as a new patch(set)? > What's your call on this? > I am about to send a TCP patch series to enable usec TSval (instead of ms), and was planning to use a new RTAX_FEATURE_TCP_USEC_TS. I also noticed that iproute2 was not supporting RTAX_FEATURE_ALLFRAG, so we might kill it completely ? commit b258c87639f77d772c077a4e45dad602c62c9f1c Author: Eric Dumazet <edumazet@google.com> Date: Wed Oct 18 09:33:38 2023 +0000 tcp: add RTAX_FEATURE_TCP_USEC_TS This new dst feature flag will be used to allow TCP to use usec based timestamps instead of msec ones. ip route .... feature tcp_usec_ts Also document that RTAX_FEATURE_SACK and RTAX_FEATURE_TIMESTAMP are unused. Note that iproute2 does yet support RTAX_FEATURE_ALLFRAG ? Signed-off-by: Eric Dumazet <edumazet@google.com> diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 51c13cf9c5aee4a2d1ab33c1a89043383d67b9cf..aa2482a0614aa685590fcc73819cbe1baac63d66 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -502,13 +502,17 @@ enum { #define RTAX_MAX (__RTAX_MAX - 1) -#define RTAX_FEATURE_ECN (1 << 0) -#define RTAX_FEATURE_SACK (1 << 1) -#define RTAX_FEATURE_TIMESTAMP (1 << 2) -#define RTAX_FEATURE_ALLFRAG (1 << 3) - -#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | \ - RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG) +#define RTAX_FEATURE_ECN (1 << 0) +#define RTAX_FEATURE_SACK (1 << 1) /* unused */ +#define RTAX_FEATURE_TIMESTAMP (1 << 2) /* unused */ +#define RTAX_FEATURE_ALLFRAG (1 << 3) +#define RTAX_FEATURE_TCP_USEC_TS (1 << 4) + +#define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | \ + RTAX_FEATURE_SACK | \ + RTAX_FEATURE_TIMESTAMP | \ + RTAX_FEATURE_ALLFRAG | \ + RTAX_FEATURE_TCP_USEC_TS) struct rta_session { __u8 proto;
Eric Dumazet <edumazet@google.com> wrote: > I also noticed that iproute2 was not supporting RTAX_FEATURE_ALLFRAG, > so we might kill it completely ? Yes, I intentionally did not expose it in iproute2. Lets remove ALLFRAG.
On Fri, Oct 20, 2023 at 5:01 AM Florian Westphal <fw@strlen.de> wrote: > > Eric Dumazet <edumazet@google.com> wrote: > > I also noticed that iproute2 was not supporting RTAX_FEATURE_ALLFRAG, > > so we might kill it completely ? > > Yes, I intentionally did not expose it in iproute2. > > Lets remove ALLFRAG. I will do that in V4 later today to completely clean it up then. Always cheerful to delete code! Yan
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index a471c7e91761..ae87a3817d4a 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -189,7 +189,6 @@ static int __ip6_finish_output(struct net *net, struct sock *sk, struct sk_buff return ip6_finish_output_gso_slowpath_drop(net, sk, skb, mtu); if ((skb->len > mtu && !skb_is_gso(skb)) || - dst_allfrag(skb_dst(skb)) || (IP6CB(skb)->frag_max_size && skb->len > IP6CB(skb)->frag_max_size)) return ip6_fragment(net, sk, skb, ip6_finish_output2); else