sch_prio.c (f30ab418a1d3c5a8b83493e7d70d6876a74aa0ce) | sch_prio.c (b94c8afcba3ae6584653b98e315446ea83be6ea5) |
---|---|
1/* 2 * net/sched/sch_prio.c Simple 3-band priority "scheduler". 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 173 unchanged lines hidden (view full) --- 182 return -EINVAL; 183 } 184 185 sch_tree_lock(sch); 186 q->bands = qopt->bands; 187 memcpy(q->prio2band, qopt->priomap, TC_PRIO_MAX+1); 188 189 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) { | 1/* 2 * net/sched/sch_prio.c Simple 3-band priority "scheduler". 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 173 unchanged lines hidden (view full) --- 182 return -EINVAL; 183 } 184 185 sch_tree_lock(sch); 186 q->bands = qopt->bands; 187 memcpy(q->prio2band, qopt->priomap, TC_PRIO_MAX+1); 188 189 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) { |
190 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc); | 190 struct Qdisc *child = q->queues[i]; 191 q->queues[i] = &noop_qdisc; |
191 if (child != &noop_qdisc) { 192 qdisc_tree_decrease_qlen(child, child->q.qlen); 193 qdisc_destroy(child); 194 } 195 } 196 sch_tree_unlock(sch); 197 198 for (i=0; i<q->bands; i++) { 199 if (q->queues[i] == &noop_qdisc) { | 192 if (child != &noop_qdisc) { 193 qdisc_tree_decrease_qlen(child, child->q.qlen); 194 qdisc_destroy(child); 195 } 196 } 197 sch_tree_unlock(sch); 198 199 for (i=0; i<q->bands; i++) { 200 if (q->queues[i] == &noop_qdisc) { |
200 struct Qdisc *child; | 201 struct Qdisc *child, *old; |
201 child = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, 202 &pfifo_qdisc_ops, 203 TC_H_MAKE(sch->handle, i + 1)); 204 if (child) { 205 sch_tree_lock(sch); | 202 child = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue, 203 &pfifo_qdisc_ops, 204 TC_H_MAKE(sch->handle, i + 1)); 205 if (child) { 206 sch_tree_lock(sch); |
206 child = xchg(&q->queues[i], child); | 207 old = q->queues[i]; 208 q->queues[i] = child; |
207 | 209 |
208 if (child != &noop_qdisc) { 209 qdisc_tree_decrease_qlen(child, 210 child->q.qlen); 211 qdisc_destroy(child); | 210 if (old != &noop_qdisc) { 211 qdisc_tree_decrease_qlen(old, 212 old->q.qlen); 213 qdisc_destroy(old); |
212 } 213 sch_tree_unlock(sch); 214 } 215 } 216 } 217 return 0; 218} 219 --- 214 unchanged lines hidden --- | 214 } 215 sch_tree_unlock(sch); 216 } 217 } 218 } 219 return 0; 220} 221 --- 214 unchanged lines hidden --- |