* [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
@ 2011-01-04 23:29 Alexander Duyck
2011-01-05 0:01 ` Ben Hutchings
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Duyck @ 2011-01-04 23:29 UTC (permalink / raw)
To: davem, bhutchings; +Cc: netdev
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;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
2011-01-04 23:29 [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count Alexander Duyck
@ 2011-01-05 0:01 ` Ben Hutchings
2011-01-05 1:06 ` Alexander Duyck
0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2011-01-05 0:01 UTC (permalink / raw)
To: Alexander Duyck; +Cc: davem, netdev
On Tue, 2011-01-04 at 15:29 -0800, Alexander Duyck wrote:
> 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.
[...]
Nothing implements ethtool_ops::get_rx_ntuple, anyway.
The fallback implementation is totally bogus, too. Maximum of 1024
filters? Erm, sfc can handle more than that. And doing complex string
formatting in the kernel, even though all the parsing is in ethtool?
Please, let's write off ETHTOOL_GRXNTUPLE as a failed experiment and
replace it with a command that behaves more like ETHTOOL_GRXCLSRLALL.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
2011-01-05 0:01 ` Ben Hutchings
@ 2011-01-05 1:06 ` Alexander Duyck
2011-01-05 15:26 ` Ben Hutchings
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Duyck @ 2011-01-05 1:06 UTC (permalink / raw)
To: Ben Hutchings; +Cc: davem, netdev
On 1/4/2011 4:01 PM, Ben Hutchings wrote:
> On Tue, 2011-01-04 at 15:29 -0800, Alexander Duyck wrote:
>> 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.
> [...]
>
> Nothing implements ethtool_ops::get_rx_ntuple, anyway.
>
> The fallback implementation is totally bogus, too. Maximum of 1024
> filters? Erm, sfc can handle more than that. And doing complex string
> formatting in the kernel, even though all the parsing is in ethtool?
>
> Please, let's write off ETHTOOL_GRXNTUPLE as a failed experiment and
> replace it with a command that behaves more like ETHTOOL_GRXCLSRLALL.
>
> Ben.
In order to address several different issues in the perfect filters
provided by 82599 I found it necessary to implement get_rx_ntuple so
that the driver could maintain the filter list inside of the driver
instead of having it maintained by the stack. In doing so though I
found the bug.
I agree the fallback implementation has a limitation on the number and
format of filters it supports. However declaring the function a "failed
experiment" and just dropping it isn't exactly constructive since we
have customers that are making use of the feature. The fallback
implementation is meant to be just that, and the patch I provided makes
it possible to support more filters if needed by implementing a means of
tracking/displaying the filters within the driver itself.
Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
2011-01-05 1:06 ` Alexander Duyck
@ 2011-01-05 15:26 ` Ben Hutchings
2011-01-05 16:57 ` Alexander Duyck
0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2011-01-05 15:26 UTC (permalink / raw)
To: Alexander Duyck; +Cc: davem, netdev
On Tue, 2011-01-04 at 17:06 -0800, Alexander Duyck wrote:
> On 1/4/2011 4:01 PM, Ben Hutchings wrote:
> > On Tue, 2011-01-04 at 15:29 -0800, Alexander Duyck wrote:
> >> 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.
> > [...]
> >
> > Nothing implements ethtool_ops::get_rx_ntuple, anyway.
> >
> > The fallback implementation is totally bogus, too. Maximum of 1024
> > filters? Erm, sfc can handle more than that. And doing complex string
> > formatting in the kernel, even though all the parsing is in ethtool?
> >
> > Please, let's write off ETHTOOL_GRXNTUPLE as a failed experiment and
> > replace it with a command that behaves more like ETHTOOL_GRXCLSRLALL.
> >
> > Ben.
>
> In order to address several different issues in the perfect filters
> provided by 82599 I found it necessary to implement get_rx_ntuple so
> that the driver could maintain the filter list inside of the driver
> instead of having it maintained by the stack. In doing so though I
> found the bug.
>
> I agree the fallback implementation has a limitation on the number and
> format of filters it supports. However declaring the function a "failed
> experiment" and just dropping it isn't exactly constructive since we
> have customers that are making use of the feature.
[...]
We can at least drop that fallback implementation since it apparently
doesn't work properly for either of the drivers that currently use it.
In the medium term, I do want to replace it with a binary interface and
move that formatting to ethtool. ETHTOOL_GRXNTUPLE could be kept around
for a while for ixgbe only, while your customers have a chance to get
the updated ethtool.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
2011-01-05 15:26 ` Ben Hutchings
@ 2011-01-05 16:57 ` Alexander Duyck
2011-01-05 17:28 ` Ben Hutchings
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Duyck @ 2011-01-05 16:57 UTC (permalink / raw)
To: Ben Hutchings; +Cc: davem, netdev
On 1/5/2011 7:26 AM, Ben Hutchings wrote:
> On Tue, 2011-01-04 at 17:06 -0800, Alexander Duyck wrote:
>> On 1/4/2011 4:01 PM, Ben Hutchings wrote:
>>> On Tue, 2011-01-04 at 15:29 -0800, Alexander Duyck wrote:
>>>> 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.
>>> [...]
>>>
>>> Nothing implements ethtool_ops::get_rx_ntuple, anyway.
>>>
>>> The fallback implementation is totally bogus, too. Maximum of 1024
>>> filters? Erm, sfc can handle more than that. And doing complex string
>>> formatting in the kernel, even though all the parsing is in ethtool?
>>>
>>> Please, let's write off ETHTOOL_GRXNTUPLE as a failed experiment and
>>> replace it with a command that behaves more like ETHTOOL_GRXCLSRLALL.
>>>
>>> Ben.
>>
>> In order to address several different issues in the perfect filters
>> provided by 82599 I found it necessary to implement get_rx_ntuple so
>> that the driver could maintain the filter list inside of the driver
>> instead of having it maintained by the stack. In doing so though I
>> found the bug.
>>
>> I agree the fallback implementation has a limitation on the number and
>> format of filters it supports. However declaring the function a "failed
>> experiment" and just dropping it isn't exactly constructive since we
>> have customers that are making use of the feature.
> [...]
>
> We can at least drop that fallback implementation since it apparently
> doesn't work properly for either of the drivers that currently use it.
>
> In the medium term, I do want to replace it with a binary interface and
> move that formatting to ethtool. ETHTOOL_GRXNTUPLE could be kept around
> for a while for ixgbe only, while your customers have a chance to get
> the updated ethtool.
>
> Ben.
>
I'm fine with us replacing the ETHTOOL_GRXNTUPLE interface, but I would
prefer to do it after the merge windows for 2.6.39 has opened. For now
I would like to get this patch accepted as my main concern is getting a
minor fix in versus rewriting the entire interface.
While we're at it how would you feel about us inverting the masks for
setting up an ntuple by making them an inclusion mask instead of an
exclusion one? The reason why I ask is because I have to perform an and
operation over all the input anyway before I can use it to compute the
hashes and as such I am having to invert almost all of the mask bits,
and it appears you are having to do this as well for many of the masks
in sfc.
Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count
2011-01-05 16:57 ` Alexander Duyck
@ 2011-01-05 17:28 ` Ben Hutchings
0 siblings, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2011-01-05 17:28 UTC (permalink / raw)
To: Alexander Duyck; +Cc: davem, netdev
On Wed, 2011-01-05 at 08:57 -0800, Alexander Duyck wrote:
[...]
> I'm fine with us replacing the ETHTOOL_GRXNTUPLE interface, but I would
> prefer to do it after the merge windows for 2.6.39 has opened. For now
> I would like to get this patch accepted as my main concern is getting a
> minor fix in versus rewriting the entire interface.
So long as there are no in-tree implementations of
ethtool_ops::get_rx_ntuple then it's a valid candidate for removal.
Since you now want to implement it, I think you should submit the
implementation along with the fix for the calling code.
> While we're at it how would you feel about us inverting the masks for
> setting up an ntuple by making them an inclusion mask instead of an
> exclusion one? The reason why I ask is because I have to perform an and
> operation over all the input anyway before I can use it to compute the
> hashes and as such I am having to invert almost all of the mask bits,
> and it appears you are having to do this as well for many of the masks
> in sfc.
We can't change the userland interface but we could potentially invert
the masks in the ethtool core. I'm really not convinced that this is
worth the trouble though. (And it would be a massive pain for the OOT
versions of our drivers.)
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-05 17:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-04 23:29 [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly interpret string count Alexander Duyck
2011-01-05 0:01 ` 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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.