Skip to contentSkip to conversation

tc filter add command successful but filter not added in chain

DISCUSSION [email protected] 1 participant 2 messages Sep 3, 2015 – Sep 7, 2015

lore
Share & tools
lore
#0 lore raw

I would like to use sfq in a htb class with a custom hashing (flow hash or flow map).

SFQ with custom hasing works,

1. tc qdisc add dev eth0 root sfq perturb 10

2. tc add filter dev eth0 handle 1 flow hash keys src perturb 10 divisor 1024
or
2. tc add filter dev eth0 handle 1 flow map key src and 0x000000ff

When I add the sfq qdisc to an htb class and try to do 2. I get no error from tc (and the kernel)

but the filter does not get added. There is no filter in tc -s filter show dev eth0 .

The commands:

tc qdisc add dev eth0 root handle 9001: htb default 20
tc class add dev eth0 parent 9001: classid 9001:1 htb rate 4mbit burst 15k tc class add dev eth0 parent 9001:1 classid 9001:10 htb rate 3mbit tc class add dev eth0 parent 9001:1 classid 9001:20 htb rate 1mbit tc qdisc add dev eth0 parent 9001:10 sfq perturb 10

tc filter add dev eth0 parent 9002: handle 1 flow map key src and 0x000000ff (where 9002: is the class of the sfq qdisc)

I also tried with a basic filter (tc filter add .. parent 9002: basic ...) and same result.

I added printk in cls_api.c, cls_flow.c, sch_api.c to see what was going on. Linux kernel version

3.13.0 (this is the version installed in the embedded system I am working on).

No errors are generated. The class op ->change() returns with err = 0.

Anyone ?

P.S. adding "handle 1" in tc filter add ... flow ... is something that is not well documented.

If tc filter add ... flow ... is run with handle 1 it returns with error but does not says anything.

Thanks

Andrea

#1 lore raw

works.

specifying "parent 9002:" in "tc filter show dev eth0"

shows the filter.

thanks Lee :)

On Thu, Sep 03, 2015 at 08:51:16AM -0700, Lee Brown wrote (verbatim):

Quoted 77 lines

I tried replying to the list but it bounced, so simply:

try adding root to the end of the command line, so something like:

tc filter show dev eth0 root

Depending on the type of device (NIC, VLAN, IFB, etc.) it appears to use a different root handle (my vlan requires ffff: as root handle, while my IFB's require 0)

Hope that helps -- lee

Quoted 63 lines · On Thu, Sep 3, 2015 at 6:46 AM, <[email protected]> wrote:

I would like to use sfq in a htb class with a custom hashing (flow hash or flow map).

SFQ with custom hasing works,

1. tc qdisc add dev eth0 root sfq perturb 10

2. tc add filter dev eth0 handle 1 flow hash keys src perturb 10
divisor 1024
or
2. tc add filter dev eth0 handle 1 flow map key src and 0x000000ff

When I add the sfq qdisc to an htb class and try to do 2. I get no error from tc (and the kernel)

but the filter does not get added. There is no filter in tc -s filter show dev eth0 .

The commands:

tc qdisc add dev eth0 root handle 9001: htb default 20 tc class add dev eth0 parent 9001: classid 9001:1 htb rate 4mbit
burst 15k
tc class add dev eth0 parent 9001:1 classid 9001:10 htb rate 3mbit tc class add dev eth0 parent 9001:1 classid 9001:20 htb rate 1mbit tc qdisc add dev eth0 parent 9001:10 sfq perturb 10

tc filter add dev eth0 parent 9002: handle 1 flow map key src and
0x000000ff
(where 9002: is the class of the sfq qdisc)

I also tried with a basic filter (tc filter add .. parent 9002: basic ...) and same result.

I added printk in cls_api.c, cls_flow.c, sch_api.c to see what was going on. Linux kernel version

3.13.0 (this is the version installed in the embedded system I am working on).

No errors are generated. The class op ->change() returns with err = 0.

Anyone ?

P.S. adding "handle 1" in tc filter add ... flow ... is something that is not well documented.

If tc filter add ... flow ... is run with handle 1 it returns with error but does not says anything.

Thanks

Andrea
--
To unsubscribe from this list: send the line "unsubscribe lartc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html