Re: [PATCH V5 net-next 5/6] net: hns3: add support to set/get rx buf len via ethtool for hns3 driver

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

 



>  static int hns3_check_ringparam(struct net_device *ndev,
> -				struct ethtool_ringparam *param)
> +				struct ethtool_ringparam *param,
> +				struct kernel_ethtool_ringparam *kernel_param)
>  {
> +#define RX_BUF_LEN_2K 2048
> +#define RX_BUF_LEN_4K 4096

include/linux/size.h

#define SZ_2K                           0x00000800
#define SZ_4K                           0x00001000


>  	if (hns3_nic_resetting(ndev))
>  		return -EBUSY;
>  
>  	if (param->rx_mini_pending || param->rx_jumbo_pending)
>  		return -EINVAL;
>  
> +	if (kernel_param->rx_buf_len != RX_BUF_LEN_2K &&
> +	    kernel_param->rx_buf_len != RX_BUF_LEN_4K) {
> +		netdev_err(ndev, "Rx buf len only support 2048 and 4096\n");
> +		return -EINVAL;

Same question i asked in the cover note. MTU is 4K, i set rx buf len
to 2K. What happens? Should there be an EINVAL here?

   Andrew



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux