diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-15 03:02:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-07-15 03:02:31 -0400 |
commit | 73ca4918fbb98311421259d82ef4ab44feeace43 (patch) | |
tree | a5ae62e5474b3d28d7205ab3170aa73ff6d5f8ac /net/sched/sch_atm.c | |
parent | f6853e2df3de82c1dac8f62ddcf3a8dfa302419e (diff) |
[NET_SCHED]: act_api: qdisc internal reclassify support
The behaviour of NET_CLS_POLICE for TC_POLICE_RECLASSIFY was to return
it to the qdisc, which could handle it internally or ignore it. With
NET_CLS_ACT however, tc_classify starts over at the first classifier
and never returns it to the qdisc. This makes it impossible to support
qdisc-internal reclassification, which in turn makes it impossible to
remove the old NET_CLS_POLICE code without breaking compatibility since
we have two qdiscs (CBQ and ATM) that support this.
This patch adds a tc_classify_compat function that handles
reclassification the old way and changes CBQ and ATM to use it.
This again is of course not fully backwards compatible with the previous
NET_CLS_ACT behaviour. Unfortunately there is no way to fully maintain
compatibility *and* support qdisc internal reclassification with
NET_CLS_ACT, but this seems like the better choice over keeping the two
incompatible options around forever.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_atm.c')
-rw-r--r-- | net/sched/sch_atm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index ccee10dae66d..37ae6d1deb14 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
@@ -396,8 +396,9 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
396 | !(flow = (struct atm_flow_data *)atm_tc_get(sch, skb->priority))) | 396 | !(flow = (struct atm_flow_data *)atm_tc_get(sch, skb->priority))) |
397 | for (flow = p->flows; flow; flow = flow->next) | 397 | for (flow = p->flows; flow; flow = flow->next) |
398 | if (flow->filter_list) { | 398 | if (flow->filter_list) { |
399 | result = tc_classify(skb, flow->filter_list, | 399 | result = tc_classify_compat(skb, |
400 | &res); | 400 | flow->filter_list, |
401 | &res); | ||
401 | if (result < 0) | 402 | if (result < 0) |
402 | continue; | 403 | continue; |
403 | flow = (struct atm_flow_data *)res.class; | 404 | flow = (struct atm_flow_data *)res.class; |
@@ -420,6 +421,12 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
420 | case TC_ACT_SHOT: | 421 | case TC_ACT_SHOT: |
421 | kfree_skb(skb); | 422 | kfree_skb(skb); |
422 | goto drop; | 423 | goto drop; |
424 | case TC_POLICE_RECLASSIFY: | ||
425 | if (flow->excess) | ||
426 | flow = flow->excess; | ||
427 | else | ||
428 | ATM_SKB(skb)->atm_options |= ATM_ATMOPT_CLP; | ||
429 | break; | ||
423 | } | 430 | } |
424 | #elif defined(CONFIG_NET_CLS_POLICE) | 431 | #elif defined(CONFIG_NET_CLS_POLICE) |
425 | switch (result) { | 432 | switch (result) { |