Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1723796lql; Wed, 13 Mar 2024 06:39:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfRyIA6P8gjz+BiO7ct8k7WwBgpqt9LiXL8qkkbcjuU+Kbe9h4eWxLxVur89GlPyJBpUbnS8wxpCH5YCXHivz5nL7+oDcadTH+ZCIeFQ== X-Google-Smtp-Source: AGHT+IEMOZwUcsSbZtm06dxVPfUiHoXWoP0N1BGweEKXH+KE/2ZYc2+5rF6EsHf+/zkVOyitjqp5 X-Received: by 2002:a05:622a:1987:b0:42e:b74f:88e9 with SMTP id u7-20020a05622a198700b0042eb74f88e9mr4458675qtc.48.1710337168181; Wed, 13 Mar 2024 06:39:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710337168; cv=pass; d=google.com; s=arc-20160816; b=n0OuOd7dnzCXgI7ryo0kdFO8Vahce6w1rYhg+2jGljAu1jVCfzR1GUVuUaQA2Dq71M +/ltbXP7tPN6xF+GKYGB8E2feCPMQHQZRstWZUHZ7h4U3JaJTPCrvM8UffpMErVSs29+ modFpAsymFv/JoRV6uDhXbCZ27FSrEn902tRWsd9hJEXhTADWPCkA/UiffHgqgqavF3M nbCDy52zPfjy1eZu+NEU69bBJlg4OHNyrA8iCSqWjm+MYG+2wfTujVBZ+6o27dUXsHri 3aEVRb8e8w5Q+1m8dqiJqBjZMJctlxEed5+HWjG88smhqXkOCXax+/c+9JaEtgUD9KpV KDjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:autocrypt:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=0Bicd0MobasMR69S0J0ZR+LESgqwadmjj5jzewTxOFc=; fh=croSDen7qobLePDk6DzqZmwqmGGioGLKPA4n99OMCcw=; b=pBZym7+r12btvbc4662HTGsqLO2pKG/ponBt0bRGPPTTBC4DSA0G+bWPDdpE5pooRH gUivOiSvn6Bw1OSho5goaOT9cm41qtkqzVFLbWiQQH9ESi8gyCnCbrFvLCx1LEvO0lcm y9NuhuUundpgvYhvJtrL29MTIPT0d/ihzDS+TRVvqsHwX3THeKMtQnXHlBULiFUBHHNL Mzft0voWtHZrjz6yRVHud4VVpHuK6f0TyUfMVyHtrrXBMCwuBP46M4ERKt4X7DaTn2Fr 5qo4uTsSgzE4WXj7glSTcW7zKNlZff7SSnNDgpH/5I6oDKbPuDBP7EwS3KeJDzdwYFir RQWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UGZkqgQj; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-101547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c15-20020ac85a8f000000b0042ed9b51f95si9685514qtc.501.2024.03.13.06.39.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 06:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UGZkqgQj; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-101547-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D4AD01C2203E for ; Wed, 13 Mar 2024 13:39:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71B5A41A81; Wed, 13 Mar 2024 13:39:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UGZkqgQj" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.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 69DB740BE1; Wed, 13 Mar 2024 13:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710337158; cv=none; b=VqcnjVk4QqPM1j4rCQ6XdLmNTvIcGfOmopIgnL97DxqU3U7NCUsfA+E/CcDTJh3+96rqk/yCjJtRF+SwrcPOX/iuIf1ipVz7UX89RERLW5B6jKlJWueJ7Zw2Qax436TJWsTtbl0wVv92rOpcv/z/YZYvx5Ov8AO7nEhryH1Vtbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710337158; c=relaxed/simple; bh=vK73uYI8Vxy7OroeXl4DurknrQfBeM/0gM/pIFpXnz0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=U4GYLkZRquokEnCedUmaIKHDyvinkIR9k/Q4EyEmKly3dbDW9YPpUAx/mi50XvxeFaGsCx1dSNKBS6gtpxwPB7lwnaAmLMfvUFuX+ODzr0tOr0zmurMLwNz7J0af1RC2FiB1r5CNYm6/VS1QB4OFoC0a04cPzFJq1kv3DnbVOlo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=UGZkqgQj; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 13F651BF203; Wed, 13 Mar 2024 13:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1710337147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=0Bicd0MobasMR69S0J0ZR+LESgqwadmjj5jzewTxOFc=; b=UGZkqgQjBuQWRDSbsBJcj9tSbHmSSMqrrXGdSrV1lJakRo5Nw8r0HtMpq9VOIlFDARoY5d dPuT/HoGEHXHC1tC6sRTUELctEwG0Od+JbwVkc3EdpaG0ol0SagF/UP3P8cbuPoN5lCyZ9 P2YjyZDketjsISPfMJdH8Y6cDdnQyW4TvZgYVVADEVGawQqxRe1bRJPRBto54I2mmTEy+f f7WDHvLk5Uq2oh7mb+EJR33edrVrw0IZl+K0AiK7meN7l4x69/MDePS93fjCb7drmFy9ko LG2Bxjd//mzqO5+Htz9zggoDh+u+jSvWvqCutClznq5K1eNelgTVjoTJ/1tUKw== Message-ID: <21ec269340a83f436bbf7a23a2be4289c88b70dd.camel@bootlin.com> Subject: Re: [PATCH net v3] net: macb: remove change_mtu callback From: Thomas Perrot To: Jakub Kicinski Cc: Nicolas Ferre , Claudiu Beznea , "David S . Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 13 Mar 2024 14:39:05 +0100 In-Reply-To: <20240311161727.629c0bab@kernel.org> References: <20240311154315.2575297-1-thomas.perrot@bootlin.com> <20240311161727.629c0bab@kernel.org> Autocrypt: addr=thomas.perrot@bootlin.com; prefer-encrypt=mutual; keydata=mQGNBF+/ZOUBDAC2DghCjZvmgYcve02OG7dGZ7Iy58uEwne3LB7w7nRwdAxKw7ZaiVqwYO+yNGVi+GVx7oA6Wn4pv46z+QDRLQiq6OseuXhkSGCg7U/yBCUq12B/GRGO1Qt2Qi1mJJT1s+1qZ5Gxv6Nypz9qKVn94GM2bR1hXBga0t87vBpebThOHmX5d/0dqIcVxRCM7onNb0dDyRoVgLS5rBhQzrLCMrJaCy39xZUy0J1SOlH4Mgk6EhJIPYY4wlzikGX6urg+Tc9EjGd78ry0e0p5U5qgjFR5QGJDy1GnU3CfwbT9sowdCASDbQDUoltlv2iWJCLa0xl97KVchCa0pr7HKbFA3J5SLKqFYUBCkFL+5WudYlz2nXxiUgyviMQxyK+ij66kEi6/2zFDAecd43pHV7790ptqZBC3Jc67Emj7Vo3ShX6RXPPxxbeCTOF2ukI45aJ9XcVFH/MFE96NjXj8uahnIsiTPyuCUoJu8tj7TSQyue874qJqVQvqlFyt2aZYJZ8ruq8AEQEAAbQpVGhvbWFzIFBlcnJvdCA8dGhvbWFzLnBlcnJvdEBib290bGluLmNvbT6JAc4EEwEIADgCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQSHQHfGpqMKIwOoEiGfwAsFcf4K7QUCX79mdwAKCRCfwAsFcf4K7fhbC/wP0kSl6id2E/K3+UdXk6CLMVRbCFLCREzQs5WFpQ6l/I0WGOamhrOgegdszheiVForlUP8d37XSpFAqydhKGaN78V5Dps0Wmwm4lIlS4MtQ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ajTTST7FmnphUmGahx8/Fn/iU+BeNflLW/Z54RbqC7b+0NpeagueoTtgeYzxGsbrammwtkCk4T6YzS4pIRbubde/kKxAYrb/CZU 0S//jkiNumQmWn2Pi+VPXHldd/7vXAaBkzkhN/mzIhBxZRebE1+qADKzDt70J393NfA5nq2FuUU3Q2se5CFBvOpDmsxMhiGQrOOREGMzWj46NA3qsC4VxpetgbjTf1gY/JwvWItWMfVA23SkqRcflE5Mv6gLE39uGSnuYAE6T6j0dMlwPwxhoikSjfeEsEayvBM75xKJvMkXOzZS56rmpx+dC2AlrUFTMFnT9RlalKixZn9McKIELk6eeJkU3m2euvf5JxabEhuNK2zlUQPhXNRlMwTWfTBuDsxcLXnsNi+h4ULfjbBu3VTfdE6DhC7phy6Q8dJuAn8MJDRySBqp/L4juX Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-ejHT/lGTQBdmCNEHSl5Q" User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: thomas.perrot@bootlin.com --=-ejHT/lGTQBdmCNEHSl5Q Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, On Mon, 2024-03-11 at 16:17 -0700, Jakub Kicinski wrote: > On Mon, 11 Mar 2024 16:43:15 +0100 thomas.perrot@bootlin.com=C2=A0wrote: > > Because it doesn't allow MTU changes when the interface is up, > > although > > it is not necessary. > >=20 > > 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]. > >=20 > > With this patch the core will set the MTU, regardless of if the > > interface > > is up or not. > >=20 > > [1] commit a5898ea09aad ("net: macb: Add change_mtu callback with > > =C2=A0=C2=A0=C2=A0 jumbo support") > > [2] commit 44770e1180de ("ethernet: use core min/max MTU checking") > >=20 > > Fixes: 44770e1180de ("ethernet: use core min/max MTU checking") >=20 > static void macb_init_rx_buffer_size(struct macb *bp, size_t size) > { > if (!macb_is_gem(bp)) { > bp->rx_buffer_size =3D MACB_RX_BUFFER_SIZE; > } else { > bp->rx_buffer_size =3D size; >=20 > where size is: >=20 > size_t bufsz =3D dev->mtu + ETH_HLEN + ETH_FCS_LEN + > NET_IP_ALIGN; >=20 > I guess you tested this on a platform where !macb_is_gem(bp) ? Thank you for your review, indeed that won=E2=80=99t be correct on GEM in w= hen the MTU used to initialize the RX buffer is lower than the new MTU. So, I will suggest another patch with an acceptable solution. Kind regards, Thomas Perrot > Otherwise the buffer size seems to be based on MTU and the proposed > change won't be correct. --=20 Thomas Perrot, Bootlin Embedded Linux and kernel engineering https://bootlin.com --=-ejHT/lGTQBdmCNEHSl5Q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEh0B3xqajCiMDqBIhn8ALBXH+Cu0FAmXxrHkACgkQn8ALBXH+ Cu0e2wv6A0yb8620vWwKOceSKAQ9PGXx6VVDpiEBk1S7Ga6L1FXgL6bYeXleE/t4 MhfEXjGpeQEjIgCc0UPtWs3il9LsWiGla6sAJAs9wNCcckQiOkHUFPJdA/jM5OM3 +03DqH3ybJ0prSZYKPmwiDp/I7UivzsIY/TtY8wLabeyV7kSZTVNWRrxUB0Eo2ST zo156o/RINOH1uyo/M6v+3au3gpaag+mUUr9YTumTTMwusEo/sbVDaBnCrRIjz+r xSKdSyKnbvLoHp5ImCCBtWXAV4boNVrbKImnX/U056YYqgcMe9Fi+Uik0F7HZWgV m4ePL0F1X+eqcgET017IYuWhgMoZZe7hRSaRojJZiu4bLt/DGcaa/mAzyrA+Ry7r u+veh3PNbG9StWGhcDJ91TlOkEtVemFwoEaGfLAYbyjOxdZnCbKLDRJtzFQ79vyt VB3AKmtfvCNosRtOqOdYfCiJdK1tmzTJeUROYaphdJ7KvhRG4+qbpr0gEo9F2D9c RYDgFzPj =8JL7 -----END PGP SIGNATURE----- --=-ejHT/lGTQBdmCNEHSl5Q--