lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 13 Mar 2024 14:39:05 +0100
From: Thomas Perrot <thomas.perrot@...tlin.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>, Claudiu Beznea
 <claudiu.beznea@...on.dev>, "David S . Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
 netdev@...r.kernel.org,  linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3] net: macb: remove change_mtu callback

Hello,

On Mon, 2024-03-11 at 16:17 -0700, Jakub Kicinski wrote:
> On Mon, 11 Mar 2024 16:43:15 +0100 thomas.perrot@...tlin.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) ?

Thank you for your review, indeed that won’t be correct on GEM in when
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.

-- 
Thomas Perrot, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


Download attachment "signature.asc" of type "application/pgp-signature" (660 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ