Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4505580pxb; Mon, 21 Feb 2022 23:35:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPTcvyGIsZbuujrABTV6l1m7QQ26uvueD7jEkBWmEvyQHocidsQI9QUeqhx0yJRzGdjrbs X-Received: by 2002:a05:6a00:24ca:b0:4e1:cb76:32da with SMTP id d10-20020a056a0024ca00b004e1cb7632damr22602431pfv.81.1645515310173; Mon, 21 Feb 2022 23:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645515310; cv=none; d=google.com; s=arc-20160816; b=0c/cEfs93t0zdFAnn1cn+lGGdBoK8FSBqxOpE44Xsgd6sHwMbIYo3wSuj75YJqFMkp akWgno6DFU9wqX/t2+N/ON4Z/RslUntRj4g4Ka6zkkoGUN/uQh7TdmEm8pRRmL/eFlQo ydpjLj6plYl7/oOx1nIpHVTEksuPPV5CFGhsX05U9gMhMqRjvPiCwcmwJqzUVVGB8bfK wghkIu2F2DA0Hu44IeO9OOVU1MDLTeLnoSO9PDywbKVqcPnyjUCGc5CwFhwiiexwb14u GnGgsSs4H2ezQ9fGK+ckBndSfhZsLC5JCQEyr81EL/fvkRVk0NQNO5W6VcTY/VqLbJDI c+OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=3sRn+0g58sDZW5DDVhdcNAota/fLvlgBfrdxay/FdEc=; b=Pcwp2Bn1dBdAsebALsa41BUc6B3vPHmGae6efMN6Wkmw51Etkjn1fNfl/2gSGWsH4T 07HkV4WWIyziIY1YXvUkGnEerC7wuH8bEayCLhTY2F6TIdbgKC+t0ZHDHhmk8GUup9iJ Suz5DxxUzypmEQNP+TJvltOaUw7zX7iS7i5YIa/BDZsOzKAkaTzIh61NNHF9xmL0IjAd oNZnQJWZ51RG+uH/9F71XOfblGF/FjqKR4u9ZB4vOExJAvmQm10dPpjokHP5A7c28vD5 f3setG/Q34yNRQE2wo+yC7Z5eP4N4Z0F3plM4pD9/ZPXnNHRcv+l5NEdwoTcvIrpRuRH XS5Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h5si7537629plt.309.2022.02.21.23.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 23:35:10 -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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB6F02D1D1; Mon, 21 Feb 2022 23:32:02 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbiBVHcQ (ORCPT + 99 others); Tue, 22 Feb 2022 02:32:16 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiBVHcP (ORCPT ); Tue, 22 Feb 2022 02:32:15 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88FCB26565; Mon, 21 Feb 2022 23:31:49 -0800 (PST) Received: from canpemm500006.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4K2rN53B6Pzbbfj; Tue, 22 Feb 2022 15:27:17 +0800 (CST) Received: from [10.174.179.200] (10.174.179.200) by canpemm500006.china.huawei.com (7.192.105.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Feb 2022 15:31:46 +0800 Subject: Re: [PATCH net] net: vlan: allow vlan device MTU change follow real device from smaller to bigger To: Eric Dumazet CC: Herbert Xu , David Miller , Jakub Kicinski , netdev , Vasily Averin , Kees Cook , LKML References: <20220221124644.1146105-1-william.xuanziyang@huawei.com> <8248d662-8ea5-7937-6e34-5f1f8e19190f@huawei.com> From: "Ziyang Xuan (William)" Message-ID: <124e1c43-95a8-1aad-c781-b43eba09984a@huawei.com> Date: Tue, 22 Feb 2022 15:31:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.200] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500006.china.huawei.com (7.192.105.130) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 Mon, Feb 21, 2022 at 6:06 PM Ziyang Xuan (William) > wrote: >> >>> On Mon, Feb 21, 2022 at 07:43:18AM -0800, Eric Dumazet wrote: >>>> >>>> Herbert, do you recall why only a decrease was taken into consideration ? >>> >>> Because we shouldn't override administrative settings of the MTU >>> on the vlan device, unless we have to because of an MTU reduction >>> on the underlying device. >>> >>> Yes this is not perfect if the admin never set an MTU to start with >>> but as we don't have a way of telling whether the admin has or has >>> not changed the MTU setting, the safest course of action is to do >>> nothing in that case. >> If the admin has changed the vlan device MTU smaller than the underlying >> device MTU firstly, then changed the underlying device MTU smaller than >> the vlan device MTU secondly. The admin's configuration has been overridden. >> Can we consider that the admin's configuration for the vlan device MTU has >> been invalid and disappeared after the second change? I think so. > > The answer is no. > > Herbert is saying: > > ip link add link eth1 dev eth1.100 type vlan id 100 > ... > ip link set eth1.100 mtu 800 > .. > ip link set eth1 mtu 256 > ip link set eth1 mtu 1500 > > -> we do not want eth1.100 mtu being set back to 1500, this might > break applications, depending on old kernel feature. > Eventually, setting back to 800 seems ok. It seem that setting back to 800 more reasonable. We can record user setting MTU by interface ndo_change_mtu() in struct vlan_dev_priv. > > If you want this new feature, we need to record in eth1.100 device > that no admin ever changed the mtu, > as Herbert suggested. > > Then, it is okay to upgrade the vlan mtu (but still is a behavioral > change that _could_ break some scripts) > > Thank you. > . >