From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Hennerbichler Date: Wed, 03 Jul 2013 12:46:29 +0000 Subject: Re: question on fwmark speed boost Message-Id: <51D41D25.3080402@risc-software.at> List-Id: References: <51D41B65.8020006@wogri.com> In-Reply-To: <51D41B65.8020006@wogri.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Follow-Up: This is the only pice of information I have found on my problem: http://marc.info/?l=lartc&m5421129231583&w=2 => You can reduce the number of fw filters rules if you use the mark as hash key. So if you add tc filter add dev eth0 parent 1:0 protocol ip handle 1 fw and you have a packet with mark 39, it will placed in class 1:39. Wolfgang On 07/03/2013 02:39 PM, Wolfgang Hennerbichler wrote: > Hi, > > following tc config: > > tc qdisc add dev wan0 root handle 1: htb default 12 > tc class add dev wan0 parent 1:0 classid 1:12 htb rate 9500mbit ceil > 9500mbit > tc class add dev wan0 parent 1:0 classid 1:2001 htb rate 9500mbit ceil > 9500mbit > tc class add dev wan0 parent 1:0 classid 1:2002 htb rate 100kbit ceil > 100kbit > > # add filter - all marked packets should be classified automatically > according to the fwmark - as far as I've read online > > tc filter add dev wan0 parent 1:0 protocol ip fw > > iptables -A POSTROUTING -t mangle -j CONNMARK --restore-mark > iptables -A POSTROUTING -t mangle -m mark ! --mark 0 -j ACCEPT > iptables -A POSTROUTING -m physdev --physdev-out wan0 -p udp -s 1.2.3.4 > -t mangle -j MARK --set-mark 2001 > iptables -A POSTROUTING -m physdev --physdev-out wan0 -p tcp -s 1.2.3.4 > -t mangle -j MARK --set-mark 2002 > iptables -A POSTROUTING -t mangle -j CONNMARK --save-mark > > > my filter does not work as intended. I thought it would automatically > use the marks, and put the traffic into the right classes. It doesn't > seem to work. I have troubles finding documentation on this, so maybe > anybody can shed some light on this. > > Wolfgang > -- DI (FH) Wolfgang Hennerbichler Software Development Unit Advanced Computing Technologies RISC Software GmbH A company of the Johannes Kepler University Linz IT-Center Softwarepark 35 4232 Hagenberg Austria Phone: +43 7236 3343 245 Fax: +43 7236 3343 250 wolfgang.hennerbichler@risc-software.at http://www.risc-software.at