tc problem:something wrong when rate-limit OSI-in-IP pkts, kernel 2.6.20
Hello, all:
When development our equipment(big chassis with many slots, optical equipment), we use TC to control traffic between system control card and line cards. And TC works for most kinds of traffic. It's very good.
But when control OSI-in-IP traffic, we meet some problems as following:
On our system control card(SC card), we run Linux(kernel version, 2.6.20), between SC card and line cards, there is ethernet connection(eth1). And on SC card, OSI packets flows into SC card through eth0, there is a user-space daemon to wrap-up OSI packets into IP packets then send to eth1 interface, which connected with a switch-chip will forward OSI-in-IP packets to destination line card. And on eth1 interface, tc configed for OSI-in-IP packets as following:
stream1 rule: OSI-in-IP from SC card to slot-13 at rate 960kbps;
stream2 rule: OSI-in-IP from SC card to slot-19 at rate 960kbps;
960kbps is about 267packets/s for 418bytes length packets.
We begin to test using N2X, when both stream1&stream2 are 150packts/s, packet length=418bytes, tc works well;
Then increase stream2 traffic to 400 packets, then problem happen: not only stream2 lost packets, but also stream1 lost packets too.
and we use "tc -s filter ls dev eth1" to see that traffic-classify works good.
And we use "tc -s class ls dev eth1", find that both streams are lost packets.
So my question is why stream1 lost packets?
Specific tc rules as following:
tc qdisc add dev eth1 root handle 1:0 cbq bandwidth 100Mbit avpkt 200 cell 8
#slot 13 tc class entries
tc class add dev eth1 parent 1:0 classid 1:13 cbq bandwidth 100Mbit rate 2Mbit weight 0.2Mbit prio 8 allot 1514 cell 8 maxbur
st 20 avpkt 200 bounded
tc class add dev eth1 parent 1:13 classid 1:131 cbq bandwidth 100Mbit rate 960Kbit weight 96Kbit prio 6 allot 1514 cell 8 max
burst 20 avpkt 200 bounded
tc class add dev eth1 parent 1:131 classid 1:133 cbq bandwidth 100Mbit rate 960Kbit weight 96Kbit prio 5 allot 1514 cell 8 ma
xburst 20 avpkt 200
#slot 19 tc class entries
tc class add dev eth1 parent 1:0 classid 1:19 cbq bandwidth 100Mbit rate 2Mbit weight 0.2Mbit prio 8 allot 1514 cell 8 maxbur
st 20 avpkt 200 bounded
tc class add dev eth1 parent 1:19 classid 1:191 cbq bandwidth 100Mbit rate 960Kbit weight 96Kbit prio 6 allot 1514 cell 8 max
burst 20 avpkt 200 bounded
tc class add dev eth1 parent 1:191 classid 1:193 cbq bandwidth 100Mbit rate 960Kbit weight 96Kbit prio 5 allot 1514 cell 8 ma
xburst 20 avpkt 200
#config tc filter hash tables
tc filter add dev eth1 parent 1:0 prio 8 protocol ip u32
tc filter add dev eth1 parent 1:0 prio 5 handle 4: protocol ip u32 divisor 64
#slot 13 hashtable entries
tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 4:d: match ip dst 127.3.0.13 match ip protocol 47 0xff flowid 1:133
tc filter add dev eth1 protocol ip parent 1:0 prio 6 u32 ht 2:d: match ip dst 127.3.0.13 flowid 1:13
#slot 19 hashtable entries
tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 4:13: match ip dst 127.3.0.19 match ip protocol 47 0xff flowid 1:193
tc filter add dev eth1 protocol ip parent 1:0 prio 6 u32 ht 2:13: match ip dst 127.3.0.19 flowid 1:19
#config tc filter hash rules
tc filter add dev eth1 protocol ip parent 1:0 prio 5 u32 ht 800:: match ip dst 127.3.0.0/26 hashkey mask 0x0000003f at 16 mat
ch ip protocol 47 0xff link 4:
tc filter add dev eth1 protocol ip parent 1:0 prio 6 u32 ht 800:: match ip dst 127.3.0.0/26 hashkey mask 0x0000003f at 16 lin
k 2:
Thanks
Tian, YuFeng
Last edited by yftian; 03-25-2009 at 02:15 AM.
|