Re: [PATCH net-next] virtio_net: add ethtool support for set and get of settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  2 Feb 2016 13:51:20 +0100
Nikolay Aleksandrov <razor@xxxxxxxxxxxxx> wrote:

> +static bool virtnet_validate_speed(u32 speed)
> +{
> +	switch (speed) {
> +	case SPEED_10:
> +	case SPEED_100:
> +	case SPEED_1000:
> +	case SPEED_2500:
> +	case SPEED_5000:
> +	case SPEED_10000:
> +	case SPEED_20000:
> +	case SPEED_25000:
> +	case SPEED_40000:
> +	case SPEED_50000:
> +	case SPEED_56000:
> +	case SPEED_100000:
> +	case SPEED_UNKNOWN:
> +		return true;
> +	}
> +
> +	return false;
> +}

Why limit to only known values. This switch() will get out of
date when some vendor introduces 64G or some other weird value.
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux