Re: [PATCH -next] qlcnic: fail when try to setup unsupported features
From: Ben Hutchings <hidden>
Date: 2010-06-28 13:30:44
On Mon, 2010-06-28 at 14:16 +0100, Ben Hutchings wrote:
On Mon, 2010-06-28 at 14:58 +0200, Stanislaw Gruszka wrote:quoted
On Mon, 28 Jun 2010 07:36:04 -0500 Amit Salecha [off-list ref] wrote:quoted
- 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.