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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB9185014A230A36245436F01B8932A@PAXPR04MB9185.eurprd04.prod.outlook.com>
Date: Thu, 21 Aug 2025 19:31:57 +0000
From: Shenwei Wang <shenwei.wang@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: Wei Fang <wei.fang@....com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
 S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
 Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Alexei
 Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, Jesper
 Dangaard Brouer <hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>,
	Clark Wang <xiaoning.wang@....com>, Stanislav Fomichev <sdf@...ichev.me>,
	"imx@...ts.linux.dev" <imx@...ts.linux.dev>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH v2 net-next 1/5] net: fec: use a member variable for
 maximum buffer size



> -----Original Message-----
> From: Andrew Lunn <andrew@...n.ch>
> Sent: Thursday, August 21, 2025 1:56 PM
> To: Shenwei Wang <shenwei.wang@....com>
> Cc: Wei Fang <wei.fang@....com>; Andrew Lunn <andrew+netdev@...n.ch>;
> David S. Miller <davem@...emloft.net>; Eric Dumazet
> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> <pabeni@...hat.com>; Alexei Starovoitov <ast@...nel.org>; Daniel Borkmann
> <daniel@...earbox.net>; Jesper Dangaard Brouer <hawk@...nel.org>; John
> Fastabend <john.fastabend@...il.com>; Clark Wang
> <xiaoning.wang@....com>; Stanislav Fomichev <sdf@...ichev.me>;
> imx@...ts.linux.dev; netdev@...r.kernel.org; linux-kernel@...r.kernel.org; dl-
> linux-imx <linux-imx@....com>
> Subject: [EXT] Re: [PATCH v2 net-next 1/5] net: fec: use a member variable for
> maximum buffer size
> 
> > @@ -1145,9 +1145,12 @@ static void
> >  fec_restart(struct net_device *ndev)
> >  {
> >       struct fec_enet_private *fep = netdev_priv(ndev);
> > -     u32 rcntl = OPT_FRAME_SIZE | FEC_RCR_MII;
> > +     u32 rcntl = FEC_RCR_MII;
> >       u32 ecntl = FEC_ECR_ETHEREN;
> >
> > +     if (fep->max_buf_size == OPT_FRAME_SIZE)
> > +             rcntl |= (fep->max_buf_size << 16);
> 
> I was expecting something like s/OPT_FRAME_SIZE/fep->max_buf_size/g
> 

We can't simply replace the value here because it needs to be left-shifted by 16 bits. I intentionally 
preserved the original logic for consistency. In patch #3, the max_buf_size may become a different
one for Jumbo frame mode and the condition is updated to:
+	if (OPT_FRAME_SIZE != 0)

Thanks,
Shenwei

> This is introducing extra logic. I think the if (...) belongs in another patch. The
> assignment is however what i expected.
> 
>     Andrew
> 
> ---
> pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ