netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to set vlan filter for intel 82599
@ 2011-04-26  2:19 zhou rui
  2011-04-26  2:57 ` Ben Hutchings
  0 siblings, 1 reply; 8+ messages in thread
From: zhou rui @ 2011-04-26  2:19 UTC (permalink / raw)
  To: netdev

hi
here is the problem troubles me,how to set vlan filter for intel
82599? for example
I want vlan id 0~31 will go to queue 0, vlan id 32-63 will go to queue
1...below is my setting,but doesn't work

don't know the exact meanning of the vlan-mask and vlan,how are they calculated?

./ethtool -K eth5 ntuple on

./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x0000 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 0
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x0020 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 1
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x0040 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 2
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x0060 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 3
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x0080 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 4
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x00A0 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 5
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x00C0 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 6
./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
dst-port-mask 0x0 vlan 0x00E0 vlan-mask 0x00E0 user-def 0x0
user-def-mask 0x0 action 6

thanks
rui

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26  2:19 how to set vlan filter for intel 82599 zhou rui
@ 2011-04-26  2:57 ` Ben Hutchings
  2011-04-26  3:39   ` zhou rui
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2011-04-26  2:57 UTC (permalink / raw)
  To: zhou rui; +Cc: netdev

On Tue, 2011-04-26 at 10:19 +0800, zhou rui wrote:
> hi
> here is the problem troubles me,how to set vlan filter for intel
> 82599? for example
> I want vlan id 0~31 will go to queue 0, vlan id 32-63 will go to queue
> 1...below is my setting,but doesn't work
> 
> don't know the exact meanning of the vlan-mask and vlan,how are they calculated?
> 
> ./ethtool -K eth5 ntuple on
> 
> ./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
> dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
> dst-port-mask 0x0 vlan 0x0000 vlan-mask 0x00E0 user-def 0x0
> user-def-mask 0x0 action 0
[...]

This specifies a filter for UDP/IPv4 packets, and the masks are wrong.
If you actually wanted to filter only UDP/IPv4 packets for VID 0-31 then
the correct syntax would be:

    ethtool -U eth5 flow-type udp4 vlan 0 vlan-mask 0xf01f

If you don't care about the layer 3/4 protocols then you would need to
use 'flow-type ether', but no driver implements that yet.  (Well, sfc
implements the *type*, but not filtering by VID only.)

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
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] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26  2:57 ` Ben Hutchings
@ 2011-04-26  3:39   ` zhou rui
  2011-04-26  3:51     ` Ben Hutchings
  0 siblings, 1 reply; 8+ messages in thread
From: zhou rui @ 2011-04-26  3:39 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev

On Tue, Apr 26, 2011 at 10:57 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> On Tue, 2011-04-26 at 10:19 +0800, zhou rui wrote:
>> hi
>> here is the problem troubles me,how to set vlan filter for intel
>> 82599? for example
>> I want vlan id 0~31 will go to queue 0, vlan id 32-63 will go to queue
>> 1...below is my setting,but doesn't work
>>
>> don't know the exact meanning of the vlan-mask and vlan,how are they calculated?
>>
>> ./ethtool -K eth5 ntuple on
>>
>> ./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
>> dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
>> dst-port-mask 0x0 vlan 0x0000 vlan-mask 0x00E0 user-def 0x0
>> user-def-mask 0x0 action 0
> [...]
>
> This specifies a filter for UDP/IPv4 packets, and the masks are wrong.
> If you actually wanted to filter only UDP/IPv4 packets for VID 0-31 then
> the correct syntax would be:
>
>    ethtool -U eth5 flow-type udp4 vlan 0 vlan-mask 0xf01f
>
> If you don't care about the layer 3/4 protocols then you would need to
> use 'flow-type ether', but no driver implements that yet.  (Well, sfc
> implements the *type*, but not filtering by VID only.)
>
> Ben.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
>

hi ben,thanks for your help,would you mind tell me "32~63" VID filter?
still can not understand the vlan-mask

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26  3:39   ` zhou rui
@ 2011-04-26  3:51     ` Ben Hutchings
  2011-04-26  4:39       ` zhou rui
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2011-04-26  3:51 UTC (permalink / raw)
  To: zhou rui; +Cc: netdev

On Tue, 2011-04-26 at 11:39 +0800, zhou rui wrote:
> On Tue, Apr 26, 2011 at 10:57 AM, Ben Hutchings
> <bhutchings@solarflare.com> wrote:
> > On Tue, 2011-04-26 at 10:19 +0800, zhou rui wrote:
> >> hi
> >> here is the problem troubles me,how to set vlan filter for intel
> >> 82599? for example
> >> I want vlan id 0~31 will go to queue 0, vlan id 32-63 will go to queue
> >> 1...below is my setting,but doesn't work
> >>
> >> don't know the exact meanning of the vlan-mask and vlan,how are they calculated?
> >>
> >> ./ethtool -K eth5 ntuple on
> >>
> >> ./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
> >> dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
> >> dst-port-mask 0x0 vlan 0x0000 vlan-mask 0x00E0 user-def 0x0
> >> user-def-mask 0x0 action 0
> > [...]
> >
> > This specifies a filter for UDP/IPv4 packets, and the masks are wrong.
> > If you actually wanted to filter only UDP/IPv4 packets for VID 0-31 then
> > the correct syntax would be:
> >
> >    ethtool -U eth5 flow-type udp4 vlan 0 vlan-mask 0xf01f
> >
> > If you don't care about the layer 3/4 protocols then you would need to
> > use 'flow-type ether', but no driver implements that yet.  (Well, sfc
> > implements the *type*, but not filtering by VID only.)
[...]
> hi ben,thanks for your help,would you mind tell me "32~63" VID filter?
> still can not understand the vlan-mask

The vlan-mask specifies tag bits to be ignored.  You want to ignore the
priority, CFI and lower 5 bits of the VID, hence 0xf01f.  For a
different group of 32 VIDs you would only change the vlan argument, not
the vlan-mask argument.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
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] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26  3:51     ` Ben Hutchings
@ 2011-04-26  4:39       ` zhou rui
  2011-04-26 13:31         ` Ben Hutchings
  0 siblings, 1 reply; 8+ messages in thread
From: zhou rui @ 2011-04-26  4:39 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev

On Tue, Apr 26, 2011 at 11:51 AM, Ben Hutchings
<bhutchings@solarflare.com> wrote:
> On Tue, 2011-04-26 at 11:39 +0800, zhou rui wrote:
>> On Tue, Apr 26, 2011 at 10:57 AM, Ben Hutchings
>> <bhutchings@solarflare.com> wrote:
>> > On Tue, 2011-04-26 at 10:19 +0800, zhou rui wrote:
>> >> hi
>> >> here is the problem troubles me,how to set vlan filter for intel
>> >> 82599? for example
>> >> I want vlan id 0~31 will go to queue 0, vlan id 32-63 will go to queue
>> >> 1...below is my setting,but doesn't work
>> >>
>> >> don't know the exact meanning of the vlan-mask and vlan,how are they calculated?
>> >>
>> >> ./ethtool -K eth5 ntuple on
>> >>
>> >> ./ethtool -U eth5 flow-type udp4 src-ip 0x0 src-ip-mask 0x0 dst-ip 0x0
>> >> dst-ip-mask 0x0 src-port 0x0 src-port-mask 0x0 dst-port 0x0
>> >> dst-port-mask 0x0 vlan 0x0000 vlan-mask 0x00E0 user-def 0x0
>> >> user-def-mask 0x0 action 0
>> > [...]
>> >
>> > This specifies a filter for UDP/IPv4 packets, and the masks are wrong.
>> > If you actually wanted to filter only UDP/IPv4 packets for VID 0-31 then
>> > the correct syntax would be:
>> >
>> >    ethtool -U eth5 flow-type udp4 vlan 0 vlan-mask 0xf01f
>> >
>> > If you don't care about the layer 3/4 protocols then you would need to
>> > use 'flow-type ether', but no driver implements that yet.  (Well, sfc
>> > implements the *type*, but not filtering by VID only.)
> [...]
>> hi ben,thanks for your help,would you mind tell me "32~63" VID filter?
>> still can not understand the vlan-mask
>
> The vlan-mask specifies tag bits to be ignored.  You want to ignore the
> priority, CFI and lower 5 bits of the VID, hence 0xf01f.  For a
> different group of 32 VIDs you would only change the vlan argument, not
> the vlan-mask argument.
>
> Ben.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
>
i set the filter like below:

for a vlanid=50, it always match the last rule (action 7)

./ethtool -K eth5 ntuple off
./ethtool -K eth5 ntuple on
./ethtool -U eth5 flow-type tcp4 vlan 32 vlan-mask 0xF01F action 1
./ethtool -U eth5 flow-type udp4 vlan 32 vlan-mask 0xF01F action 1
./ethtool -U eth5 flow-type udp4 vlan 64 vlan-mask 0xF01F action 7
./ethtool -U eth5 flow-type tcp4 vlan 64 vlan-mask 0xF01F action 7

I tried the latest ixgbe driver 3.3.9, it reports:

Cannot add new RX n-tuple filter: Operation not permitted

./ethtool -V
ethtool version 2.6.36

thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26  4:39       ` zhou rui
@ 2011-04-26 13:31         ` Ben Hutchings
  2011-04-26 15:22           ` Alexander Duyck
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Hutchings @ 2011-04-26 13:31 UTC (permalink / raw)
  To: zhou rui; +Cc: netdev, e1000-devel

On Tue, 2011-04-26 at 12:39 +0800, zhou rui wrote:
[...]
> i set the filter like below:
> 
> for a vlanid=50, it always match the last rule (action 7)
> 
> ./ethtool -K eth5 ntuple off
> ./ethtool -K eth5 ntuple on
> ./ethtool -U eth5 flow-type tcp4 vlan 32 vlan-mask 0xF01F action 1
> ./ethtool -U eth5 flow-type udp4 vlan 32 vlan-mask 0xF01F action 1
> ./ethtool -U eth5 flow-type udp4 vlan 64 vlan-mask 0xF01F action 7
> ./ethtool -U eth5 flow-type tcp4 vlan 64 vlan-mask 0xF01F action 7
> 
> I tried the latest ixgbe driver 3.3.9, it reports:
> 
> Cannot add new RX n-tuple filter: Operation not permitted
> 
> ./ethtool -V
> ethtool version 2.6.36

Check dmesg; there should be an error message there.  Of course the
error code should be EINVAL and not EPERM.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
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] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26 13:31         ` Ben Hutchings
@ 2011-04-26 15:22           ` Alexander Duyck
  2011-04-26 15:30             ` zhou rui
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Duyck @ 2011-04-26 15:22 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: zhou rui, netdev@vger.kernel.org,
	e1000-devel@lists.sourceforge.net

On 4/26/2011 6:31 AM, Ben Hutchings wrote:
> On Tue, 2011-04-26 at 12:39 +0800, zhou rui wrote:
> [...]
>> i set the filter like below:
>>
>> for a vlanid=50, it always match the last rule (action 7)
>>
>> ./ethtool -K eth5 ntuple off
>> ./ethtool -K eth5 ntuple on
>> ./ethtool -U eth5 flow-type tcp4 vlan 32 vlan-mask 0xF01F action 1
>> ./ethtool -U eth5 flow-type udp4 vlan 32 vlan-mask 0xF01F action 1
>> ./ethtool -U eth5 flow-type udp4 vlan 64 vlan-mask 0xF01F action 7
>> ./ethtool -U eth5 flow-type tcp4 vlan 64 vlan-mask 0xF01F action 7
>>
>> I tried the latest ixgbe driver 3.3.9, it reports:
>>
>> Cannot add new RX n-tuple filter: Operation not permitted
>>
>> ./ethtool -V
>> ethtool version 2.6.36
>
> Check dmesg; there should be an error message there.  Of course the
> error code should be EINVAL and not EPERM.
>
> Ben.
>

The problem is likely the vlan-mask.  The only valid VLAN masks 
supported are 0xFFFF, 0x0FFF, 0xF000, and 0x0000.  The hardware cannot 
partially mask either the priority nor the VLAN TCI.

Thanks,

Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to set vlan filter for intel 82599
  2011-04-26 15:22           ` Alexander Duyck
@ 2011-04-26 15:30             ` zhou rui
  0 siblings, 0 replies; 8+ messages in thread
From: zhou rui @ 2011-04-26 15:30 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Ben Hutchings, netdev@vger.kernel.org,
	e1000-devel@lists.sourceforge.net

On Tuesday, April 26, 2011, Alexander Duyck <alexander.h.duyck@intel.com> wrote:
> On 4/26/2011 6:31 AM, Ben Hutchings wrote:
>
> On Tue, 2011-04-26 at 12:39 +0800, zhou rui wrote:
> [...]
>
> i set the filter like below:
>
> for a vlanid=50, it always match the last rule (action 7)
>
> ./ethtool -K eth5 ntuple off
> ./ethtool -K eth5 ntuple on
> ./ethtool -U eth5 flow-type tcp4 vlan 32 vlan-mask 0xF01F action 1
> ./ethtool -U eth5 flow-type udp4 vlan 32 vlan-mask 0xF01F action 1
> ./ethtool -U eth5 flow-type udp4 vlan 64 vlan-mask 0xF01F action 7
> ./ethtool -U eth5 flow-type tcp4 vlan 64 vlan-mask 0xF01F action 7
>
> I tried the latest ixgbe driver 3.3.9, it reports:
>
> Cannot add new RX n-tuple filter: Operation not permitted
>
> ./ethtool -V
> ethtool version 2.6.36
>
>
> Check dmesg; there should be an error message there.  Of course the
> error code should be EINVAL and not EPERM.
>
> Ben.
>
>
>
> The problem is likely the vlan-mask.  The only valid VLAN masks supported are 0xFFFF, 0x0FFF, 0xF000, and 0x0000.  The hardware cannot partially mask either the priority nor the VLAN TCI.
>
> Thanks,
>
> Alex
>
Yes i just checked the log, it said partially vlan Id not support,
that means I can't set this filter?(vlan id 0-31 go to
Q0,32-63->Q1....?)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-26 15:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26  2:19 how to set vlan filter for intel 82599 zhou rui
2011-04-26  2:57 ` Ben Hutchings
2011-04-26  3:39   ` zhou rui
2011-04-26  3:51     ` Ben Hutchings
2011-04-26  4:39       ` zhou rui
2011-04-26 13:31         ` Ben Hutchings
2011-04-26 15:22           ` Alexander Duyck
2011-04-26 15:30             ` zhou rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).