Skip to contentSkip to conversation

: Check for leaf-class when classifying by priority

PATCH In review Patrick McHardy 2 participants 2 messages Nov 13, 2003 – Nov 19, 2003

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Check for leaf-class when classifying by priority

Hi devik,

this patch makes htb_classify check if a class is a leaf when classifying by priority. It also adds a check from cbq to skip htb_find if the majors of skb->priority and sch->handle differ.

Best regards,
Patrick

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1430 -> 1.1431
# net/sched/sch_htb.c 1.15 -> 1.16
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/12 [email protected] 1.1431
# Check for leaf-class when classifying by priority, don't try if majors differ # --------------------------------------------
#

net/sched/sch_htb.c +4 -2
diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c
@@ -303,8 +303,10 @@
 	   rules in it */
 	if (skb->priority == sch->handle)
 		return HTB_DIRECT;  /* X:0 (direct flow) selected */
-	if ((cl = htb_find(skb->priority,sch)) != NULL) 
-		return cl;
+	if (TC_H_MAJ(skb->priority^sch->handle) == 0 &&
+	    (cl = htb_find(skb->priority,sch)) != NULL) 
+		if (cl->level == 0)
+			return cl;
 
 	tcf = q->filter_list;
 	while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
#1 lore raw
Quoted 3 lines · On Thu, 13 Nov 2003 16:00:50 +0100 Patrick McHardy <[email protected]> wrote:

this patch makes htb_classify check if a class is a leaf when classifying by priority. It also adds a check from cbq to skip htb_find if the majors of skb->priority and sch->handle differ.

I'm going to hold on this patch for two reasons:

1) To allow Martin to respond and review it.
2) I want the OOPS'er we have pending on the HTB scheduler resolved first.

Martin, have you made any progress with that HTB 2.6.x oops issue yet?

Thanks guys.