Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69d78ef2 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: sched: store Qdisc pointer in struct block



Prepare for removal of tp->q and store Qdisc pointer in the block
structure.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 32302902
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index,
				bool create);
void tcf_chain_put(struct tcf_chain *chain);
int tcf_block_get(struct tcf_block **p_block,
		  struct tcf_proto __rcu **p_filter_chain);
		  struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q);
void tcf_block_put(struct tcf_block *block);
int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
		 struct tcf_result *res, bool compat_mode);
@@ -30,7 +30,7 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp,
#else
static inline
int tcf_block_get(struct tcf_block **p_block,
		  struct tcf_proto __rcu **p_filter_chain)
		  struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q)
{
	return 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -270,6 +270,7 @@ struct tcf_chain {

struct tcf_block {
	struct list_head chain_list;
	struct Qdisc *q;
};

static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+2 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ tcf_chain_filter_chain_ptr_set(struct tcf_chain *chain,
}

int tcf_block_get(struct tcf_block **p_block,
		  struct tcf_proto __rcu **p_filter_chain)
		  struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q)
{
	struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL);
	struct tcf_chain *chain;
@@ -257,6 +257,7 @@ int tcf_block_get(struct tcf_block **p_block,
		goto err_chain_create;
	}
	tcf_chain_filter_chain_ptr_set(chain, p_filter_chain);
	block->q = q;
	*p_block = block;
	return 0;

+2 −2
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
		goto err_out;
	}

	error = tcf_block_get(&flow->block, &flow->filter_list);
	error = tcf_block_get(&flow->block, &flow->filter_list, sch);
	if (error) {
		kfree(flow);
		goto err_out;
@@ -546,7 +546,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt)
		p->link.q = &noop_qdisc;
	pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q);

	err = tcf_block_get(&p->link.block, &p->link.filter_list);
	err = tcf_block_get(&p->link.block, &p->link.filter_list, sch);
	if (err)
		return err;

+1 −1
Original line number Diff line number Diff line
@@ -1566,7 +1566,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
	if (cl == NULL)
		goto failure;

	err = tcf_block_get(&cl->block, &cl->filter_list);
	err = tcf_block_get(&cl->block, &cl->filter_list, sch);
	if (err) {
		kfree(cl);
		return err;
Loading