lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200622150843.5c0a94ff@kicinski-fedora-PC1C0HJN>
Date:   Mon, 22 Jun 2020 15:08:43 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Luo bin <luobin9@...wei.com>
Cc:     <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
        <netdev@...r.kernel.org>, <luoxianjun@...wei.com>,
        <yin.yinshi@...wei.com>, <cloud.wangxiaoyun@...wei.com>
Subject: Re: [PATCH net-next v1 2/5] hinic: add support to set and get irq
 coalesce

On Sat, 20 Jun 2020 17:42:55 +0800 Luo bin wrote:
> +static int is_coalesce_exceed_limit(struct net_device *netdev,
> +				    const struct ethtool_coalesce *coal)
> +{
> +	struct hinic_dev *nic_dev = netdev_priv(netdev);
> +
> +	if (coal->rx_coalesce_usecs > COALESCE_MAX_TIMER_CFG) {
> +		netif_err(nic_dev, drv, netdev,
> +			  "Rx_coalesce_usecs out of range[%d-%d]\n", 0,
> +			  COALESCE_MAX_TIMER_CFG);
> +		return -EOPNOTSUPP;
> +	}
> +
> +	if (coal->rx_max_coalesced_frames > COALESCE_MAX_PENDING_LIMIT) {
> +		netif_err(nic_dev, drv, netdev,
> +			  "Rx_max_coalesced_frames out of range[%d-%d]\n", 0,
> +			  COALESCE_MAX_PENDING_LIMIT);
> +		return -EOPNOTSUPP;
> +	}
> +
> +	if (coal->tx_coalesce_usecs > COALESCE_MAX_TIMER_CFG) {
> +		netif_err(nic_dev, drv, netdev,
> +			  "Tx_coalesce_usecs out of range[%d-%d]\n", 0,
> +			  COALESCE_MAX_TIMER_CFG);
> +		return -EOPNOTSUPP;
> +	}
> +
> +	if (coal->tx_max_coalesced_frames > COALESCE_MAX_PENDING_LIMIT) {
> +		netif_err(nic_dev, drv, netdev,
> +			  "Tx_max_coalesced_frames out of range[%d-%d]\n", 0,
> +			  COALESCE_MAX_PENDING_LIMIT);
> +		return -EOPNOTSUPP;
> +	}
> +
> +	return 0;
> +}

I think ERANGE is a more appropriate error code in these?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ