lkml.org 
[lkml]   [2020]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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?

\
 
 \ /
  Last update: 2020-06-23 00:09    [W:0.183 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site