diff options
Diffstat (limited to 'net/sched/sch_fq_codel.c')
| -rw-r--r-- | net/sched/sch_fq_codel.c | 18 | 
1 files changed, 12 insertions, 6 deletions
| diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 9201abce928c..337f2d6d81e4 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -55,6 +55,7 @@ struct fq_codel_flow {  struct fq_codel_sched_data {  	struct tcf_proto __rcu *filter_list; /* optional external classifier */ +	struct tcf_block *block;  	struct fq_codel_flow *flows;	/* Flows table [flows_cnt] */  	u32		*backlogs;	/* backlog table [flows_cnt] */  	u32		flows_cnt;	/* number of flows */ @@ -96,12 +97,13 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch,  		return fq_codel_hash(q, skb) + 1;  	*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; -	result = tc_classify(skb, filter, &res, false); +	result = tcf_classify(skb, filter, &res, false);  	if (result >= 0) {  #ifdef CONFIG_NET_CLS_ACT  		switch (result) {  		case TC_ACT_STOLEN:  		case TC_ACT_QUEUED: +		case TC_ACT_TRAP:  			*qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;  		case TC_ACT_SHOT:  			return 0; @@ -450,7 +452,7 @@ static void fq_codel_destroy(struct Qdisc *sch)  {  	struct fq_codel_sched_data *q = qdisc_priv(sch); -	tcf_destroy_chain(&q->filter_list); +	tcf_block_put(q->block);  	kvfree(q->backlogs);  	kvfree(q->flows);  } @@ -459,6 +461,7 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt)  {  	struct fq_codel_sched_data *q = qdisc_priv(sch);  	int i; +	int err;  	sch->limit = 10*1024;  	q->flows_cnt = 1024; @@ -478,6 +481,10 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt)  			return err;  	} +	err = tcf_block_get(&q->block, &q->filter_list); +	if (err) +		return err; +  	if (!q->flows) {  		q->flows = kvzalloc(q->flows_cnt *  					   sizeof(struct fq_codel_flow), GFP_KERNEL); @@ -589,14 +596,13 @@ static void fq_codel_put(struct Qdisc *q, unsigned long cl)  {  } -static struct tcf_proto __rcu **fq_codel_find_tcf(struct Qdisc *sch, -						  unsigned long cl) +static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long cl)  {  	struct fq_codel_sched_data *q = qdisc_priv(sch);  	if (cl)  		return NULL; -	return &q->filter_list; +	return q->block;  }  static int fq_codel_dump_class(struct Qdisc *sch, unsigned long cl, @@ -679,7 +685,7 @@ static const struct Qdisc_class_ops fq_codel_class_ops = {  	.leaf		=	fq_codel_leaf,  	.get		=	fq_codel_get,  	.put		=	fq_codel_put, -	.tcf_chain	=	fq_codel_find_tcf, +	.tcf_block	=	fq_codel_tcf_block,  	.bind_tcf	=	fq_codel_bind,  	.unbind_tcf	=	fq_codel_put,  	.dump		=	fq_codel_dump_class, |