X-Received: by 2002:a65:6a13:0:b0:373:14f6:5d33 with SMTP id m19-20020a656a13000000b0037314f65d33mr334719pgu.62.1645634139651; Wed, 23 Feb 2022 08:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645634139; cv=none; d=google.com; s=arc-20160816; b=Mq8O/ejroY/RPq4V2pZ8NMv9FSZmi1HWCZR21jgbV9yNsR6jHpKufcrNWzWWbkLx3D WNy4BfaP5E64EWXiR1heylcI4exjw3B/yhSv9I74iVOYgBb8pGPBxPHV503Y/L++IMus 7IMnb0qfHklPaKOZWsMRIYuzx2gSCYcXOLsRXzqYTVfEy2Bp+I7ybhe9iQbJBs24ics/ SjU1L8aNsaLbfudA3DCVoEm009E6becPnRspmEgjxM5iGJFDOaEOjB2nFU9IcaSvHfOU cOwvi5GNLdmc2dkM5hjHVKzs7RNX6IgPMzQz7hXgHNEAiQYHaTqR+WIvw9+vRAqD8qJb 02Ww== 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=Haw7XCJunvY/DjkGYU10zm/TPnhQIIAXDUz4hP9McDQ=; b=CJnflwGMh5HU4iFTg91n237Il1pDjtVUqPjuGdzabIp1ouB0QJuxeXZidGoGsj55jx U8vHqHhOai61lqNoVbZltA/ds1klSfelhn+OVCB+R8tvzg8FRwQeZCBFBluBIdP02VI3 Y7kJD9ytyjq2gpJp9++zOXJnXOnRysPr6Hcti7udAvPu+1J4KAECPCWPGO83I98Pq3fd Tiazd7BdVs7/EDD+16gjK5RZPTgP0Yv4Q9BcKkALOsk75aS8gjL5vYUgOS4qsBu5UMXP DX1+J6sppqaErBFtVr8b2rpsPoGYhbjV/M9J288bt0lgLpvgOSSI3A6SwkmzhP97FkyS mcfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+jAKXUz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6si25587pfa.375.2022.02.23.08.35.22; Wed, 23 Feb 2022 08:35:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U+jAKXUz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239837AbiBWL0x (ORCPT + 99 others); Wed, 23 Feb 2022 06:26:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236327AbiBWL0w (ORCPT ); Wed, 23 Feb 2022 06:26:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B303E9024D for ; Wed, 23 Feb 2022 03:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645615583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Haw7XCJunvY/DjkGYU10zm/TPnhQIIAXDUz4hP9McDQ=; b=U+jAKXUz9cCflcHFuVRImQn8c65cuehczK9V1Vs/TIrMy3eijNdXRmvZMxkz8q1n5j5ylE UCajgCp/GBsCtigg8kYNGK3SvHlSawhQ5RM8JHXHqLtRfbCfFYrYdjF6gKfOqWQa7gFsit 41q/Tr/iZf1J6eHbLIuYLowjV8c1CpA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-37-Z13veCtBN9CMqTZX0Qkyig-1; Wed, 23 Feb 2022 06:26:22 -0500 X-MC-Unique: Z13veCtBN9CMqTZX0Qkyig-1 Received: by mail-wm1-f71.google.com with SMTP id w3-20020a7bc743000000b0037c5168b3c4so984061wmk.7 for ; Wed, 23 Feb 2022 03:26:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Haw7XCJunvY/DjkGYU10zm/TPnhQIIAXDUz4hP9McDQ=; b=P5Xc97h9rGO20rpMvQiNBi6YUC0DnyLkAurnGva8VqN7jayzRtGCg/CB6pFd/PX+0E dKLvHRJJOpmWv+aY7vov2HeC7Vxq9ocs8XaIHtKDebo6Vj02hJsWNyZPnfgXx0EGTKK+ MmvU2stZCYpa2QvyX0TRRT5wDyUDSZ+iYE9PBlXdBkzg4nfMuLVGQnREIB9RMygc1ste NVMmgMHLBRpix6WdEKJPkvkYIyWQU42p6OvmkAWlgNKo8tjz8GJ8M5S6R8axCCEG874q bU9KJroffmEodWtgBti/b8WPgc3bg+iYuhaKhQVtE+UQQSKyT31kFZfigyD1eL40W1gx xmHQ== X-Gm-Message-State: AOAM5307BgWLvutDyj7f4QyG0dCcBLe0I9XIREf09MFF4yS20Ut2CN11 dFL6EAAMcLO8JFctOLyPfhGBwaGVGo2Y5cgYsPc055i8FJZbSndtDPeAEzjYzgj/EvbFb09uj01 dxvY+rTH6ZyxZiEuckOCIjpRl X-Received: by 2002:adf:e2cf:0:b0:1ed:a702:5ef4 with SMTP id d15-20020adfe2cf000000b001eda7025ef4mr2247208wrj.487.1645615581413; Wed, 23 Feb 2022 03:26:21 -0800 (PST) X-Received: by 2002:adf:e2cf:0:b0:1ed:a702:5ef4 with SMTP id d15-20020adfe2cf000000b001eda7025ef4mr2247190wrj.487.1645615581185; Wed, 23 Feb 2022 03:26:21 -0800 (PST) Received: from debian.home (2a01cb058d3818005c1e4a7b0f47339f.ipv6.abo.wanadoo.fr. [2a01:cb05:8d38:1800:5c1e:4a7b:f47:339f]) by smtp.gmail.com with ESMTPSA id f63sm3976646wma.17.2022.02.23.03.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 03:26:20 -0800 (PST) Date: Wed, 23 Feb 2022 12:26:18 +0100 From: Guillaume Nault To: Jakub Kicinski Cc: Eric Dumazet , "Ziyang Xuan (William)" , Herbert Xu , David Miller , netdev , Vasily Averin , Kees Cook , LKML Subject: Re: [PATCH net] net: vlan: allow vlan device MTU change follow real device from smaller to bigger Message-ID: <20220223112618.GA19531@debian.home> References: <20220221124644.1146105-1-william.xuanziyang@huawei.com> <8248d662-8ea5-7937-6e34-5f1f8e19190f@huawei.com> <20220222103733.GA3203@debian.home> <20220222152815.1056ca24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220222152815.1056ca24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 22, 2022 at 03:28:15PM -0800, Jakub Kicinski wrote: > On Tue, 22 Feb 2022 11:37:33 +0100 Guillaume Nault wrote: > > What about an explicit option: > > > > ip link add link eth1 dev eth1.100 type vlan id 100 follow-parent-mtu > > > > > > Or for something more future proof, an option that can accept several > > policies: > > > > mtu-update > > > > reduce-only (default): > > update vlan's MTU only if the new MTU is smaller than the > > current one (current behaviour). > > > > follow: > > always follow the MTU of the parent device. > > > > Then if anyone wants more complex policies: > > > > follow-if-not-modified: > > follow the MTU of the parent device as long as the VLAN's MTU > > was not manually changed. Otherwise only adjust the VLAN's MTU > > when the parent's one is set to a smaller value. > > > > follow-if-not-modified-but-not-quite: > > like follow-if-not-modified but revert back to the VLAN's > > last manually modified MTU, if any, whenever possible (that is, > > when the parent device's MTU is set back to a higher value). > > That probably requires the possibility to dump the last > > modified MTU, so the administrator can anticipate the > > consequences of modifying the parent device. > > > > yet-another-policy (because people have a lot of imagination): > > for example, keep the MTU 4 bytes lower than the parent device, > > to account for VLAN overhead. > > > > Of course feel free to suggest better names and policies :). > > > > This way, we can keep the current behaviour and avoid unexpected > > heuristics that are difficult to explain (and even more difficult for > > network admins to figure out on their own). > > My $0.02 would be that if we want to make changes that require new uAPI > we should do it across uppers. Do you mean something like: ip link set dev eth0 vlan-mtu-policy that'd affect all existing (and future) vlans of eth0? Then I think that for non-ethernet devices, we should reject this option and skip it when dumping config. But yes, that's another possibility. I personnaly don't really mind, as long as we keep a clear behaviour. What I'd really like to avoid is something like: - By default it behaves this way. - If you modified the MTU it behaves in another way - But if you modified the MTU but later restored the original MTU, then you're back to the default behaviour (or not?), unless the MTU of the upper device was also changed meanwhile, in which case ... to be continued ... - BTW, you might not be able to tell how the VLAN's MTU is going to behave by simply looking at its configuration, because that also depends on past configurations. - Well, and if your kernel is older than xxx, then you always get the default behaviour. - ... and we might modify the heuristics again in the future to accomodate with situations or use cases we failed to consider.