RE: [PATCH v2 net-next 3/5] et: fec: add rx_frame_size to support configurable RX length
From: Shenwei Wang
Date: Fri Aug 22 2025 - 09:38:44 EST
> -----Original Message-----
> From: Wei Fang <wei.fang@xxxxxxx>
> Sent: Friday, August 22, 2025 5:10 AM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Clark Wang <xiaoning.wang@xxxxxxx>; Stanislav Fomichev
> <sdf@xxxxxxxxxxx>; imx@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; dl-linux-imx <linux-imx@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>
> Subject: RE: [PATCH v2 net-next 3/5] et: fec: add rx_frame_size to support
> configurable RX length
>
> > @@ -4563,6 +4563,7 @@ fec_probe(struct platform_device *pdev)
> > pinctrl_pm_select_sleep_state(&pdev->dev);
> >
> > fep->pagepool_order = 0;
> > + fep->rx_frame_size = FEC_ENET_RX_FRSIZE;
>
> According to the RM, to allow one maximum size frame per buffer,
> FEC_R_BUFF_SIZE must be set to FEC_R_CNTRL [MAX_FL] or larger.
> FEC_ENET_RX_FRSIZE is greater than PKT_MAXBUF_SIZE, I'm not sure whether it
> will cause some unknown issues.
MAX_FL defines the maximum allowable frame length, while TRUNC_FL specifies the threshold beyond
which frames are truncated. Based on this logic, the documentation appears to be incorrect-TRUNC_FL
should never exceed MAX_FL, as doing so would make the truncation mechanism ineffective.
This has been confirmed through testing data.
Regards,
Shenwei
>
> > fep->max_buf_size = PKT_MAXBUF_SIZE;
> > ndev->max_mtu = fep->max_buf_size - ETH_HLEN - ETH_FCS_LEN;