[dpdk-dev] [PATCH v2] net/vmxnet3: Added mtu_set() function to allow setting MTU.

Stephen Hemminger stephen at networkplumber.org
Tue Aug 20 17:12:11 CEST 2019


On Tue, 20 Aug 2019 04:06:53 +0000
"Myers, Charles" <Charles.Myers at 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.



More information about the dev mailing list