From: Alexander Duyck <alexander.h.duyck@intel•com>
To: davem@davemloft•net, bhutchings@solarflare•com
Cc: netdev@vger•kernel.org
Subject: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
Date: Tue, 04 Jan 2011 15:29:48 -0800 [thread overview]
Message-ID: <20110104232947.3451.91153.stgit@gitlad.jf.intel.com> (raw)
Currently any strings returned via the get_rx_ntuple call will just be
dropped because the num_strings will be zero. In order to correct this I
am updating things so that the return value of get_rx_ntuple is the number
of strings that were written, or a negative value if there was an error.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel•com>
---
net/core/ethtool.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 1774178..7ade13b 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -587,6 +587,9 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr)
if (ops->get_rx_ntuple) {
/* driver-specific filter grab */
ret = ops->get_rx_ntuple(dev, gstrings.string_set, data);
+ if (ret < 0)
+ goto out;
+ num_strings = ret;
goto copy;
}
next reply other threads:[~2011-01-04 23:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 23:29 Alexander Duyck [this message]
2011-01-05 0:01 ` [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count Ben Hutchings
2011-01-05 1:06 ` Alexander Duyck
2011-01-05 15:26 ` Ben Hutchings
2011-01-05 16:57 ` Alexander Duyck
2011-01-05 17:28 ` Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110104232947.3451.91153.stgit@gitlad.jf.intel.com \
--to=alexander.h.duyck@intel$(echo .)com \
--cc=bhutchings@solarflare$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox