Re: [PATCH v3 net-next 3/5] net: fec: add rx_frame_size to support configurable RX length
From: Shenwei Wang
Date: Sat Aug 23 2025 - 16:10:23 EST
> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Saturday, August 23, 2025 2:11 PM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Wei Fang <wei.fang@xxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Alexei Starovoitov <ast@xxxxxxxxxx>; Daniel Borkmann
> <daniel@xxxxxxxxxxxxx>; Jesper Dangaard Brouer <hawk@xxxxxxxxxx>; John
> Fastabend <john.fastabend@xxxxxxxxx>; Clark Wang
> <xiaoning.wang@xxxxxxx>; Stanislav Fomichev <sdf@xxxxxxxxxxx>;
> imx@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; dl-
> linux-imx <linux-imx@xxxxxxx>
> Subject: [EXT] Re: [PATCH v3 net-next 3/5] net: fec: add rx_frame_size to
> support configurable RX length
> On Sat, Aug 23, 2025 at 02:01:08PM -0500, Shenwei Wang wrote:
> > Add a new rx_frame_size member in the fec_enet_private structure to
> > decouple frame size configuration from max_buf_size. This allows more
> > precise control over RX frame length settings. It is particularly
> > useful for Jumbo frame support because the RX frame size may possible
> > larger than the allocated RX buffer.
>
> Please could you extend that a little. What happens if the received frame is bigger
> than the buffer? Does the hardware fragment it over two buffers?
>
The hardware doesn't have the capability to fragment received frames that exceed the MAX_FL
value. Instead, it flags an overrun error in the status register when such frames are encountered.
> >
> > Configure TRUNC_FL (Frame Truncation Length) based on the RX buffer size.
> > Frames exceeding this limit will be treated as error packets and dropped.
>
> This bit confuses me. You want to allow rx_frame_size to be bigger than the
> buffer size, but you also want to discard frames bigger than the buffer size?
>
MAX_FL defines the maximum allowable frame length, while TRUNC_FL specifies the
threshold beyond which frames are truncated.
Here, TRUNC_FL is configured based on the RX buffer size, allowing the hardware to
handle oversized frame errors automatically without requiring software intervention.
Regards,
Shenwei
> Andrew
>
> ---
> pw-bot: cr