sch_prio.c (85e9ca333d03fbd56b9e123c8456f0d98e20faad) sch_prio.c (378a2f090f7a478704a372a4869b8a9ac206234e)
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 *

--- 31 unchanged lines hidden (view full) ---

40
41 *qerr = NET_XMIT_BYPASS;
42 if (TC_H_MAJ(skb->priority) != sch->handle) {
43 err = tc_classify(skb, q->filter_list, &res);
44#ifdef CONFIG_NET_CLS_ACT
45 switch (err) {
46 case TC_ACT_STOLEN:
47 case TC_ACT_QUEUED:
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 *

--- 31 unchanged lines hidden (view full) ---

40
41 *qerr = NET_XMIT_BYPASS;
42 if (TC_H_MAJ(skb->priority) != sch->handle) {
43 err = tc_classify(skb, q->filter_list, &res);
44#ifdef CONFIG_NET_CLS_ACT
45 switch (err) {
46 case TC_ACT_STOLEN:
47 case TC_ACT_QUEUED:
48 *qerr = NET_XMIT_SUCCESS;
48 *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
49 case TC_ACT_SHOT:
50 return NULL;
51 }
52#endif
53 if (!q->filter_list || err < 0) {
54 if (TC_H_MAJ(band))
55 band = 0;
56 return q->queues[q->prio2band[band&TC_PRIO_MAX]];

--- 26 unchanged lines hidden (view full) ---

83
84 ret = qdisc_enqueue(skb, qdisc);
85 if (ret == NET_XMIT_SUCCESS) {
86 sch->bstats.bytes += qdisc_pkt_len(skb);
87 sch->bstats.packets++;
88 sch->q.qlen++;
89 return NET_XMIT_SUCCESS;
90 }
49 case TC_ACT_SHOT:
50 return NULL;
51 }
52#endif
53 if (!q->filter_list || err < 0) {
54 if (TC_H_MAJ(band))
55 band = 0;
56 return q->queues[q->prio2band[band&TC_PRIO_MAX]];

--- 26 unchanged lines hidden (view full) ---

83
84 ret = qdisc_enqueue(skb, qdisc);
85 if (ret == NET_XMIT_SUCCESS) {
86 sch->bstats.bytes += qdisc_pkt_len(skb);
87 sch->bstats.packets++;
88 sch->q.qlen++;
89 return NET_XMIT_SUCCESS;
90 }
91 sch->qstats.drops++;
91 if (net_xmit_drop_count(ret))
92 sch->qstats.drops++;
92 return ret;
93}
94
95
96static int
97prio_requeue(struct sk_buff *skb, struct Qdisc* sch)
98{
99 struct Qdisc *qdisc;

--- 9 unchanged lines hidden (view full) ---

109 }
110#endif
111
112 if ((ret = qdisc->ops->requeue(skb, qdisc)) == NET_XMIT_SUCCESS) {
113 sch->q.qlen++;
114 sch->qstats.requeues++;
115 return 0;
116 }
93 return ret;
94}
95
96
97static int
98prio_requeue(struct sk_buff *skb, struct Qdisc* sch)
99{
100 struct Qdisc *qdisc;

--- 9 unchanged lines hidden (view full) ---

110 }
111#endif
112
113 if ((ret = qdisc->ops->requeue(skb, qdisc)) == NET_XMIT_SUCCESS) {
114 sch->q.qlen++;
115 sch->qstats.requeues++;
116 return 0;
117 }
117 sch->qstats.drops++;
118 if (net_xmit_drop_count(ret))
119 sch->qstats.drops++;
118 return NET_XMIT_DROP;
119}
120
121
122static struct sk_buff *prio_dequeue(struct Qdisc* sch)
123{
124 struct prio_sched_data *q = qdisc_priv(sch);
125 int prio;

--- 324 unchanged lines hidden ---
120 return NET_XMIT_DROP;
121}
122
123
124static struct sk_buff *prio_dequeue(struct Qdisc* sch)
125{
126 struct prio_sched_data *q = qdisc_priv(sch);
127 int prio;

--- 324 unchanged lines hidden ---