mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Luo bin <luobin9@huawei.com>
Cc: <davem@davemloft.net>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <luoxianjun@huawei.com>,
	<yin.yinshi@huawei.com>, <cloud.wangxiaoyun@huawei.com>
Subject: Re: [PATCH net-next v1 2/5] hinic: add support to set and get irq coalesce
Date: Mon, 22 Jun 2020 15:08:43 -0700	[thread overview]
Message-ID: <20200622150843.5c0a94ff@kicinski-fedora-PC1C0HJN> (raw)
In-Reply-To: <20200620094258.13181-3-luobin9@huawei.com>

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?

  parent reply	other threads:[~2020-06-22 22:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  9:42 [PATCH net-next v1 0/5] hinic: add some ethtool ops support Luo bin
2020-06-20  9:42 ` [PATCH net-next v1 1/5] hinic: add support to set and get pause params Luo bin
2020-06-20  9:42 ` [PATCH net-next v1 2/5] hinic: add support to set and get irq coalesce Luo bin
2020-06-22 22:07   ` Jakub Kicinski
2020-06-23  6:40     ` luobin (L)
2020-06-22 22:08   ` Jakub Kicinski [this message]
2020-06-23  6:41     ` luobin (L)
2020-06-20  9:42 ` [PATCH net-next v1 3/5] hinic: add self test support Luo bin
2020-06-20  9:42 ` [PATCH net-next v1 4/5] hinic: add support to identify physical device Luo bin
2020-06-20  9:42 ` [PATCH net-next v1 5/5] hinic: add support to get eeprom information Luo bin
2020-06-20 16:00   ` Andrew Lunn
2020-06-22  2:05     ` luobin (L)
2020-06-22 22:15   ` Jakub Kicinski
2020-06-23  6:48     ` luobin (L)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200622150843.5c0a94ff@kicinski-fedora-PC1C0HJN \
    --to=kuba@kernel.org \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luobin9@huawei.com \
    --cc=luoxianjun@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=yin.yinshi@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®