Patchwork [net-next-2.6] ethtool: Add n-tuple string length to drvinfo and return it

login
register
mail settings
Submitter Jeff Garzik
Date Feb. 26, 2010, 1:59 p.m.
Message ID <4B87D3BA.7050404@garzik.org>
Download mbox | patch
Permalink /patch/46331/
State Awaiting Upstream
Delegated to: David Miller
Headers show

Comments

Jeff Garzik - Feb. 26, 2010, 1:59 p.m.
On 02/26/2010 08:56 AM, Jeff Garzik wrote:
> However, perhaps consider the following patch for returning n-tuple
> count, for four reasons:
>
> 1) space in ethtool_drvinfo is limited
>
> 2) the patch below permits trivial string set addition, without
> ABI changes beyond adding a new ETH_SS_xxx constant.
>
> 3) the patch below permits direct access to ops->get_sset_count(),
> rather than implicit access via ethtool_drvinfo
>
> 4) ethtool_drvinfo interface does not permit indication of
> ops->get_sset_count() failure, versus returning zero value. The
> patch below does so, via output sset_mask.
>
> WARNING: this patch is compile-tested only.
>
> NOTE: I added a cosmetic fix to ETHTOOL_[GS]RXNTUPLE constants, making
> their indentation consistent with the rest of the list of constants.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>


With, perhaps, a note like the attached as a reminder to folks about 
future additions.

Patch

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 31b1edd..e376e8c 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -212,6 +212,9 @@  static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use
 	info.cmd = ETHTOOL_GDRVINFO;
 	ops->get_drvinfo(dev, &info);
 
+	/* this method of obtaining string set info is deprecated;
+	 * consider using ETHTOOL_GSSET_INFO instead
+	 */
 	if (ops->get_sset_count) {
 		int rc;