Subject: Re: [PATCH net-next 11/19] net: usb: aqc111: Add support for changing MTU

From: Andrew Lunn <[email-masked]>
Date: Sat, 6 Oct 2018 18:56:03 +0200

> +static int aqc111_change_mtu(struct net_device *net, int new_mtu)
> +{
> +	struct usbnet *dev = netdev_priv(net);
> +	u16 reg16 = 0;
> +	u8 buf[5];
> +
> +	if (new_mtu <= 0 || new_mtu > 16334) {
> +		netdev_info(net, "Invalid MTU %d requested, hw max 16334",
> +			    new_mtu);
> +		return -EINVAL;
> +	}

Please set net->min_mtu, and net->max_mtu, and the core should do this
checking for you. See dev_set_mtu_ext().

	 Andrew