[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1277731840.2089.8.camel@achroite.uk.solarflarecom.com>
Date: Mon, 28 Jun 2010 14:30:40 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Stanislaw Gruszka <sgruszka@...hat.com>
Cc: Amit Salecha <amit.salecha@...gic.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Amerigo Wang <amwang@...hat.com>,
Anirban Chakraborty <anirban.chakraborty@...gic.com>
Subject: Re: [PATCH -next] qlcnic: fail when try to setup unsupported
features
On Mon, 2010-06-28 at 14:16 +0100, Ben Hutchings wrote:
> On Mon, 2010-06-28 at 14:58 +0200, Stanislaw Gruszka wrote:
> > On Mon, 28 Jun 2010 07:36:04 -0500
> > Amit Salecha <amit.salecha@...gic.com> wrote:
> >
> > > - ethtool_op_set_flags(netdev, data);
> > > -
> > > - hw_lro = (data & ETH_FLAG_LRO) ? QLCNIC_LRO_ENABLED : 0;
> > > + if (data & ETH_FLAG_LRO) {
> > > + hw_lro = QLCNIC_LRO_ENABLED;
> > > + netdev->features |= NETIF_F_LRO;
> > > + } else {
> > > + hw_lro = 0;
> > > + netdev->features &= ~NETIF_F_LRO;
> > > + }
> > >
> > > Above hunk is unnecessary.
> >
> > Yes, I did not describe that change in the changelog. I want to
> > remove such usage of ethtool_op_set_flags() for my furher patches, where
> > I plan to add return EOPNOTSUPP to ethtool_op_set_flags().
>
> You might as well remove ethtool_op_set_flags() in that case, as this is
> equivalent to the behaviour when ethtool_ops::set_flags is NULL.
>
> It would be more useful to add a supported_flags parameter to
> ethtool_op_set_flags() so it can check the requested flags against the
> driver/hardware capabilities.
I also just noticed that ethtool.h says set_flags() will return -EINVAL
for unsupported values. The current implementations variously return
-EINVAL or -EOPNOTSUPP.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists