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.


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to