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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB91857813EFDD0DB08A36B6DE8903A@PAXPR04MB9185.eurprd04.prod.outlook.com>
Date: Fri, 5 Sep 2025 20:14:49 +0000
From: Shenwei Wang <shenwei.wang@....com>
To: Frank Li <frank.li@....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" <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 v5 net-next 5/5] net: fec: enable the Jumbo frame support
 for i.MX8QM



> -----Original Message-----
> From: Frank Li <frank.li@....com>
> Sent: Thursday, September 4, 2025 4:40 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: Re: [PATCH v5 net-next 5/5] net: fec: enable the Jumbo frame support
> for i.MX8QM
> 
> On Thu, Sep 04, 2025 at 03:35:02PM -0500, Shenwei Wang wrote:
> > Certain i.MX SoCs, such as i.MX8QM and i.MX8QXP, feature enhanced FEC
> > hardware that supports Ethernet Jumbo frames with packet sizes up to
> > 16K bytes.
> >
> > When Jumbo frames are supported, the TX FIFO may not be large enough
> > to hold an entire frame. To handle this, the FIFO is configured to
> > operate in cut-through mode when the frame size exceeds
> > (PKT_MAXBUF_SIZE - ETH_HLEN - ETH_FCS_LEN), which allows transmission
> > to begin once the FIFO reaches a certain threshold.
> >
> > Signed-off-by: Shenwei Wang <shenwei.wang@....com>
> > ---
> >  drivers/net/ethernet/freescale/fec.h      |  3 +++
> >  drivers/net/ethernet/freescale/fec_main.c | 25
> > +++++++++++++++++++----
> >  2 files changed, 24 insertions(+), 4 deletions(-)
> >
> ...
> >
> >  	if (fep->bufdesc_ex)
> > @@ -4614,7 +4626,12 @@ fec_probe(struct platform_device *pdev)
> >
> >  	fep->pagepool_order = 0;
> >  	fep->rx_frame_size = FEC_ENET_RX_FRSIZE;
> > -	fep->max_buf_size = PKT_MAXBUF_SIZE;
> > +
> > +	if (fep->quirks & FEC_QUIRK_JUMBO_FRAME)
> > +		fep->max_buf_size = MAX_JUMBO_BUF_SIZE;
> 
> If only use once, needn't define macro.
> 

Using a macro here keeps consistency with the original coding style, while also 
making the code cleaner and easier to read.

Thanks,
Shenwei

> Frank
> > +	else
> > +		fep->max_buf_size = PKT_MAXBUF_SIZE;
> > +
> >  	ndev->max_mtu = fep->max_buf_size - ETH_HLEN - ETH_FCS_LEN;
> >
> >  	ret = register_netdev(ndev);
> > --
> > 2.43.0
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ