diff options
author | Thomas Graf <tgraf@suug.ch> | 2005-06-19 07:58:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-19 07:58:35 +0200 |
commit | 321090e7a468ab33917a0af839a3ae923b1c1bc5 (patch) | |
tree | 70bf124595a2e8cdbafbf3987820231b11ce7386 /net/sched/sch_generic.c | |
parent | [PKT_SCHED]: Transform pfifo_fast to use generic queue management interface (diff) | |
download | linux-321090e7a468ab33917a0af839a3ae923b1c1bc5.tar.xz linux-321090e7a468ab33917a0af839a3ae923b1c1bc5.zip |
[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/sched/sch_generic.c')
-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] = generic prio+fifo combination. */ -static int -pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc) +static inline struct sk_buff_head *prio2list(struct sk_buff *skb, + struct Qdisc *qdisc) { struct sk_buff_head *list = qdisc_priv(qdisc); + return list + prio2band[skb->priority & TC_PRIO_MAX]; +} - list += prio2band[skb->priority&TC_PRIO_MAX]; +static int +pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc) +{ + struct sk_buff_head *list = prio2list(skb, qdisc); if (skb_queue_len(list) < qdisc->dev->tx_queue_len) { qdisc->q.qlen++; @@ -345,12 +350,8 @@ pfifo_fast_dequeue(struct Qdisc* qdisc) static int pfifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc) { - struct sk_buff_head *list = qdisc_priv(qdisc); - - list += prio2band[skb->priority&TC_PRIO_MAX]; - qdisc->q.qlen++; - return __qdisc_requeue(skb, qdisc, list); + return __qdisc_requeue(skb, qdisc, prio2list(skb, qdisc)); } static void |