On Tue, 20 Aug 2019 04:06:53 +0000
"Myers, Charles" <charles.my...@spirent.com> wrote:

>  static int
> +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
> +{
> +     if (mtu < VMXNET3_MIN_MTU || mtu > VMXNET3_MAX_MTU) {
> +             PMD_DRV_LOG(ERR, "MTU should be between %d and %d",
> +                          VMXNET3_MIN_MTU, VMXNET3_MAX_MTU);
> +             return -EINVAL;
> +     }
> +

This is not the best way to handle checking validity of MTU value.

The device should report min/max MTU and then rte_eth_dev_set_mtu
will do enforcement there.

This allows application to know what MTU to use, and eliminates
guess/check behavior.

Reply via email to