diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-20 22:00:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 22:00:49 -0500 |
commit | 6d037a26f08711a222ed0d3d12b09e93eed7d3e8 (patch) | |
tree | a200247459a6a378a1fb24847d383bddb09f5b67 /net | |
parent | a85d771e32f9724b61a68748cc667d1e11fe3478 (diff) |
[PKT_SCHED]: Qdisc drop operation is optional
The drop operation is optional and qdiscs must check if childs support it.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_netem.c | 4 | ||||
-rw-r--r-- | net/sched/sch_prio.c | 2 | ||||
-rw-r--r-- | net/sched/sch_tbf.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index ba5283204837..7228d30512c7 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -252,9 +252,9 @@ static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch) | |||
252 | static unsigned int netem_drop(struct Qdisc* sch) | 252 | static unsigned int netem_drop(struct Qdisc* sch) |
253 | { | 253 | { |
254 | struct netem_sched_data *q = qdisc_priv(sch); | 254 | struct netem_sched_data *q = qdisc_priv(sch); |
255 | unsigned int len; | 255 | unsigned int len = 0; |
256 | 256 | ||
257 | if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) { | 257 | if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) { |
258 | sch->q.qlen--; | 258 | sch->q.qlen--; |
259 | sch->qstats.drops++; | 259 | sch->qstats.drops++; |
260 | } | 260 | } |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 1641db33a994..3395ca7bcadf 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -165,7 +165,7 @@ static unsigned int prio_drop(struct Qdisc* sch) | |||
165 | 165 | ||
166 | for (prio = q->bands-1; prio >= 0; prio--) { | 166 | for (prio = q->bands-1; prio >= 0; prio--) { |
167 | qdisc = q->queues[prio]; | 167 | qdisc = q->queues[prio]; |
168 | if ((len = qdisc->ops->drop(qdisc)) != 0) { | 168 | if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) { |
169 | sch->q.qlen--; | 169 | sch->q.qlen--; |
170 | return len; | 170 | return len; |
171 | } | 171 | } |
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index cb9711ea8c6c..e9e473457361 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -177,9 +177,9 @@ static int tbf_requeue(struct sk_buff *skb, struct Qdisc* sch) | |||
177 | static unsigned int tbf_drop(struct Qdisc* sch) | 177 | static unsigned int tbf_drop(struct Qdisc* sch) |
178 | { | 178 | { |
179 | struct tbf_sched_data *q = qdisc_priv(sch); | 179 | struct tbf_sched_data *q = qdisc_priv(sch); |
180 | unsigned int len; | 180 | unsigned int len = 0; |
181 | 181 | ||
182 | if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) { | 182 | if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) { |
183 | sch->q.qlen--; | 183 | sch->q.qlen--; |
184 | sch->qstats.drops++; | 184 | sch->qstats.drops++; |
185 | } | 185 | } |