Skip to contentSkip to conversation

pkt_sched: Fix qdisc_graft WRT ingress qdisc

PATCH Applied Jarek Poplawski 3 participants 3 messages Sep 14, 2009 – Sep 15, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkt_sched: Fix qdisc_graft WRT ingress qdisc

After the recent mq change using ingress qdisc overwrites dev->qdisc; there is also a wrong old qdisc pointer passed to notify_and_destroy.

---

 net/sched/sch_api.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
net/sched/sch_api.c +10 -5
index 3af1061..c5a6d62 100644
@@ -693,13 +693,18 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 			if (new && i > 0)
 				atomic_inc(&new->refcnt);
 
-			qdisc_destroy(old);
+			if (!ingress)
+				qdisc_destroy(old);
 		}
 
-		notify_and_destroy(skb, n, classid, dev->qdisc, new);
-		if (new && !new->ops->attach)
-			atomic_inc(&new->refcnt);
-		dev->qdisc = new ? : &noop_qdisc;
+		if (!ingress) {
+			notify_and_destroy(skb, n, classid, dev->qdisc, new);
+			if (new && !new->ops->attach)
+				atomic_inc(&new->refcnt);
+			dev->qdisc = new ? : &noop_qdisc;
+		} else {
+			notify_and_destroy(skb, n, classid, old, new);
+		}
 
 		if (dev->flags & IFF_UP)
 			dev_activate(dev);
#1 lore raw
Quoted 2 lines · Jarek Poplawski

After the recent mq change using ingress qdisc overwrites dev->qdisc; there is also a wrong old qdisc pointer passed to notify_and_destroy.

Good catch, thanks.

maintainer Applied
#2 lore raw
In reply to Jarek Poplawski

From: Jarek Poplawski <[email protected]>
Date: Mon, 14 Sep 2009 08:35:44 +0000

Quoted 4 lines

After the recent mq change using ingress qdisc overwrites dev->qdisc; there is also a wrong old qdisc pointer passed to notify_and_destroy.

Applied, thanks Jarek.

When I did the original TX multiqueue changes I tried to eliminate as much as possible all of the special ways in which ingress qdiscs are handled, but this area of how the ingress qdisc pointers are updated remains.