diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-06-19 01:58:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-19 01:58:35 -0400 |
commit | 321090e7a468ab33917a0af839a3ae923b1c1bc5 (patch) | |
tree | 70bf124595a2e8cdbafbf3987820231b11ce7386 /net | |
parent | 821d24ae741f83ef0754a98b4b8aef7231856543 (diff) |
[PKT_SCHED]: Add and use prio2list() in the pfifo_fast qdisc
prio2list() returns the relevant sk_buff_head for the
band specified by the priority for a given skb.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_generic.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 03cf001adb41..a08a98e7b943 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -311,12 +311,17 @@ static const u8 prio2band[TC_PRIO_MAX+1] = | |||
311 | generic prio+fifo combination. | 311 | generic prio+fifo combination. |
312 | */ | 312 | */ |
313 | 313 | ||
314 | static int | 314 | static inline struct sk_buff_head *prio2list(struct sk_buff *skb, |
315 | pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc) | 315 | struct Qdisc *qdisc) |
316 | { | 316 | { |
317 | struct sk_buff_head *list = qdisc_priv(qdisc); | 317 | struct sk_buff_head *list = qdisc_priv(qdisc); |
318 | return list + prio2band[skb->priority & TC_PRIO_MAX]; | ||
319 | } | ||
318 | 320 | ||
319 | list += prio2band[skb->priority&TC_PRIO_MAX]; | 321 | static int |
322 | pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc) | ||
323 | { | ||
324 | struct sk_buff_head *list = prio2list(skb, qdisc); | ||
320 | 325 | ||
321 | if (skb_queue_len(list) < qdisc->dev->tx_queue_len) { | 326 | if (skb_queue_len(list) < qdisc->dev->tx_queue_len) { |
322 | qdisc->q.qlen++; | 327 | qdisc->q.qlen++; |
@@ -345,12 +350,8 @@ pfifo_fast_dequeue(struct Qdisc* qdisc) | |||
345 | static int | 350 | static int |
346 | pfifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc) | 351 | pfifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc) |
347 | { | 352 | { |
348 | struct sk_buff_head *list = qdisc_priv(qdisc); | ||
349 | |||
350 | list += prio2band[skb->priority&TC_PRIO_MAX]; | ||
351 | |||
352 | qdisc->q.qlen++; | 353 | qdisc->q.qlen++; |
353 | return __qdisc_requeue(skb, qdisc, list); | 354 | return __qdisc_requeue(skb, qdisc, prio2list(skb, qdisc)); |
354 | } | 355 | } |
355 | 356 | ||
356 | static void | 357 | static void |