Ethernet Products
Determine ramifications of Intel® Ethernet products and technologies
4865 Discussions

how to filter packet by VLAN priority(X520-SR)

idata
Employee
3,047 Views

Now I am using intel X520 10G nic, the driver is ixgbe.

how to filter packet by VLAN priority? i.e, I just want those packets which VLAN priority are 1.

as I known vconfig is used to tag VLAN priority Not filter by VLAN priority.

X520 support the flowdirector(perfect filter), but I can't find anything about the VLAN priority filter setting,

looks its filter set are ip src/dst,port,vlan id,etc

0 Kudos
8 Replies
idata
Employee
846 Views

today I tried PF_RING(3rd party tool) to set perfect filter

but failed also.

any one can tell me how to use ethtool to set perfect filter?

0 Kudos
Mark_H_Intel
Employee
846 Views

I asked our software engineers about your question, and this is what I learned.

You cannot filter by just VLAN or VLAN priority. The L4 type will also play a role in the filter and as such you would only be able to filter TCP, UDP, and SCTP packets that are bound for a VLAN.

The command itself to setup a filter is "ethtool –U ethX flow-type tcp4 vlan 0x2000 vlan-mask 0xE000 action Y" where X is the correct index for the interface and Y is the queue you want to route the traffic to. This would have to be repeated for udp4 and sctp4.

I hope this will help.

Mark H

0 Kudos
idata
Employee
846 Views

I got this msg:

ethtool -U eth4 flow-type tcp4 vlan 0x2000 vlan-mask 0xE000 action 1

 

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

uname -a

 

Linux linaspl50 2.6.32.12-0.7-default # 1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux

is the kernel or the HW(X520) that doesn't support the operation?

thanks

0 Kudos
Mark_H_Intel
Employee
846 Views

The current driver and the hardware both support flow director. Which ixgbe driver version are you using?

What happens if you try this command?

ethtool -K eth4 ntuple on (assuming eth4 is your X520 adapter.)

0 Kudos
idata
Employee
846 Views

after kernel updated to 2.6.34, the filter works

one more question

does "flow-type" support "ANY" protocol?

otherwise I need to add tcp4 and udp respectively?

0 Kudos
Mark_H_Intel
Employee
846 Views

FThe flow-type parameter does not support ANY. The flow-type parameter only supports tcp4, udp4, and sctp4 on ixgbe. If you want to setup a rule it must be specified for each protocol individually. Therefore, you will have to setup separate rules for tcp4 and udp4.

0 Kudos
idata
Employee
846 Views

hi Mark

thanks for your help

I heard from an intel engineer that the filter (or the perfect filter / flow director) only support a set of tcp/ip field as filter keyword

that means I cann't write a filter to handle packets with this rule: if (packet[55}&packet[40]&0x07=1) action.....

is that true?

is the HW or the driver(ixgbe) does not support it?

thanks again

0 Kudos
Mark_H_Intel
Employee
846 Views

I have seen posts where Alex Duyck has been answering the same questions. I am assuming those posts are from you since the examples are the same.

Alex is the ultimate authority on the subject on the software implementation of flow director and perfect filters. He is the same person I go to for the answers I have posted on that subject, and I completely trust that those answers are true.

Have a great day!

Mark H

0 Kudos
Reply