From mboxrd@z Thu Jan 1 00:00:00 1970 From: fanfei Date: Tue, 19 Mar 2013 08:18:34 +0000 Subject: ingress police effect egress bandwidth Message-Id: <51481F59.1040703@datatom.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi My Os is Red Hat 6.2 server kernel 2.6.32 I set an ingress filter for a 1Gb ethernet interface, script: DEV=eth1 IP=xx.xx.xx.xx RATEPmbps BURST=5m MTU=1mb tc qdisc del dev $DEV ingress tc qdisc add dev $DEV handle ffff: ingress tc filter add dev $DEV parent ffff: \ protocol ip prio 20 \ u32 match ip src $IP/32 \ police rate $RATE burst $BURST mtu $MTU \ drop flowid :1 I'm not getting a 50mbps band, it be 200kbps ~ 18mbps according value I set. After I run the script several times, I find the egress bandwith has been limited to 30mbps. qdisc on eth1: tc -s qdisc show dev eth1 qdisc mq 0: root Sent 13862277239 bytes 2746355 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 qdisc ingress ffff: parent ffff:fff1 ---------------- Sent 1372858005 bytes 176228 pkt (dropped 1539, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 ingress filter: tc -s filter show dev eth1 parent ffff: filter protocol ip pref 20 u32 filter protocol ip pref 20 u32 fh 800: ht divisor 1 filter protocol ip pref 20 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1 (rule hit 174518 success 173742) match c0a8017c/ffffffff at 12 (success 173742 ) police 0x18 rate 400000Kbit burst 5Mb mtu 1Mb action drop overhead 0b ref 1 bind 1 Sent 1372696737 bytes 173742 pkts (dropped 1539, overlimits 1539) restart network, and run the script, the egress bandwith is correct (about 100mbps). After run script 2~3 times, the egress bandwith again limit to less than 30mbps (depends on RATE in ingress filter) who can tell how to avoid this happened, and how to get the value to get the rate I want (50mbps)