summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorDavid Ward <david.ward@ll.mit.edu>2012-09-13 05:22:33 +0000
committerDavid S. Miller <davem@davemloft.net>2012-09-13 16:10:13 -0400
commitc22e464022f935b0cbd8724b1d99d800d49518a9 (patch)
tree361fcb9ccd626dff3ab49ac8914bdeca1d73b367 /net/sched
parente29fe837bfa3ca0a9f4ef1d4a90e6e0a74b6b8a0 (diff)
downloadop-kernel-dev-c22e464022f935b0cbd8724b1d99d800d49518a9.zip
op-kernel-dev-c22e464022f935b0cbd8724b1d99d800d49518a9.tar.gz
net_sched: gred: eliminate redundant DP prio comparisons
Each pair of DPs only needs to be compared once when searching for a non-unique prio value. Signed-off-by: David Ward <david.ward@ll.mit.edu> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_gred.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index fca73cd..e19d4eb 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -102,9 +102,8 @@ static inline int gred_wred_mode_check(struct Qdisc *sch)
if (q == NULL)
continue;
- for (n = 0; n < table->DPs; n++)
- if (table->tab[n] && table->tab[n] != q &&
- table->tab[n]->prio == q->prio)
+ for (n = i + 1; n < table->DPs; n++)
+ if (table->tab[n] && table->tab[n]->prio == q->prio)
return 1;
}
OpenPOWER on IntegriCloud