lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1288646150.2231.62.camel@achroite.uk.solarflarecom.com>
Date:	Mon, 01 Nov 2010 21:15:50 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc:	netdev@...r.kernel.org, e1000-devel@...ts.sourceforge.net,
	Steve Glendinning <steve.glendinning@...c.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Rasesh Mody <rmody@...cade.com>,
	Debashis Dutt <ddutt@...cade.com>,
	Kristoffer Glembo <kristoffer@...sler.com>,
	linux-driver@...gic.com, linux-net-drivers@...arflare.com
Subject: Re: [PATCH 2/4] Ethtool: convert get_sg/set_sg calls to
 hw_features flag

On Sat, 2010-10-30 at 06:28 +0200, Michał Mirosław wrote:
[...]
> @@ -1088,7 +1076,19 @@ static int __ethtool_set_sg(struct net_device *dev, u32 data)
>  		if (err)
>  			return err;
>  	}
> -	return dev->ethtool_ops->set_sg(dev, data);
> +
> +	if (dev->ethtool_ops->hw_set_sg) {
> +		err = dev->ethtool_ops->hw_set_sg(dev, data);
> +		if (err)
> +			return min(err, 0);
> +	}
> +
> +	if (data)
> +		dev->features |= NETIF_F_SG;
> +	else
> +		dev->features &= ~NETIF_F_SG;
> +
> +	return 0;
>  }
[...]

The odd semantics of positive return values really need to be documented
- both in the commit message and in the comment on struct ethtool_ops.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ