From: "Ethy H. Brito" Date: Sat, 17 Dec 2005 20:51:10 +0000 Subject: Fw: [LARTC] tc filter match u8 problem?? Message-Id: <20051217185110.13018bec@babalu.inexo.com.br> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Multipart_Sat__17_Dec_2005_18_51_10_-0200_i.rTicfYIUaZ90rE" List-Id: References: <20051216170041.2738f5b5@pulsar.inexo.com.br> In-Reply-To: <20051216170041.2738f5b5@pulsar.inexo.com.br> To: lartc@vger.kernel.org --Multipart_Sat__17_Dec_2005_18_51_10_-0200_i.rTicfYIUaZ90rE Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sat, 17 Dec 2005, Andy Furniss wrote: > The u8 test works OK for me as does the one below. My mistake. I cleaned the rules and removed the ones that collided with the u8 one. There is no error on this. (see explanation bellow). > > When playing with tc filters I always tc qdisc del dev eth0 root and enter > the whole lot again between tests. I always took that as mandatory. Don't worry. 'tc qdisc del dev XXX root' is always on my scripts. > I don't know why the mark match doesn't work for you - it has its own kernel > config option and IIRC was added by patch and may be removed at some time in > favour of ematch (IIRC). (What IIRC stands for?? I missed this one.) Here is the explanation for u8 behavior. Together with 'match u8 8 0xff at 20' I also had 'match ip dport 1234 0xffff' and 'match ip sport 80 0xffff' (these both i striped out in my original post). Since the last two colide with the 'u8 ... at 20', tc complained (I don't know the mechanism use by tc but the fact is tc knows they collide). >> # $TC filter add dev eth0 protocol ip parent 1:0 prio 2 \ u32 \ >> match ip src 200.231.49.240/29 \ >> match ip dst 200.231.48.94/32 \ match mark 0xa5a5 0xffff \ >> match u16 0x0800 0xffff at -2 \ > > This is redundant as you already say "protocol ip" Thanks. I'll take it out from the generator. >> What is this "005004d2/ffffffff at 20"? (I asked "match u16 0 0xff00 at >> 20") > > 0050 sport 80 - 04d2 dport 1234 - you got 0 at 20 mask 0xff it's the MSB of > sport ... Holly Cow!!! You're 1000% right. >> Where is the "match mark" clause? But this one is still a mistery. where did "match mark" go? Look: # ./rc.htb2 + /usr/local/src/iproute2-2.6.14-051107/tc/tc filter add dev eth0 \ protocol ip \ parent 1:0 \ prio 2 \ u32 match mark 0xa5a5 0xffff \ flowid 1:5 + /usr/local/src/iproute2-2.6.14-051107/tc/tc filter ls dev eth0 filter parent 1: protocol ip pref 2 u32 filter parent 1: protocol ip pref 2 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:5 + /usr/local/src/iproute2-2.6.14-051107/tc/tc qdisc del dev eth0 root + set +x There is no 'match mark' on output. Could anyone see if this is correct (match mark does not showing on 'tc filter ls' command)? Regards Ethy --Multipart_Sat__17_Dec_2005_18_51_10_-0200_i.rTicfYIUaZ90rE Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Return-Path: X-Original-To: lartc@mailman.ds9a.nl Delivered-To: lartc@outpost.ds9a.nl Received: from inexo.com.br (newquantum.inexo.com.br [200.231.48.36]) by outpost.ds9a.nl (Postfix) with SMTP id 3C757402E for ; Sat, 17 Dec 2005 16:31:57 +0100 (CET) Received: (qmail 18150 invoked from network); 17 Dec 2005 15:31:57 -0000 Received: from node1.inexo.com.br (HELO ?192.168.8.18?) (200.231.49.241) by newquantum.inexo.com.br with SMTP; 17 Dec 2005 15:31:57 -0000 Date: Sat, 17 Dec 2005 13:30:13 -0200 (BRST) From: "Ethy H. Brito" To: lartc@mailman.ds9a.nl Subject: Re: [LARTC] tc filter match u8 problem?? In-Reply-To: <43A40803.8090108@dsl.pipex.com> Message-ID: References: <20051216170041.2738f5b5@pulsar.inexo.com.br> <20051216200857.04a04917@pulsar.inexo.com.br> <43A40803.8090108@dsl.pipex.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sat, 17 Dec 2005, Andy Furniss wrote: > The u8 test works OK for me as does the one below. My mistake. I cleaned the rules and removed the ones that collided with the u8 one. There is no error on this. (see explanation bellow). > > When playing with tc filters I always tc qdisc del dev eth0 root and enter > the whole lot again between tests. I always took that as mandatory. Don't worry. 'tc qdisc del dev XXX root' is always on my scripts. > I don't know why the mark match doesn't work for you - it has its own kernel > config option and IIRC was added by patch and may be removed at some time in > favour of ematch (IIRC). (What IIRC stands for?? I missed this one.) Here is the explanation for u8 behavior. Together with 'match u8 8 0xff at 20' I also had 'match ip dport 1234 0xffff' and 'match ip sport 80 0xffff' (these both i striped out in my original post). Since the last two colide with the 'u8 ... at 20', tc complained (I don't know the mechanism use by tc but the fact is tc knows they collide). >> # $TC filter add dev eth0 protocol ip parent 1:0 prio 2 \ u32 \ >> match ip src 200.231.49.240/29 \ >> match ip dst 200.231.48.94/32 \ match mark 0xa5a5 0xffff \ >> match u16 0x0800 0xffff at -2 \ > > This is redundant as you already say "protocol ip" Thanks. I'll take it out from the generator. >> What is this "005004d2/ffffffff at 20"? (I asked "match u16 0 0xff00 at >> 20") > > 0050 sport 80 - 04d2 dport 1234 - you got 0 at 20 mask 0xff it's the MSB of > sport ... Holly Cow!!! You're 1000% right. >> Where is the "match mark" clause? But this one is still a mistery. where did "match mark" go? Look: # ./rc.htb2 + /usr/local/src/iproute2-2.6.14-051107/tc/tc filter add dev eth0 \ protocol ip \ parent 1:0 \ prio 2 \ u32 match mark 0xa5a5 0xffff \ flowid 1:5 + /usr/local/src/iproute2-2.6.14-051107/tc/tc filter ls dev eth0 filter parent 1: protocol ip pref 2 u32 filter parent 1: protocol ip pref 2 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 2 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:5 + /usr/local/src/iproute2-2.6.14-051107/tc/tc qdisc del dev eth0 root + set +x There is no 'match mark' on output. Could anyone see if this is correct (match mark does not showing on 'tc filter ls' command)? Regards Ethy --Multipart_Sat__17_Dec_2005_18_51_10_-0200_i.rTicfYIUaZ90rE Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --Multipart_Sat__17_Dec_2005_18_51_10_-0200_i.rTicfYIUaZ90rE--