All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] tc del class not working
@ 2006-05-09 18:10 Eliot, Wireless and Server Administrator,  Great Lakes Internet
  2006-05-09 22:17 ` Andreas Mueller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eliot, Wireless and Server Administrator,  Great Lakes Internet @ 2006-05-09 18:10 UTC (permalink / raw)
  To: lartc


When I start my script:

*   - Creating classes on br1 for upload control ...
 *     - tc class add dev br1 parent 2:0 classid 2:46  hfsc ls m1
576.0Kbit d 2000ms m2 192.0Kbit ul m2 384Kbit ...
[ ok ]
 *     - tc class add dev br1 parent 2:46 classid 2:47 hfsc sc umax
1500b dmax 30ms rate 80Kbit .  [ ok ]
 *     - tc class add dev br1 parent 2:46 classid 2:48 hfsc ls m2
152.0Kbit ul m2 152.0Kbit ...    [ ok ]
 *     - tc class add dev br1 parent 2:46 classid 2:49 hfsc rt m2
76.00Kbit ls m2 152.0Kbit ul m2 304Kbit
 ...
[ ok ]
 *   - Creating classes on wivl4 for download control ...
 *     - tc class add dev wivl4 parent 5:0 classid 5:46 hfsc ls m1
1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit ...
[ ok ]
 *     - tc class add dev wivl4 parent 5:46 classid 5:47 hfsc sc umax
1500b dmax 30ms rate 80Kbit  [ ok ]
 *     - tc class add dev wivl4 parent 5:46 classid 5:48 hfsc ls m2
472.0Kbit ul m2 472.0Kbit ...  [ ok ]
 *     - tc class add dev wivl4 parent 5:46 classid 5:49 hfsc rt m2
236.00Kbit ls m2 472.0Kbit ul m2 944Kbit ...
[ ok ]
 *   - Adding rules to classify traffic for 00:05:9e:80:e1:3b ...
 *     - iptables -A macfilter -m mac --mac-source 00:05:9e:80:e1:3b ...
[ ok ]
 *     - iptables -A macfilter_nat -t nat -m mac --mac-source
00:05:9e:80:e1:3b ...                [ ok ]
 *   - Adding rules to flag VoIP traffic ...
 *     - iptables -A PREROUTING -t mangle -p udp -m mac --mac-source
00:05:9e:80:e1:3b -m multiport --ports 53,4569,5060,10000:20000 -j MARK
--set-mark 47 ...                                              [ ok ]
 *     - iptables -A PREROUTING -t mangle -p tcp -m mac --mac-source
00:05:9e:80:e1:3b -m multiport --ports 22,23,53 -j MARK --set-mark 47
...                                                              [ ok ]
 *     - iptables -A PREROUTING -t mangle -p icmp -m mac --mac-source
00:05:9e:80:e1:3b -j MARK --set-mark 47 ...
[ ok ]
 *     - iptables -A PREROUTING -t mangle -m mark --mark 47 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Adding rules to flag P2P traffic ...
 *     - iptables -A PREROUTING -t mangle -m mac --mac-source
00:05:9e:80:e1:3b -m ipp2p --ipp2p -j MARK
--set-mark 48 ...
[ ok ]
 *     - iptables -A PREROUTING -t mangle -m mark --mark 48 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Adding rules to flag General traffic ...
 *     - iptables -A PREROUTING -t mangle -m mac --mac-source
00:05:9e:80:e1:3b -j MARK --set-mar  [ ok ]
 *     - iptables -A PREROUTING -t mangle -m mark --mark 49 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Adding rules to classify traffic on br1 ...
 *     - iptables -A POSTROUTING -t mangle -o br1 -m mark --mark 47 -j
CLASSIFY --set-class 2:47   [ ok ]
 *     - iptables -A POSTROUTING -t mangle -o br1 -m mark --mark 48 -j
CLASSIFY --set-class 2:48   [ ok ]
 *     - iptables -A POSTROUTING -t mangle -o br1 -m mark --mark 49 -j
CLASSIFY --set-class 2:49   [ ok ]
 *   - Adding rules to classify traffic on wivl4 ...
 *     - iptables -A POSTROUTING -t mangle -o wivl4 -m mark --mark 47 -j
CLASSIFY --set-class 5:47  [ ok ]
 *     - iptables -A POSTROUTING -t mangle -o wivl4 -m mark --mark 48 -j
CLASSIFY --set-class 5:48  [ ok ]
 *     - iptables -A POSTROUTING -t mangle -o wivl4 -m mark --mark 49 -j
CLASSIFY --set-class 5:49  [ ok ]





It is all added correctly. Now, I stop the traffic shaping:




*     - iptables -D macfilter -m mac --mac-source 00:05:9e:80:e1:3b ...
[ ok ]
 *     - iptables -D macfilter_nat -t nat -m mac --mac-source
00:05:9e:80:e1:3b ...                [ ok ]
 *   - Deleting rules to flag VoIP traffic ...
 *     - iptables -D PREROUTING -t mangle -p udp -m mac --mac-source
00:05:9e:80:e1:3b -m multiport --ports 53,4569,5060,10000:20000 -j MARK
--set-mark 47 ...                                              [ ok ]
 *     - iptables -D PREROUTING -t mangle -p tcp -m mac --mac-source
00:05:9e:80:e1:3b -m multiport --ports 22,23,53 -j MARK --set-mark 47
...                                                              [ ok ]
 *     - iptables -D PREROUTING -t mangle -p icmp -m mac --mac-source
00:05:9e:80:e1:3b -j MARK --set-mark 47 ...
[ ok ]
 *     - iptables -D PREROUTING -t mangle -m mark --mark 47 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Deleting rules to flag P2P traffic ...
 *     - iptables -D PREROUTING -t mangle -m mac --mac-source
00:05:9e:80:e1:3b -m ipp2p --ipp2p -j MARK
--set-mark 48 ...
[ ok ]
 *     - iptables -D PREROUTING -t mangle -m mark --mark 48 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Deleting rules to flag General traffic ...
 *     - iptables -D PREROUTING -t mangle -m mac --mac-source
00:05:9e:80:e1:3b -j MARK --set-mar  [ ok ]
 *     - iptables -D PREROUTING -t mangle -m mark --mark 49 -j CONNMARK
--save-mark ...            [ ok ]
 *   - Deleting rules to classify traffic on br1 ...
 *     - iptables -D POSTROUTING -t mangle -o br1 -m mark --mark 47 -j
CLASSIFY --set-class 2:47   [ ok ]
 *     - iptables -D POSTROUTING -t mangle -o br1 -m mark --mark 48 -j
CLASSIFY --set-class 2:48   [ ok ]
 *     - iptables -D POSTROUTING -t mangle -o br1 -m mark --mark 49 -j
CLASSIFY --set-class 2:49   [ ok ]
 *   - Deleting rules to classify traffic on wivl4 ...
 *     - iptables -D POSTROUTING -t mangle -o wivl4 -m mark --mark 47 -j
CLASSIFY --set-class 5:47  [ ok ]
 *     - iptables -D POSTROUTING -t mangle -o wivl4 -m mark --mark 48 -j
CLASSIFY --set-class 5:48  [ ok ]
 *     - iptables -D POSTROUTING -t mangle -o wivl4 -m mark --mark 49 -j
CLASSIFY --set-class 5:49  [ ok ]
 * Deleting bandwidth management for gsoule ...
 *   - Deleting classes on br1 for upload control ...
 *     - tc class del dev br1 parent 2:46 classid 2:47 hfsc sc umax
1500b dmax 30ms rate 80Kbit .  [ ok ]
 *     - tc class del dev br1 parent 2:46 classid 2:48 hfsc ls m2
152.0Kbit ul m2 152.0Kbit ...    [ ok ]
 *     - tc class del dev br1 parent 2:46 classid 2:49 hfsc rt m2
76.00Kbit ls m2 152.0Kbit ul m2 304Kbit
 ...
[ ok ]
 *     - tc class del dev br1 parent 2:0 classid 2:46  hfsc ls m1
576.0Kbit d 2000ms m2 192.0Kbit ul m2 384Kbit ...
 * >>>>> RTNETLINK answers: Device or resource busy
[ !! ]
 *   - Deleting classes on wivl4 for download control ...
 *     - tc class del dev wivl4 parent 5:46 classid 5:47 hfsc sc umax
1500b dmax 30ms rate 80Kbit  [ ok ]
 *     - tc class del dev wivl4 parent 5:46 classid 5:48 hfsc ls m2
472.0Kbit ul m2 472.0Kbit ...  [ ok ]
 *     - tc class del dev wivl4 parent 5:46 classid 5:49 hfsc rt m2
236.00Kbit ls m2 472.0Kbit ul m2 944Kbit ...
[ ok ]
 *     - tc class del dev eth1 parent 5:0 classid 5:46 hfsc ls m1
1536.0Kbit d 2000ms m2 256.00Kbit ul m2
 1024Kbit ...
 * >>>>> RTNETLINK answers: No such file or directory
[ !! ]


Those two rules do not get removed. I do not understand why they are
failing. The del rules are exactly the same as the add rules, except
they say del instead of add. I can clear the rules by deleting the root
qdiscs on the interface, but that removes all rules for the entire
interface, which is not the desired operation. 

Also, a quick test by hand shows that it is only from having a child
class assigned to it that it becomes un-deletable. 

This works fine:

wireless-r1 raddb # tc class add dev wivl4 parent 5:0 classid 5:56 hfsc
ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit

wireless-r1 raddb # tc class del dev wivl4 parent 5:0 classid 5:56 hfsc
ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit


This does not:

wireless-r1 raddb # tc class add dev wivl4 parent 5:0 classid 5:56 hfsc
ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit

wireless-r1 raddb # tc class add dev wivl4 parent 5:56 classid 5:57 hfsc
sc umax 1500b dmax 30ms rate 80Kbit

wireless-r1 raddb # tc class del dev wivl4 parent 5:56 classid 5:57 hfsc
sc umax 1500b dmax 30ms rate 80Kbit

wireless-r1 raddb # tc class del dev wivl4 parent 5:0 classid 5:56 hfsc
ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit
RTNETLINK answers: Device or resource busy


I have looked everywhere trying to figure this out. Does anyone have any
ideas?

Thanks.
 
Eliot Gable
Certified Wireless Network Administrator (CWNA)
Certified Wireless Security Professional (CWSP)
Cisco Certified Network Associate (CCNA)
CompTIA Security+ Certified
CompTIA Network+ Certified
Network and Systems Administrator
Great Lakes Internet, Inc.
112 North Howard
Croswell, MI 48422
(810) 679-3395
(877) 558-8324
 
Now offering Broadband Wireless Internet access in Croswell, Lexington,
Brown City, Yale, and Sandusky. Call for details.

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] tc del class not working
  2006-05-09 18:10 [LARTC] tc del class not working Eliot, Wireless and Server Administrator,  Great Lakes Internet
@ 2006-05-09 22:17 ` Andreas Mueller
  2006-05-09 22:19 ` Andreas Mueller
  2006-05-10  4:43 ` Patrick McHardy
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Mueller @ 2006-05-09 22:17 UTC (permalink / raw)
  To: lartc

Hi, this is a bug in the sch_hfsc.c module, the level count doesn't get
adjusted correctly.
The following patch works for me, but is not a beauty and may be wrong.

Andreas

Eliot, Wireless and Server Administrator,  Great Lakes Internet wrote:
...
> Also, a quick test by hand shows that it is only from having a child
> class assigned to it that it becomes un-deletable. 
...
> 
> This does not:
> 
> wireless-r1 raddb # tc class add dev wivl4 parent 5:0 classid 5:56 hfsc
> ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit
> 
> wireless-r1 raddb # tc class add dev wivl4 parent 5:56 classid 5:57 hfsc
> sc umax 1500b dmax 30ms rate 80Kbit
> 
> wireless-r1 raddb # tc class del dev wivl4 parent 5:56 classid 5:57 hfsc
> sc umax 1500b dmax 30ms rate 80Kbit
> 
> wireless-r1 raddb # tc class del dev wivl4 parent 5:0 classid 5:56 hfsc
> ls m1 1536.0Kbit d 2000ms m2 256.00Kbit ul m2 1024Kbit
> RTNETLINK answers: Device or resource busy
...
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] tc del class not working
  2006-05-09 18:10 [LARTC] tc del class not working Eliot, Wireless and Server Administrator,  Great Lakes Internet
  2006-05-09 22:17 ` Andreas Mueller
@ 2006-05-09 22:19 ` Andreas Mueller
  2006-05-10  4:43 ` Patrick McHardy
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Mueller @ 2006-05-09 22:19 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 33 bytes --]

I allways forget attachments. ;)

[-- Attachment #2: sch_hfsc.patch --]
[-- Type: text/plain, Size: 465 bytes --]

--- linux/net/sched/sch_hfsc.c~	2006-01-15 07:16:02.000000000 +0100
+++ linux/net/sched/sch_hfsc.c	2006-05-10 00:07:07.000000000 +0200
@@ -970,14 +970,15 @@
 {
 	struct hfsc_class *p;
 	unsigned int level;
-
+	int adj = 0;
 	do {
 		level = 0;
 		list_for_each_entry(p, &cl->children, siblings) {
 			if (p->level > level)
 				level = p->level;
+			adj = 1;
 		}
-		cl->level = level + 1;
+		cl->level = level + adj;
 	} while ((cl = cl->cl_parent) != NULL);
 }
 

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] tc del class not working
  2006-05-09 18:10 [LARTC] tc del class not working Eliot, Wireless and Server Administrator,  Great Lakes Internet
  2006-05-09 22:17 ` Andreas Mueller
  2006-05-09 22:19 ` Andreas Mueller
@ 2006-05-10  4:43 ` Patrick McHardy
  2 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2006-05-10  4:43 UTC (permalink / raw)
  To: lartc

Andreas Mueller wrote:
> I allways forget attachments. ;)
> 
> 
> ------------------------------------------------------------------------
> 
> --- linux/net/sched/sch_hfsc.c~	2006-01-15 07:16:02.000000000 +0100
> +++ linux/net/sched/sch_hfsc.c	2006-05-10 00:07:07.000000000 +0200
> @@ -970,14 +970,15 @@
>  {
>  	struct hfsc_class *p;
>  	unsigned int level;
> -
> +	int adj = 0;
>  	do {
>  		level = 0;
>  		list_for_each_entry(p, &cl->children, siblings) {
>  			if (p->level > level)
>  				level = p->level;
> +			adj = 1;
>  		}
> -		cl->level = level + 1;
> +		cl->level = level + adj;
>  	} while ((cl = cl->cl_parent) != NULL);
>  }


Nice catch, this could result in quite some undesirable behaviour.
The unconditional + 1 seems to be a thinko originating in class
addition. A slightly prettier fix would be to just change

if (p->level > level)
	level = p->level

to

if (p->level >= level)
	level = p->level + 1

If you send me a patch which does that and a proper Signed-off-by:
line I'll push it upstream for 2.6.17.

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-10  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-09 18:10 [LARTC] tc del class not working Eliot, Wireless and Server Administrator,  Great Lakes Internet
2006-05-09 22:17 ` Andreas Mueller
2006-05-09 22:19 ` Andreas Mueller
2006-05-10  4:43 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.