Commit f7ebdff7 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: sched: sch_atm: use Qdisc_class_common structure

Even if it is only for classid now, use this common struct a be aligned
with the rest of the classful qdiscs.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 967b2e2a
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back)) #define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back))
struct atm_flow_data { struct atm_flow_data {
struct Qdisc_class_common common;
struct Qdisc *q; /* FIFO, TBF, etc. */ struct Qdisc *q; /* FIFO, TBF, etc. */
struct tcf_proto __rcu *filter_list; struct tcf_proto __rcu *filter_list;
struct tcf_block *block; struct tcf_block *block;
...@@ -49,7 +50,6 @@ struct atm_flow_data { ...@@ -49,7 +50,6 @@ struct atm_flow_data {
struct sk_buff *skb); /* chaining */ struct sk_buff *skb); /* chaining */
struct atm_qdisc_data *parent; /* parent qdisc */ struct atm_qdisc_data *parent; /* parent qdisc */
struct socket *sock; /* for closing */ struct socket *sock; /* for closing */
u32 classid; /* x:y type ID */
int ref; /* reference count */ int ref; /* reference count */
struct gnet_stats_basic_packed bstats; struct gnet_stats_basic_packed bstats;
struct gnet_stats_queue qstats; struct gnet_stats_queue qstats;
...@@ -75,7 +75,7 @@ static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid) ...@@ -75,7 +75,7 @@ static inline struct atm_flow_data *lookup_flow(struct Qdisc *sch, u32 classid)
struct atm_flow_data *flow; struct atm_flow_data *flow;
list_for_each_entry(flow, &p->flows, list) { list_for_each_entry(flow, &p->flows, list) {
if (flow->classid == classid) if (flow->common.classid == classid)
return flow; return flow;
} }
return NULL; return NULL;
...@@ -293,7 +293,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, ...@@ -293,7 +293,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
flow->old_pop = flow->vcc->pop; flow->old_pop = flow->vcc->pop;
flow->parent = p; flow->parent = p;
flow->vcc->pop = sch_atm_pop; flow->vcc->pop = sch_atm_pop;
flow->classid = classid; flow->common.classid = classid;
flow->ref = 1; flow->ref = 1;
flow->excess = excess; flow->excess = excess;
list_add(&flow->list, &p->link.list); list_add(&flow->list, &p->link.list);
...@@ -549,7 +549,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt) ...@@ -549,7 +549,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
p->link.vcc = NULL; p->link.vcc = NULL;
p->link.sock = NULL; p->link.sock = NULL;
p->link.classid = sch->handle; p->link.common.classid = sch->handle;
p->link.ref = 1; p->link.ref = 1;
tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch); tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch);
return 0; return 0;
...@@ -594,7 +594,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -594,7 +594,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
sch, p, flow, skb, tcm); sch, p, flow, skb, tcm);
if (list_empty(&flow->list)) if (list_empty(&flow->list))
return -EINVAL; return -EINVAL;
tcm->tcm_handle = flow->classid; tcm->tcm_handle = flow->common.classid;
tcm->tcm_info = flow->q->handle; tcm->tcm_info = flow->q->handle;
nest = nla_nest_start(skb, TCA_OPTIONS); nest = nla_nest_start(skb, TCA_OPTIONS);
...@@ -619,7 +619,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl, ...@@ -619,7 +619,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
goto nla_put_failure; goto nla_put_failure;
} }
if (flow->excess) { if (flow->excess) {
if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->classid)) if (nla_put_u32(skb, TCA_ATM_EXCESS, flow->common.classid))
goto nla_put_failure; goto nla_put_failure;
} else { } else {
if (nla_put_u32(skb, TCA_ATM_EXCESS, 0)) if (nla_put_u32(skb, TCA_ATM_EXCESS, 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment