Lines Matching +full:1 +full:q
40 static u16 calc_new_high_prio(const struct skbprio_sched_data *q) in calc_new_high_prio() argument
44 for (prio = q->highest_prio - 1; prio >= q->lowest_prio; prio--) { in calc_new_high_prio()
45 if (!skb_queue_empty(&q->qdiscs[prio])) in calc_new_high_prio()
53 static u16 calc_new_low_prio(const struct skbprio_sched_data *q) in calc_new_low_prio() argument
57 for (prio = q->lowest_prio + 1; prio <= q->highest_prio; prio++) { in calc_new_low_prio()
58 if (!skb_queue_empty(&q->qdiscs[prio])) in calc_new_low_prio()
62 /* SKB queue is empty, return SKBPRIO_MAX_PRIORITY - 1 in calc_new_low_prio()
65 return SKBPRIO_MAX_PRIORITY - 1; in calc_new_low_prio()
71 const unsigned int max_priority = SKBPRIO_MAX_PRIORITY - 1; in skbprio_enqueue()
72 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_enqueue() local
81 qdisc = &q->qdiscs[prio]; in skbprio_enqueue()
84 if (sch->q.qlen < READ_ONCE(sch->limit)) { in skbprio_enqueue()
87 q->qstats[prio].backlog += qdisc_pkt_len(skb); in skbprio_enqueue()
90 if (prio > q->highest_prio) in skbprio_enqueue()
91 q->highest_prio = prio; in skbprio_enqueue()
93 if (prio < q->lowest_prio) in skbprio_enqueue()
94 q->lowest_prio = prio; in skbprio_enqueue()
96 sch->q.qlen++; in skbprio_enqueue()
101 lp = q->lowest_prio; in skbprio_enqueue()
103 q->qstats[prio].drops++; in skbprio_enqueue()
104 q->qstats[prio].overlimits++; in skbprio_enqueue()
110 q->qstats[prio].backlog += qdisc_pkt_len(skb); in skbprio_enqueue()
113 lp_qdisc = &q->qdiscs[lp]; in skbprio_enqueue()
119 q->qstats[lp].backlog -= qdisc_pkt_len(to_drop); in skbprio_enqueue()
120 q->qstats[lp].drops++; in skbprio_enqueue()
121 q->qstats[lp].overlimits++; in skbprio_enqueue()
125 if (q->lowest_prio == q->highest_prio) { in skbprio_enqueue()
127 BUG_ON(sch->q.qlen != 1); in skbprio_enqueue()
128 q->lowest_prio = prio; in skbprio_enqueue()
129 q->highest_prio = prio; in skbprio_enqueue()
131 q->lowest_prio = calc_new_low_prio(q); in skbprio_enqueue()
135 if (prio > q->highest_prio) in skbprio_enqueue()
136 q->highest_prio = prio; in skbprio_enqueue()
143 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_dequeue() local
144 struct sk_buff_head *hpq = &q->qdiscs[q->highest_prio]; in skbprio_dequeue()
150 sch->q.qlen--; in skbprio_dequeue()
154 q->qstats[q->highest_prio].backlog -= qdisc_pkt_len(skb); in skbprio_dequeue()
158 if (q->lowest_prio == q->highest_prio) { in skbprio_dequeue()
159 BUG_ON(sch->q.qlen); in skbprio_dequeue()
160 q->highest_prio = 0; in skbprio_dequeue()
161 q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1; in skbprio_dequeue()
163 q->highest_prio = calc_new_high_prio(q); in skbprio_dequeue()
184 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_init() local
189 __skb_queue_head_init(&q->qdiscs[prio]); in skbprio_init()
191 memset(&q->qstats, 0, sizeof(q->qstats)); in skbprio_init()
192 q->highest_prio = 0; in skbprio_init()
193 q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1; in skbprio_init()
208 return -1; in skbprio_dump()
215 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_reset() local
219 __skb_queue_purge(&q->qdiscs[prio]); in skbprio_reset()
221 memset(&q->qstats, 0, sizeof(q->qstats)); in skbprio_reset()
222 q->highest_prio = 0; in skbprio_reset()
223 q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1; in skbprio_reset()
228 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_destroy() local
232 __skb_queue_purge(&q->qdiscs[prio]); in skbprio_destroy()
255 struct skbprio_sched_data *q = qdisc_priv(sch); in skbprio_dump_class_stats() local
256 if (gnet_stats_copy_queue(d, NULL, &q->qstats[cl - 1], in skbprio_dump_class_stats()
257 q->qstats[cl - 1].qlen) < 0) in skbprio_dump_class_stats()
258 return -1; in skbprio_dump_class_stats()
270 if (!tc_qdisc_stats_dump(sch, i + 1, arg)) in skbprio_walk()