Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c22e4640 authored by David Ward's avatar David Ward Committed by David S. Miller
Browse files

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: default avatarDavid Ward <david.ward@ll.mit.edu>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e29fe837
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
	}