[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D5F4B8B61@AcuExch.aculab.com>
Date: Tue, 10 May 2016 11:24:54 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Ben Hutchings' <ben@...adent.org.uk>,
Shrikrishna Khare <skhare@...are.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pv-drivers@...are.com" <pv-drivers@...are.com>,
Keyong Sun <sunk@...are.com>,
Manoj Tammali <tammalim@...are.com>
Subject: RE: [PATCH net-next 5/7] Driver: Vmxnet3: Add support for
get_coalesce, set_coalesce ethtool operations
From: Ben Hutchings
> Sent: 09 May 2016 01:17
> On Sun, 2016-05-08 at 13:55 -0700, Shrikrishna Khare wrote:
> >
> > On Sat, 7 May 2016, Ben Hutchings wrote:
> >
> > > 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.
> >
> > For vmxnet3, we need an ethtool mechanism to indicate coalescing mode to
> > the device.
> >
> > Would a patch that maps 0 to 'no coalescing' be acceptable? That is:
> >
> > rx-usecs = 0 -> coalescing disabled.
> > rx-usecs = 1 -> default (chosen by the device).
> > rx-usecs = 2 -> adaptive coalescing.
> > rx-usecs = 3 -> static coalescing.
Would it be better to use stupidly large values for the non-zero special values?
That would less problematic if someone expects 2 to mean '2 usecs'.
David
Powered by blists - more mailing lists