Since handle xxxx:0000 represents QDISC, so in the handle 1:76, the QDISC ID is 1:0, that's the reason. Yongle -----Original Message----- From: lartc-bounces@xxxxxxxxxxxxxxx [mailto:lartc-bounces@xxxxxxxxxxxxxxx] On Behalf Of lartc-request@xxxxxxxxxxxxxxx Sent: 2006年9月16日 18:00 To: lartc@xxxxxxxxxxxxxxx Subject: LARTC Digest, Vol 19, Issue 19 Send LARTC mailing list submissions to lartc@xxxxxxxxxxxxxxx To subscribe or unsubscribe via the World Wide Web, visit http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc or, via email, send a message with subject or body 'help' to lartc-request@xxxxxxxxxxxxxxx You can reach the person managing the list at lartc-owner@xxxxxxxxxxxxxxx When replying, please edit your Subject line so it is more specific than "Re: Contents of LARTC digest..." Today's Topics: 1. Re: tc is giving an error: RTNETLINK answers: File exists (fourcentsshy) 2. Re: Re: htb traffic shaping problem (Bugzilla-Redirect) ---------------------------------------------------------------------- Message: 1 Date: Fri, 15 Sep 2006 12:47:53 -0700 From: fourcentsshy <fourcentsshy@xxxxxxxxxxxx> Subject: Re: tc is giving an error: RTNETLINK answers: File exists To: gypsy <gypsy@xxxxxxxxxx>, lartc <lartc@xxxxxxxxxxxxxxx> Message-ID: <1158349674.7896.34.camel@xxxxxxxxxxxxxxxxxx> Content-Type: text/plain On Thu, 2006-09-14 at 21:36 -0700, gypsy wrote: > fourcentsshy wrote: > > > > Hello, > > > > I'm using tc to limit the bandwidth of our wireless customers. I > > have a working script, but I'm not happy with it. I'm trying to > > write a more sophisticated script, but when I run it, it give me this error: > > > > RTNETLINK answers: File exists > > > > I have no idea what this error means or how to fix it. > > It means pretty much what it says. There is already a record matching > closely enough that it is duplicated. > That is what puzzles me the most. If you look at the script, I create the root qdisc, add a class to it and when I try to add a qdisc to that class on the first iteration in the loop, I get the error right off. The script also deletes all qdiscs, classes and filters before it creates any new ones. On the first iteration of the loop, the handle is 1:76 with it's parent 1:1, which should be unique, since it's only the second qdisc created. As Leigh Sharpe suggested, I had already inserted echo statements into the script so I could examine what was really going on. For this device, the error takes place on the third command. the command sequence take place like this: /sbin/tc qdisc add dev eth5 root handle 1: cbq bandwidth 1600Kbit\ cell 8 avpkt 1000 mpu 64 /sbin/tc class add dev eth5 parent 1: classid 1:1 est 1sec 8sec cbq\ bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\ prio 0 bounded isolated /sbin/tc qdisc add dev eth5 parent 1:1 handle 1:76 cbq\ bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64 RTNETLINK answers: File exists Like I said, I start by resetting all the devices on the machine, so there is no possible way there can be any existing qdisc with a handle of 1:76 for that device, yet I get the error anyway. The script is setup as a service to be run at startup, so checking the status after running the script for that device, I get this: [qdisc - eth5] qdisc cbq 1: rate 1600Kbit (bounded,isolated) prio no-transmit Sent 139719 bytes 181 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 5120 undertime 0 ------------------------ [class - eth5] class cbq 1:11 parent 1:1 leaf 8236: rate 700000bit prio 2 Sent 13814 bytes 42 pkt (dropped 0, overlimits 0 requeues 0) rate 11792bit 4pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 306884 undertime 0 class cbq 1: root rate 100000Kbit (bounded,isolated) prio no-transmit Sent 60 bytes 1 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 81 undertime 0 class cbq 1:10 parent 1:1 leaf 8235: rate 750000bit prio 1 Sent 6712 bytes 48 pkt (dropped 0, overlimits 0 requeues 0) rate 2008bit 2pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 148506 undertime 0 class cbq 1:1 parent 1: rate 800000bit (bounded,isolated) prio no-transmit Sent 20526 bytes 90 pkt (dropped 0, overlimits 0 requeues 0) rate 13800bit 7pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 57889 undertime 0 class cbq 1:12 parent 1:1 leaf 8237: rate 700000bit prio 3 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) rate 0bit 0pps backlog 0b 0p requeues 0 borrowed 0 overactions 0 avgidle 329838 undertime 0 Maybe I'm blind, but I don't see any qdisc or class with a handle of 1:76. Something else is wrong, but I don't see it. > > Here is a portion > > of the script (the whole script shapes several interfaces): > > > > IDEV='eth5' > > TC='/sbin/tc' > > IPS='/etc/sysconfig/shaper/shape.ips' > > # high priority destination ports - I'll fill these in later (when > > this # thing works) HIGHPORT= # low priority destination ports > > LOWPORT= > > > > $TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell > > 8\ avpkt 1000 mpu 64 $TC class add dev $IDEV parent 1: classid 1:1 > > est 1sec 8sec cbq\ bandwidth 1600Kbit rate 1500kbit allot 1514 > > maxburst 20 avpkt 1000\ prio 0 bounded isolated > > > > cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do > > if [ "x$IP" == "x" ]; then > > continue > > fi > > > > # I use the last byte of the customer's IP's for the handle, which > > range # from 76 to 135 ATM. > > > > HANDLE="${IP##*.}" > > > > # I get the error from the next line. Because it fails to create the > > # qdisc all the rest fail too. > > > > $TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\ > > bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64 > > > > $TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\ est > > 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\ > > maxburst 20 avpkt 1000 prio 1 bounded isolated > > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\ est > > 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\ > > maxburst 20 avpkt 1000 prio 2 > > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est > > 1sec\ 8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot > > 1514\ maxburst 20 avpkt 1000 prio 3 > > $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est > > 1sec\ 8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot > > 1514\ maxburst 20 avpkt 1000 prio 4 > > $TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\ > > perturb 15 > > $TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\ > > perturb 15 > > $TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\ > > perturb 15 > > $TC filter add dev $IDEV parent 1: protocol ip prio 16\ > > u32 match ip src $IP flowid $HANDLE: > > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\ > > u32 match ip tos 0x10 0xff flowid $HANDLE:1 > > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\ > > u32 match ip protocol 1 0xff flowid $HANDLE:1 > > $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\ > > u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\ > > 0x0000 0xffc0 at 2 flowid $HANDLE:1 > > > > for a in $HIGHPORT; do > > $TC filter add dev $IDEV parent 1:0 protocol ip prio 14\ > > u32 match ip dport $a 0xffff flowid $HANDLE:1 > > done > > for a in $LOWPORT; do > > $TC filter add dev $IDEV parent 1:0 protocol ip prio 16\ > > u32 match ip dport $a 0xffff flowid $HANDLE:3 > > done > > $TC filter add dev $IDEV parent 1:0 protocol ip prio 15\ > > u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2 done > > > > There are bound to other problems with this script, but until I can > > get past the current one, I'm dead in the water. TIA > > You do not say which line or lines is causing the error so this is a > guess. I inserted a comment in the script that points out which command causes the error. It's the first command inside the loop. > > Run `tc -s filter show dev $IDEV' sending the output to a file because > there will be a lot of it. I think you will find a ton of "duplicate" > filters. I inserted an exit statement right after the command that give the error. The script never gets to the statements that creates the filters. Checking the status of the service would display the filters along with the qdiscs and classes, but there are none. > > Set prio to the same value (16 or 10 perhaps) for each and every line > in your `$TC filter' lines. If I ever get this script working, I'll do that. ;-) ------------------------------ Message: 2 Date: Fri, 15 Sep 2006 19:38:36 -0600 From: Bugzilla-Redirect <bugzilla@xxxxxxxxxxxx> Subject: Re: Re: htb traffic shaping problem To: lartc@xxxxxxxxxxxxxxx Message-ID: <6.2.0.14.2.20060915193530.02eaf330@xxxxxxxxxxxxxxxxxx> Content-Type: text/plain; charset="iso-8859-1"; format=flowed Yes, the output is below: eth0 Link encap:Ethernet HWaddr 00:11:09:2A:A6:F6 inet addr:10.0.0.50 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4244867 errors:0 dropped:0 overruns:0 frame:0 TX packets:1306632 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3898905509 (3.6 GiB) TX bytes:1756030081 (1.6 GiB) Interrupt:19 And from ethtool: Settings for eth0: Supported ports: [ MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: g Wake-on: d Link detected: yes Thanks. -Ryan Power At 04:32 PM 9/14/2006, you wrote: >Hi, > >could you check the mtu set on eth0 with an ifconfig? >I tried my own setup and it works fine... > > >Regards, > >Eric Janz >Departamento de Sistemas >Grupo Barceló Viajes ------------------------------ _______________________________________________ LARTC mailing list LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc End of LARTC Digest, Vol 19, Issue 19 ************************************* _______________________________________________ LARTC mailing list LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc