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

Commit 9f9afec4 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NET_SCHED]: Set parent classid in default qdiscs



Set parent classids in default qdiscs to allow walking up the tree
from outside the qdiscs. This is needed by the next patch.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 814a175e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ extern void qdisc_reset(struct Qdisc *qdisc);
extern void qdisc_destroy(struct Qdisc *qdisc);
extern void qdisc_destroy(struct Qdisc *qdisc);
extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops);
extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops);
extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
				       struct Qdisc_ops *ops);
				       struct Qdisc_ops *ops, u32 parentid);


static inline void
static inline void
tcf_destroy(struct tcf_proto *tp)
tcf_destroy(struct tcf_proto *tp)
+3 −2
Original line number Original line Diff line number Diff line
@@ -316,7 +316,7 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,
	}
	}
	memset(flow,0,sizeof(*flow));
	memset(flow,0,sizeof(*flow));
	flow->filter_list = NULL;
	flow->filter_list = NULL;
	if (!(flow->q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops)))
	if (!(flow->q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops,classid)))
		flow->q = &noop_qdisc;
		flow->q = &noop_qdisc;
	DPRINTK("atm_tc_change: qdisc %p\n",flow->q);
	DPRINTK("atm_tc_change: qdisc %p\n",flow->q);
	flow->sock = sock;
	flow->sock = sock;
@@ -576,7 +576,8 @@ static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)


	DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
	DPRINTK("atm_tc_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
	p->flows = &p->link;
	p->flows = &p->link;
	if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops)))
	if(!(p->link.q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops,
					   sch->handle)))
		p->link.q = &noop_qdisc;
		p->link.q = &noop_qdisc;
	DPRINTK("atm_tc_init: link (%p) qdisc %p\n",&p->link,p->link.q);
	DPRINTK("atm_tc_init: link (%p) qdisc %p\n",&p->link,p->link.q);
	p->link.filter_list = NULL;
	p->link.filter_list = NULL;
+5 −3
Original line number Original line Diff line number Diff line
@@ -1429,7 +1429,8 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
	q->link.sibling = &q->link;
	q->link.sibling = &q->link;
	q->link.classid = sch->handle;
	q->link.classid = sch->handle;
	q->link.qdisc = sch;
	q->link.qdisc = sch;
	if (!(q->link.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops)))
	if (!(q->link.q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
					    sch->handle)))
		q->link.q = &noop_qdisc;
		q->link.q = &noop_qdisc;


	q->link.priority = TC_CBQ_MAXPRIO-1;
	q->link.priority = TC_CBQ_MAXPRIO-1;
@@ -1674,7 +1675,8 @@ static int cbq_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,


	if (cl) {
	if (cl) {
		if (new == NULL) {
		if (new == NULL) {
			if ((new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops)) == NULL)
			if ((new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
						     cl->classid)) == NULL)
				return -ENOBUFS;
				return -ENOBUFS;
		} else {
		} else {
#ifdef CONFIG_NET_CLS_POLICE
#ifdef CONFIG_NET_CLS_POLICE
@@ -1932,7 +1934,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
	cl->R_tab = rtab;
	cl->R_tab = rtab;
	rtab = NULL;
	rtab = NULL;
	cl->refcnt = 1;
	cl->refcnt = 1;
	if (!(cl->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops)))
	if (!(cl->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid)))
		cl->q = &noop_qdisc;
		cl->q = &noop_qdisc;
	cl->classid = classid;
	cl->classid = classid;
	cl->tparent = parent;
	cl->tparent = parent;
+3 −2
Original line number Original line Diff line number Diff line
@@ -88,7 +88,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
		sch, p, new, old);
		sch, p, new, old);


	if (new == NULL) {
	if (new == NULL) {
		new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
		new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
					sch->handle);
		if (new == NULL)
		if (new == NULL)
			new = &noop_qdisc;
			new = &noop_qdisc;
	}
	}
@@ -387,7 +388,7 @@ static int dsmark_init(struct Qdisc *sch, struct rtattr *opt)
	p->default_index = default_index;
	p->default_index = default_index;
	p->set_tc_index = RTA_GET_FLAG(tb[TCA_DSMARK_SET_TC_INDEX-1]);
	p->set_tc_index = RTA_GET_FLAG(tb[TCA_DSMARK_SET_TC_INDEX-1]);


	p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
	p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, sch->handle);
	if (p->q == NULL)
	if (p->q == NULL)
		p->q = &noop_qdisc;
		p->q = &noop_qdisc;


+5 −2
Original line number Original line Diff line number Diff line
@@ -450,13 +450,15 @@ struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops)
	return ERR_PTR(-err);
	return ERR_PTR(-err);
}
}


struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops,
				 unsigned int parentid)
{
{
	struct Qdisc *sch;
	struct Qdisc *sch;
	
	
	sch = qdisc_alloc(dev, ops);
	sch = qdisc_alloc(dev, ops);
	if (IS_ERR(sch))
	if (IS_ERR(sch))
		goto errout;
		goto errout;
	sch->parent = parentid;


	if (!ops->init || ops->init(sch, NULL) == 0)
	if (!ops->init || ops->init(sch, NULL) == 0)
		return sch;
		return sch;
@@ -520,7 +522,8 @@ void dev_activate(struct net_device *dev)
	if (dev->qdisc_sleeping == &noop_qdisc) {
	if (dev->qdisc_sleeping == &noop_qdisc) {
		struct Qdisc *qdisc;
		struct Qdisc *qdisc;
		if (dev->tx_queue_len) {
		if (dev->tx_queue_len) {
			qdisc = qdisc_create_dflt(dev, &pfifo_fast_ops);
			qdisc = qdisc_create_dflt(dev, &pfifo_fast_ops,
						  TC_H_ROOT);
			if (qdisc == NULL) {
			if (qdisc == NULL) {
				printk(KERN_INFO "%s: activation failed\n", dev->name);
				printk(KERN_INFO "%s: activation failed\n", dev->name);
				return;
				return;
Loading