[PATCH 5/7] net/nfb: support setting Rx MTU
Martin Spinler
spinler at cesnet.cz
Thu Feb 19 07:20:32 CET 2026
> 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.
More information about the dev
mailing list