RE: [PATCH v3 net-next 4/5] net: fec: add change_mtu to support dynamic buffer allocation
From: Wei Fang
Date: Sun Aug 24 2025 - 23:20:11 EST
> +static int fec_change_mtu(struct net_device *ndev, int new_mtu) {
> + struct fec_enet_private *fep = netdev_priv(ndev);
> + int order, done;
> +
> + order = get_order(new_mtu + ETH_HLEN + ETH_FCS_LEN);
> + if (fep->pagepool_order == order) {
> + WRITE_ONCE(ndev->mtu, new_mtu);
> + return 0;
> + }
> +
> + fep->pagepool_order = order;
> + fep->rx_frame_size = (PAGE_SIZE << order) - FEC_ENET_XDP_HEADROOM
> + - SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
Same comments as in v2, please check the new value whether is reasonable,
if it exceeds hardware capability, then return an error.