Skip to content

Commit 5579ee4

Browse files
edumazetPaolo Abeni
authored andcommitted
net_sched: export pfifo_fast prio2band[]
pfifo_fast prio2band[] is renamed to sch_default_prio2band[] and exported because we want to share it in FQ. Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Dave Taht <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Reviewed-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 2ae4513 commit 5579ee4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

include/net/sch_generic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ static inline void sch_tree_unlock(struct Qdisc *q)
587587
extern struct Qdisc noop_qdisc;
588588
extern struct Qdisc_ops noop_qdisc_ops;
589589
extern struct Qdisc_ops pfifo_fast_ops;
590+
extern const u8 sch_default_prio2band[TC_PRIO_MAX + 1];
590591
extern struct Qdisc_ops mq_qdisc_ops;
591592
extern struct Qdisc_ops noqueue_qdisc_ops;
592593
extern const struct Qdisc_ops *default_qdisc_ops;

net/sched/sch_generic.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,10 @@ struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
694694
.owner = THIS_MODULE,
695695
};
696696

697-
static const u8 prio2band[TC_PRIO_MAX + 1] = {
698-
1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
697+
const u8 sch_default_prio2band[TC_PRIO_MAX + 1] = {
698+
1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1
699699
};
700+
EXPORT_SYMBOL(sch_default_prio2band);
700701

701702
/* 3-band FIFO queue: old style, but should be a bit faster than
702703
generic prio+fifo combination.
@@ -721,7 +722,7 @@ static inline struct skb_array *band2list(struct pfifo_fast_priv *priv,
721722
static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
722723
struct sk_buff **to_free)
723724
{
724-
int band = prio2band[skb->priority & TC_PRIO_MAX];
725+
int band = sch_default_prio2band[skb->priority & TC_PRIO_MAX];
725726
struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
726727
struct skb_array *q = band2list(priv, band);
727728
unsigned int pkt_len = qdisc_pkt_len(skb);
@@ -830,7 +831,7 @@ static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb)
830831
{
831832
struct tc_prio_qopt opt = { .bands = PFIFO_FAST_BANDS };
832833

833-
memcpy(&opt.priomap, prio2band, TC_PRIO_MAX + 1);
834+
memcpy(&opt.priomap, sch_default_prio2band, TC_PRIO_MAX + 1);
834835
if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt))
835836
goto nla_put_failure;
836837
return skb->len;

0 commit comments

Comments
 (0)