Re: [PATCH 5/7] net/nfb: support setting Rx MTU

Martin Spinler
2026-02-19T06:20:35Z

> Since mtu is 16 bit value, you need to use uint32_t to avoid
> overflow.
>
> Something like:
> + uint32_t frame_len = (uint32_t)mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
> + if (frame_len > priv->frame_len_max_cap)
> + return -EINVAL;
>
> + for (i = 0; i < intl->max_rxmac; ++i)
> + nc_rxmac_set_frame_length(intl->rxmac[i], frame_len, RXMAC_FRAME_LENGTH_MAX);

Thank you, this check is cleaner.