Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp733585lql; Mon, 11 Mar 2024 16:17:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdJqeuY6CVlCKLOWpdXA79YssQIdd81SsRvp8EIgwq9LxJajlxyVpOnYFipPsJKChkvPjaUkwreleLz+eIFTyWCvUAnnmv1gwJqZ7Zmg== X-Google-Smtp-Source: AGHT+IF+S8t+wDqwvSHrNUeW6V59CGrqU7k92efGF7m464utuWvbx1eWp+IhjaMOstHMGwooaier X-Received: by 2002:a17:906:4f85:b0:a44:4c8e:f167 with SMTP id o5-20020a1709064f8500b00a444c8ef167mr4634295eju.69.1710199059285; Mon, 11 Mar 2024 16:17:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710199059; cv=pass; d=google.com; s=arc-20160816; b=tUMGuFF4mL3KKV2pztjlVRbAcg2MkS8Eyn1ekblXBVaMzIs3A+wL+aNrzbsleAojx1 VQmKj4rZHnejw/AD8vgoOgLN/0A/YXFGzF/O49FviI8Y0cd0uyUxXp/OxCV+rPc9/Rvx vjA1J2rO/K2rDlMEAIf1MRlJGcYj+w+fYtpwu/zfnRQNnvEeYKxaQrdEsElSWKo33aL1 3U70dP7H6ZoXES9ZYGd3qSuyHLyE95d6JlTXdtnDMVU9VOQ1dbxxsIdsnILTBfHnu57v YZyI6xSknySSFKnRnjIY0d1s7bgmqYRaWTKp2BtGxPiKX0RRaBNzF0prYtHWPr5ix3Ms bA5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5gtxsLtvb5jHWWr9UfhGYN8UnSUlA+nKP0G3SMzWA1Q=; fh=fGwIZNq2Qcvp6BEm9Lzc8Hc319xD/yZNpNjs2W094Io=; b=SGME1XOucKmZEb3TfkJY2te7dNNjByWzq2n2OKQ7DzoW7j+BDlJHfzAMuG+tq9J9w0 MveZtHrSh4MJVhEUcBtD1rms1D+L6T5BMZnsLsI490AUUbcgYU/oUQQDaglG5Ww3FBAj IO4vNs8H5YMoYYfx5tZLE2Swo7xcu936G34MWpGCHOLsfK3srf48ezQHWRJzv0q0QkaJ R8U3l6RORRG06gJRvx2c+wpjmKtX9jwtKfSoW5Bqf6pqtk7v7j5WIS+8Zwcvvv5FAVzv wvrK4O0e3M4RgvjOQvGTpe//Xqzyt7ws0Lyq0LSALTj1RnIuf0n+4TsdtJw16ERtX6sD icSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sM2kfcYv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gf14-20020a170906e20e00b00a463723aa48si585663ejb.43.2024.03.11.16.17.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 16:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sM2kfcYv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-99649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99649-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EE0051F21D8E for ; Mon, 11 Mar 2024 23:17:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 588A758AC5; Mon, 11 Mar 2024 23:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sM2kfcYv" 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 7F0794AECF; Mon, 11 Mar 2024 23:17:29 +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=1710199049; cv=none; b=HUihJCRbezURe6ubs32cuH4J6R/bsLPSH0vfWvfn3o3hFJEmW3JXS+SSz4pX8a10LoiwHaKGkCgX9eV0ByfbW9eZZe2An+q4XGIUmuYf2s9GLZ3F2AUUGRxOMrATRBRiFFdZvZ9Uoe/o1mAIE0Iee7RSeF6KpsFMMvbECiOv/0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710199049; c=relaxed/simple; bh=Yyx2SljWGGhoQy/gF540D+08seq/pSyWBT/BUFx9wo4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jrE4IusoWLB62WnpsEiPnETLpsKy5br9HCrqKmipSnwcxBUR9gLWGYsNkPzW+pD/FmR+iR12/pqNF2Q47gxgSgkGByj8L5V2hTfjmbivFBfF1VblIynq4h/XQOup2WI/aS+eRlt8lYOuRP681rcoQKBAVuG57L9yf9HGEBe5S8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sM2kfcYv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3690C433C7; Mon, 11 Mar 2024 23:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710199049; bh=Yyx2SljWGGhoQy/gF540D+08seq/pSyWBT/BUFx9wo4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sM2kfcYvtsVLPBQPJYNs+z8HCxp33ssQCLonJP3rVVS1mh5DJb1Gch3TXE7ElPw/T 2FX5KZKDvmDig9b4O6PP1Xd1ggzf0ZUaqemdoduVpuIaDLRYahUHg5uhDfyGG0AGya mFJ5qFoVIPaY19D3rhlJiwcv4fBUspb/9krTu3zVNiGyd9bmvdUv4yEkfageWQAKhm Hpdp7DkiLq9tGjEa2wCg/p2j2rNH+KyIpjjlv5TsBxTUXQilusQGHGyiPNgPvFBsI2 /F2HcXW3pJObvPtd3uvC/046ZpU8vM+ZbqIlbyRGKUHcu8j5UyWpe+eRfRh94Cw1M+ 8T8LPtmDzoYYw== Date: Mon, 11 Mar 2024 16:17:27 -0700 From: Jakub Kicinski To: thomas.perrot@bootlin.com Cc: Nicolas Ferre , Claudiu Beznea , "David S . Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v3] net: macb: remove change_mtu callback Message-ID: <20240311161727.629c0bab@kernel.org> In-Reply-To: <20240311154315.2575297-1-thomas.perrot@bootlin.com> References: <20240311154315.2575297-1-thomas.perrot@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-Transfer-Encoding: 7bit On Mon, 11 Mar 2024 16:43:15 +0100 thomas.perrot@bootlin.com wrote: > Because it doesn't allow MTU changes when the interface is up, although > it is not necessary. > > This callback has been added to add in a first implementation of the Jumbo > support [1],since it has been reworked and moved to the probe [2]. > > With this patch the core will set the MTU, regardless of if the interface > is up or not. > > [1] commit a5898ea09aad ("net: macb: Add change_mtu callback with > jumbo support") > [2] commit 44770e1180de ("ethernet: use core min/max MTU checking") > > Fixes: 44770e1180de ("ethernet: use core min/max MTU checking") static void macb_init_rx_buffer_size(struct macb *bp, size_t size) { if (!macb_is_gem(bp)) { bp->rx_buffer_size = MACB_RX_BUFFER_SIZE; } else { bp->rx_buffer_size = size; where size is: size_t bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + NET_IP_ALIGN; I guess you tested this on a platform where !macb_is_gem(bp) ? Otherwise the buffer size seems to be based on MTU and the proposed change won't be correct. -- pw-bot: cr