From patchwork Fri Feb 26 11:54:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 46324 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 17787B7CFA for ; Fri, 26 Feb 2010 22:54:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935511Ab0BZLyj (ORCPT ); Fri, 26 Feb 2010 06:54:39 -0500 Received: from qmta03.emeryville.ca.mail.comcast.net ([76.96.30.32]:34103 "EHLO qmta03.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935157Ab0BZLyi (ORCPT ); Fri, 26 Feb 2010 06:54:38 -0500 Received: from omta02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by qmta03.emeryville.ca.mail.comcast.net with comcast id mbt81d00C0QkzPwA3bufZs; Fri, 26 Feb 2010 11:54:39 +0000 Received: from localhost.localdomain ([63.64.152.142]) by omta02.emeryville.ca.mail.comcast.net with comcast id mbuM1d00434bfcX8NbuQ1f; Fri, 26 Feb 2010 11:54:36 +0000 From: Jeff Kirsher Subject: [net-next-2.6 PATCH] ethtool: Add n-tuple string length to drvinfo and return it To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Peter P Waskiewicz Jr , Jeff Kirsher Date: Fri, 26 Feb 2010 03:54:20 -0800 Message-ID: <20100226115355.20213.59254.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Peter Waskiewicz The drvinfo struct should include the number of strings that get_rx_ntuple will return. It will be variable if an underlying driver implements its own get_rx_ntuple routine, so userspace needs to know how much data is coming. Signed-off-by: Peter P Waskiewicz Jr Signed-off-by: Jeff Kirsher --- include/linux/ethtool.h | 1 + net/core/ethtool.c | 3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index cca1c3d..f7992a2 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -63,6 +63,7 @@ struct ethtool_drvinfo { char reserved2[12]; __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ + __u32 n_ntuples; /* number of n-tuple filters from GSTRINGS */ __u32 testinfo_len; __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 31b1edd..1c94f48 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -224,6 +224,9 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use rc = ops->get_sset_count(dev, ETH_SS_PRIV_FLAGS); if (rc >= 0) info.n_priv_flags = rc; + rc = ops->get_sset_count(dev, ETH_SS_NTUPLE_FILTERS); + if (rc >= 0) + info.n_ntuples = rc; } if (ops->get_regs_len) info.regdump_len = ops->get_regs_len(dev);