On Thu, 17 Mar 2022 16:39:17 +0200 Peng Zhang <peng.zh...@corigine.com> wrote:
> + /* the setting mtu is in the range */ > + if (mtu < 68 || mtu > hw->max_mtu) { > + PMD_DRV_LOG(ERR, "the setting mtu cannot be less than 68 or > more than %d", > + hw->max_mtu); > + return -ERANGE; > + } > + > + /* the setting mtu is lower than flbufsz */ > + if (mtu > hw->flbufsz) { > + PMD_DRV_LOG(ERR, "the setting mtu must be lower than current > mbufsize of %d", > + hw->flbufsz); > + return -ERANGE; The ethdev layer already has min/max mtu checks, why is it needed inside common code? It looks like nfp_net_infos_get() does not set these values. Please fix it there instead. PS: 68 is RTE_ETHER_MIN_MTU so please use that.