|
@@ -189,15 +189,17 @@ static inline int qdisc_restart(struct Qdisc *q)
|
|
|
|
|
|
void __qdisc_run(struct Qdisc *q)
|
|
void __qdisc_run(struct Qdisc *q)
|
|
{
|
|
{
|
|
- unsigned long start_time = jiffies;
|
|
|
|
|
|
+ int quota = weight_p;
|
|
|
|
+ int work = 0;
|
|
|
|
|
|
while (qdisc_restart(q)) {
|
|
while (qdisc_restart(q)) {
|
|
|
|
+ work++;
|
|
/*
|
|
/*
|
|
- * Postpone processing if
|
|
|
|
- * 1. another process needs the CPU;
|
|
|
|
- * 2. we've been doing it for too long.
|
|
|
|
|
|
+ * Ordered by possible occurrence: Postpone processing if
|
|
|
|
+ * 1. we've exceeded packet quota
|
|
|
|
+ * 2. another process needs the CPU;
|
|
*/
|
|
*/
|
|
- if (need_resched() || jiffies != start_time) {
|
|
|
|
|
|
+ if (work >= quota || need_resched()) {
|
|
__netif_schedule(q);
|
|
__netif_schedule(q);
|
|
break;
|
|
break;
|
|
}
|
|
}
|