Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396302

Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations
Date 2016-05-07 14:10 +0200
Message-ID <rw9dv-1ix-9@gated-at.bofh.it> (permalink)
References <rvXcl-6kA-5@gated-at.bofh.it> <rvXcl-6kA-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, 2016-05-06 at 16:12 -0700, Shrikrishna Khare wrote:
[...]
> +static int
> +vmxnet3_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec)
> +{
[...]
> +	switch (ec->rx_coalesce_usecs) {
> +	case VMXNET3_COALESCE_DEFAULT:
> +	case VMXNET3_COALESCE_DISABLED:
> +	case VMXNET3_COALESCE_ADAPT:
> +		if (ec->tx_max_coalesced_frames ||
> +		    ec->tx_max_coalesced_frames_irq ||
> +		    ec->rx_max_coalesced_frames_irq) {
> +			return -EINVAL;
> +		}
> +		memset(adapter->coal_conf, 0, sizeof(*adapter->coal_conf));
> +		adapter->coal_conf->coalMode = ec->rx_coalesce_usecs;
> +		break;
> +	case VMXNET3_COALESCE_STATIC:
[...]

I don't want to see drivers introducing magic values for fields that
are denominated in microseconds (especially not for 0, which is the
correct way to specify 'no coalescing').  If the current
ethtool_coalesce structure is inadequate, propose an extension.

Ben.

-- 
Ben Hutchings
Editing code like this is akin to sticking plasters on the bleeding stump
of a severed limb. - me, 29 June 1999

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce, set_coalesce ethtool operations Shrikrishna Khare <skhare@vmware.com> - 2016-05-07 01:20 +0200
  Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for  get_coalesce, set_coalesce ethtool operations Ben Hutchings <ben@decadent.org.uk> - 2016-05-07 14:10 +0200
    Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for  get_coalesce, set_coalesce ethtool operations David Miller <davem@davemloft.net> - 2016-05-07 19:50 +0200
    Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for get_coalesce,  set_coalesce ethtool operations Shrikrishna Khare <skhare@vmware.com> - 2016-05-08 23:00 +0200
      Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for  get_coalesce, set_coalesce ethtool operations Ben Hutchings <ben@decadent.org.uk> - 2016-05-09 02:20 +0200
        RE: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for  get_coalesce, set_coalesce ethtool operations David Laight <David.Laight@ACULAB.COM> - 2016-05-10 13:30 +0200
          Re: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for  get_coalesce, set_coalesce ethtool operations Ben Hutchings <ben@decadent.org.uk> - 2016-05-10 14:10 +0200

csiph-web