Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3381386rwb; Tue, 8 Nov 2022 04:03:31 -0800 (PST) X-Google-Smtp-Source: AMsMyM5ZMU7tIEgErfvSBT7O3dNoRkiUJyw0KdFJLGJJpSYmIPdHAlllN8uizkTCEFtYvDFnCSbY X-Received: by 2002:aa7:d650:0:b0:462:d945:3801 with SMTP id v16-20020aa7d650000000b00462d9453801mr55049273edr.117.1667909011026; Tue, 08 Nov 2022 04:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667909011; cv=none; d=google.com; s=arc-20160816; b=XNXT7QdYgSI3jTjpGrCRyKyKrJOzHR6pgTxp8btZAHiThymRBsIQw7R96hURTyiPJp IN23g+w8URafFDXj8Tg+5vYPyxzLt2TxAhe59SDywrjDiWEdHwXcUJ00jkImnhE0xvvs qI8dxpNaHsuI9rfOHtq6QesZlL9pOF+IZ/gFSDDwQlExlHLBmOnceXFH+eQrxjbTReyO e7RajtWAA0+a48To9OdyaLnFDKZj9ckuTgkrNgeqmfMoaDedgPeJ/On6xcOPrQnhyNP5 SU2rJurSW5WKZK4/djZ3VOJFn2uY5RQvpcCPjZLQH5Nd2pd6ABWfUniXTbddLENCgx9c r7xg== 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:feedback-id :dkim-signature; bh=nP2DN9huvRZCwj+EeirHvDaYlV3KzWuv19wsVeFnYlg=; b=MAJFc5HEqEJNpF+Lci7l/f0DSV6qHpCm8Rj7U35XjtZwR/qYUwK2HJydES/Ad/EdtZ uiB0TAvj6AW31S6KIW5dWRir5smx1cSck96enzL243S+hhytG2/g6bt2IRVkgxftsO4/ RxgGdz3tlN8d3vO3g8H3Kd6Uk/qjfWpRgbEpNfI+hF8PkvXkTE+nJQD5JVBsrAQKxz2u enLkt7RJWTkD/zopRknKKo3F7KK2HhOxu+2TjZXfUdSCz+tkXV9C3EdviDOkfIiSzmTr o0XFVxNYG54CgzvP+oopaAjIAyz69qpNx89QXciLeZ7gK+rEkMkSWx8HiYF1YebiQwXA osRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=nPTarOnI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz33-20020a1709077da100b0079c65d65f49si12276546ejc.908.2022.11.08.04.03.08; Tue, 08 Nov 2022 04:03:30 -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=@messagingengine.com header.s=fm1 header.b=nPTarOnI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233927AbiKHLCx (ORCPT + 89 others); Tue, 8 Nov 2022 06:02:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233479AbiKHLCu (ORCPT ); Tue, 8 Nov 2022 06:02:50 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34980450B3; Tue, 8 Nov 2022 03:02:49 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id E87E732003D3; Tue, 8 Nov 2022 06:02:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 08 Nov 2022 06:02:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1667905364; x=1667991764; bh=nP2DN9huvRZCwj+EeirHvDaYlV3K zWuv19wsVeFnYlg=; b=nPTarOnIxrW/zamDmNXsZG4ai+ApYSZmmzu+BhtbT5rw mtbLXtnZ91Wsx6cYX7aQe4jZNZCZsGJC2Mla0GEjFkbCGOJ0KBcJtDMhDKwLl2qA xaOoirLqqKZ47HBzkKP2M5j76dDIFWFnVqIqsP9aY5MXXANWgjOnEYn4r2NdpYtA eIrKIfH3WTwPLnB+RkwhAu7gPi2pBocGLuYYuCxZ37Yy0ZkfWkf3aIyWlg2KfItI fMMe5Ex/coTrt3s6VoIfzZS7AryQmV2ko/ZWtQmxKcO8hjv2Nz70dTdz6ifpHEZp 1rdY7PjtxERy0Q0Niv606EEZIHGhJMdtMiFBZqSRHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfedtgddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkughoucfu tghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrghtth gvrhhnpeehhfdtjedviefffeduuddvffegteeiieeguefgudffvdfftdefheeijedthfej keenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Nov 2022 06:02:43 -0500 (EST) Date: Tue, 8 Nov 2022 13:02:38 +0200 From: Ido Schimmel To: Andy Ren Cc: netdev@vger.kernel.org, richardbgobert@gmail.com, davem@davemloft.net, wsa+renesas@sang-engineering.com, edumazet@google.com, petrm@nvidia.com, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, andrew@lunn.ch, dsahern@gmail.com, sthemmin@microsoft.com, sridhar.samudrala@intel.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, roman.gushchin@linux.dev Subject: Re: [PATCH net-next v3] net/core: Allow live renaming when an interface is up Message-ID: References: <20221107174242.1947286-1-andy.ren@getcruise.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221107174242.1947286-1-andy.ren@getcruise.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE 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 Mon, Nov 07, 2022 at 09:42:42AM -0800, Andy Ren wrote: > Allow a network interface to be renamed when the interface > is up. > > As described in the netconsole documentation [1], when netconsole is > used as a built-in, it will bring up the specified interface as soon as > possible. As a result, user space will not be able to rename the > interface since the kernel disallows renaming of interfaces that are > administratively up unless the 'IFF_LIVE_RENAME_OK' private flag was set > by the kernel. > > The original solution [2] to this problem was to add a new parameter to > the netconsole configuration parameters that allows renaming of > the interface used by netconsole while it is administratively up. > However, during the discussion that followed, it became apparent that we > have no reason to keep the current restriction and instead we should > allow user space to rename interfaces regardless of their administrative > state: > > 1. The restriction was put in place over 20 years ago when renaming was > only possible via IOCTL and before rtnetlink started notifying user > space about such changes like it does today. > > 2. The 'IFF_LIVE_RENAME_OK' flag was added over 3 years ago in version > 5.2 and no regressions were reported. > > 3. In-kernel listeners to 'NETDEV_CHANGENAME' do not seem to care about > the administrative state of interface. > > Therefore, allow user space to rename running interfaces by removing the > restriction and the associated 'IFF_LIVE_RENAME_OK' flag. Help in > possible triage by emitting a message to the kernel log that an > interface was renamed while UP. > > [1] https://www.kernel.org/doc/Documentation/networking/netconsole.rst > [2] https://lore.kernel.org/netdev/20221102002420.2613004-1-andy.ren@getcruise.com/ > > Signed-off-by: Andy Ren Reviewed-by: Ido Schimmel