Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3211826lqp; Tue, 26 Mar 2024 02:57:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3WYYvGUJ2mJbl66X6CyApqf3LsfqGWywYplawGaWuE1lS85C18Gt528UOsia6mREDrNEhKZFTp224+lFFi2bNl6lDELi9rtgzlOBOgw== X-Google-Smtp-Source: AGHT+IEZybFElobVledQucqJ2673k5WmhxFO0fQwj4OYJfy4C0OcfKNoqOBpawZrZMtqyTjFgUx2 X-Received: by 2002:a05:6a00:8614:b0:6ea:b9a1:63d9 with SMTP id hg20-20020a056a00861400b006eab9a163d9mr1285947pfb.1.1711447075370; Tue, 26 Mar 2024 02:57:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711447075; cv=pass; d=google.com; s=arc-20160816; b=R54R1+SV3EIamQ8wXAtHhhmllQ6+gi9BBd7H5BZFy4wP7M4jBCjUxVuoqnf88yMcVz A0mvmYW7KaA5Q9CCKFMlqxPFpDVLB1PfRsSXBWhc67EJdNLCsu9eTBE2G2dHoElmYgkR DdAYuK0esdtnrsQt4crmF+5ZG8y9VunVL6kNjpnRyGLllT5jFxhCTWX+zKiXQylnuWGl emmBzEPCm005nA9fGaDz+2Ue9ieY4fZZnLhpzG32FOM3fsfW7ySJrLontr3jj8+wNIHq ciljOQEnsAuAHbPGODx102UDHkyUnjcMwFGCIXIFiMjDbzPh3d5jS+sFodHVyIecHAAI HmpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=h3nRr+iRGLA7SNw/Gv2ZXmc0cVM1N2xvV5jllxEX0bY=; fh=P/WX9thbWhQVNmJurixuNMgWGYum+NxnakSUbf1cLMM=; b=VAf0SKeaJejeaMkEoYZTITkc0AjPSg2/ySHDjKbbRuXbggz05llCHsQdWWE6qp3tlj w5HLj2uscCEcnmuC4wx6JePM80etc+thYu51KNZ+1no5U/tAFSUtbGVEXV0DAO5beayy Cv8VCKcyf0l/MVHHGUUGbtxCDVFcD32U6MyaBkY9gxAgR5dizQadBZw4jfA+zc99qO5U RTi9MPtapaMKCSaG/lH8dX91dWmdycpnAw/2db9sSRGieq0nmpgm8p9hFyrsht15obYv TK98Oz9Z3IZ5moG+2r87Xlv0l4FNsTyPIDBedglF03FE5a42/Ri3OU1BIytr6M1C1UUh 1jDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ckZ/8nmR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d1-20020a63bd41000000b005dc1bb540cesi9290049pgp.76.2024.03.26.02.57.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 02:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ckZ/8nmR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-118687-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 35CC5B2637C for ; Tue, 26 Mar 2024 09:39:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E65A86BFB8; Tue, 26 Mar 2024 09:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ckZ/8nmR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E67645975; Tue, 26 Mar 2024 09:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711445452; cv=none; b=dN18+GTUKeOWJ8s0OlpeEDIDXjUehtc0Xw/NLUdzFbfejnaWk9FBM10gRywgh116aCPElahE389+MmczEMMtny+ITcwDp0vf+Vx644Nn0vSdy4iCNkiVoZ0CKRn6ZmK8apELRSfU+6e6R1lvNDMjZh89wy+r7uMN3CUu7GfiTjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711445452; c=relaxed/simple; bh=DoVOcfg8BNPIadgIe/CtkKmdfNsnh7VR8WXrrgF7eFk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o2tVRPUfB/CB0W/VAhrzD7CFU9vQTxpAgb6gXCTuLwxmT51CLfVAgh66UH5him9AIb0wuYs9/6A2xSRl2ZRdWDt8b9dasHmBDyfXY1+YlXqBcE5L1DUfBc5ImLFh6rMQDmAzQGC5hHOwNyFUPp2l7Vk6rBr1nuilDBcmGV+j/qo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ckZ/8nmR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89B43C43390; Tue, 26 Mar 2024 09:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711445451; bh=DoVOcfg8BNPIadgIe/CtkKmdfNsnh7VR8WXrrgF7eFk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ckZ/8nmRjgO9b8oZdnGFefWgEDnp+WlNYTKAwvk3UJmBT3xiLMbI+jek+vY33nU3x JLbDMY9gFiXBZdmLLSQEUnSy5zw3ssECnZ+GJztXoFfJ1K/0/UFVE6VpUhMkpnyQ18 +6T5G8cOWpRiBoTbMPyeRBDA3yoXGp6X7Z7uy6HLUj+LZqIU8CLIzlgMB7D/SuKNow 6Jx3F9LBb1fbsUrcQ+nUzEB/1ZN+AzVIkUhkBwhFm8MRTJ4TzoThXQ9pIrvNCkuYiE Td1EOLr2TXxny0r6aFuwxMnvjeid+/mRinvTX+RdZ4e3xJtngu3lGe2TIAAtImuCH1 Hainz5Ca1BYrw== Date: Tue, 26 Mar 2024 09:30:47 +0000 From: Simon Horman To: Thomas Perrot Cc: Jakub Kicinski , Nicolas Ferre , Claudiu Beznea , "David S . Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: macb: allow MTU change when the interface is up Message-ID: <20240326093047.GH403975@kernel.org> References: <20240325152735.1708636-1-thomas.perrot@bootlin.com> <20240325205401.GF403975@kernel.org> <20240325185647.0ad674e9@kernel.org> <277c78a696e27e77e34820ebf2f7a0d0ce5d0633.camel@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <277c78a696e27e77e34820ebf2f7a0d0ce5d0633.camel@bootlin.com> On Tue, Mar 26, 2024 at 09:49:19AM +0100, Thomas Perrot wrote: > Hello, > > On Mon, 2024-03-25 at 18:56 -0700, Jakub Kicinski wrote: > > On Mon, 25 Mar 2024 20:54:01 +0000 Simon Horman wrote: > > > I'm not sure that it is expected behaviour for an interface > > > to reset like this when a change of MTU is requested. > > > While conversely I think it is common (if not entirely desirable) > > > to prohibit changing the MTU when an interface is up. > > > What is the problem being addressed here? > > > > The problem being addressed here, is that NetworkManager isn't able to > apply the MTU value set in the connection configuration file because > the link is already up, then the change_mtu callback returns an error: > > "NetworkManager[412]: [1709629970.1735] platform: (eth0) link: > setting mtu 1400 > NetworkManager[412]: [1709629970.1737] platform-linux: delayed- > action: schedule wait-for-response-rtnl (seq 41, timeout in > 0.199992796, response-type 0) > NetworkManager[412]: [1709629970.1737] platform-linux: delayed- > action: schedule refresh-link (ifindex 2) > NetworkManager[412]: [1709629970.1738] platform-linux: delayed- > action: handle refresh-link (ifindex 2) > NetworkManager[412]: [1709629970.1738] platform-linux: do- > request-link: 2 > NetworkManager[412]: [1709629970.1739] platform-linux: rtnl: > recvmsg: new message NLMSG_ERROR, flags 0, seq 41 > NetworkManager[412]: [1709629970.1740] platform-linux: rtnl: > recvmsg: error message from kernel: Device or resource busy (-16) for > request 41" Hi Thomas, I understand this is not ideal. But from a driver level perspective, if the HW doesn't support changing the MTU while the device is up, rejecting the change MTU operation is actually the best practice (or least worst depending on your perspective). As Jakub pointed out elsewhere in this thread, with your proposed change, there is a real chance the NIC could drop of the network entirely and not come back. Whereas the expected outcome is for the NIC to remain on the network with either the new or old MTU.