Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1036272pxm; Wed, 23 Feb 2022 16:30:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTYx5KH0ygUir3ucTFMs2W3QHzOeO3V2Sm6lm3nBYaJSGwG0E5w/NZaWxrb3cwIYhs0dwg X-Received: by 2002:a05:6a00:244b:b0:4c9:319e:ecb7 with SMTP id d11-20020a056a00244b00b004c9319eecb7mr338090pfj.58.1645662619978; Wed, 23 Feb 2022 16:30:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645662619; cv=none; d=google.com; s=arc-20160816; b=sYOGYcnaF5bAgJNFDjb1q8xkSA52Wc+McWmTx8V8EehiyJTAkmr3U/0a1l7c6dm6xQ lAlRZgZssfaASwtyxWRDNei114j6KIf2jEhcYsWdMn6a/3UZgK1TSbg+40vuSl7mq/tJ 233xUQWVQvnVtaDTBUmLr4LMCerpGKuV9l2GS2AyRpBeP+bC8tPcTe9CXlTIvvP+4mqr qiHntGCBs/TZj7n2gr5EZTiAITdvtChll9It6b2qVcs08IqREn12sYxQI1DLTjKOKkTu zFI3Erj01cFiBMmRtr9Gqwr6BFsDwTDhuZrXGMEGirezrHyQrxNtoR/W6q7BDO79pqOo YgoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FU9/IvCmjYnHYqrzJTmk+Vx5+9qmrRgnFwotNQzbX4k=; b=krUKOME7q5lRQk/QdzPxD5Dijd12R55xD0FxI+QGYVd32u+1w/KFw1pN7jlZHaL5OB LW/dKN7XVQx0nECs5smlbX04TxekpibII5Q2PW2zbDcCgL3JhdKQmgq3cRfPqU9TKwTK 8aOzVr3t3792Kebkn7Pk6U6BLyYBO7agAyaE0AXItVq9sPElBEKSCkLDAVYj9o/Cr6BA ixg3mS+fy5QG1qyTxuZQK3e2UllrC/t6DL+fsi8ks7WhX1l29WXL6Ru3wTEcO7ZD+3eT pe7BPHh+2E1Tzy39i9c+DHmeO+OSVffu9+fvjpwWCEEbJjvjyBS0nKiAoDbvJubJFyl7 Z2vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20210112.gappssmtp.com header.s=20210112 header.b="2CCI/5pL"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mz7-20020a17090b378700b001bafa897aa4si3673899pjb.85.2022.02.23.16.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 16:30:19 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20210112.gappssmtp.com header.s=20210112 header.b="2CCI/5pL"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 288C16D852; Wed, 23 Feb 2022 16:30:18 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241495AbiBWPSJ (ORCPT + 99 others); Wed, 23 Feb 2022 10:18:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237087AbiBWPSI (ORCPT ); Wed, 23 Feb 2022 10:18:08 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE88D3914E for ; Wed, 23 Feb 2022 07:17:40 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id qe15so2930108pjb.3 for ; Wed, 23 Feb 2022 07:17:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FU9/IvCmjYnHYqrzJTmk+Vx5+9qmrRgnFwotNQzbX4k=; b=2CCI/5pLpIu6L72TWxqSuj9zBOB2EWevZZIgPq1BxYyAavuNOHlZfCBsmFhCPj+mmD uENTl/DFokE0ImFbCc+hiZm2m8uTEYE9INgDP8CDcUPyseE+n9PeZBbGPsOH0C2PYW0c RGVx/vcbFW48Yop+L5RfzrvN0ARuvz7p/sL4ampiTvYfuLEWF2RvKrJe6ghmgFhda2ab osn8h0mWe0hQKtig9tUYShO43DpE5lmHM8eQSUrRnSCuQu5Uq5NXNSPdVzud4OefYr2r T7Yt24QNxwB3sNygJtdFTvNeBbQX96EfZqOtOfiy4HzvXiMCsaBlx60/x7wzi8wtLMza j9sQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=FU9/IvCmjYnHYqrzJTmk+Vx5+9qmrRgnFwotNQzbX4k=; b=qHDaoWT40+PO6MIIV1z5HVVi7xiferL0rOQ3Nfe5I9bE9rWLuYqcmIxS48aFM/63/z gmsZCCFN8yJV8pj5dfTY8f7kpnuSf/fIFpzdZVKefhhVJDc01EuEBpuBc9tu6nfPM8A4 bQzGasVmWWa0AHFF0iePsB9J/RiV4ZNiR3qJzefn+A3wOdXcdkE8Puw5/dDlv1zIPuQ9 Ljz4EvvBs+/E1w8wpmJqEY3pO0ZxBFwAtpa5MyjLUeXjt6TAV56cIJkQYARCMb91qcq4 CkmpbvzojKFpUWY1Umj4JXItlsicQvVs4vI9NKL2WM7QWClQdEAJZuWvtR9Wy73QorVY 3XiQ== X-Gm-Message-State: AOAM530YEc2VzA7rHiNAy1Dvj2CW9d5CPKc4JBW8+NdFbp/wtVM/wUV7 CzbvxzewD7/C+wsT+7HMMfGtKA== X-Received: by 2002:a17:902:ec88:b0:14f:de5b:2fbe with SMTP id x8-20020a170902ec8800b0014fde5b2fbemr198232plg.123.1645629460230; Wed, 23 Feb 2022 07:17:40 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u6sm12183964pfk.203.2022.02.23.07.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 07:17:39 -0800 (PST) Date: Wed, 23 Feb 2022 07:17:36 -0800 From: Stephen Hemminger To: Guillaume Nault Cc: Jakub Kicinski , 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: <20220223071736.1cb2cf3e@hermes.local> In-Reply-To: <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> <20220223112618.GA19531@debian.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, 23 Feb 2022 12:26:18 +0100 Guillaume Nault wrote: > 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. > In general these kind of policy choices are done via sysctl knobs. They aren't done at netlink/ip link level.