Re: [PATCH]: Schedule correct qdisc in watchdog.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jarek Poplawski
Date: Monday, August 18, 2008 - 8:55 am

Denys Fedoryshchenko wrote, On 08/18/2008 02:45 PM:

...

Alas I can't find anything better for this than the previous patch
named "03-fix_patch_2.patch" in your repository. I attach it below
for any case (apply after all you currently had - there will be a
little offset warning while patching). Alternatively, you can wait
for David's opinion.

Jarek P.

---

 include/linux/netdevice.h |    1 +
 include/net/sch_generic.h |    5 ++++-
 net/core/dev.c            |    1 +
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 488c56e..7041c2c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -445,6 +445,7 @@ struct netdev_queue {
 	struct net_device	*dev;
 	struct Qdisc		*qdisc;
 	unsigned long		state;
+	spinlock_t		qdisc_lock;
 	spinlock_t		_xmit_lock;
 	int			xmit_lock_owner;
 	struct Qdisc		*qdisc_sleeping;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a7abfda..f84e96c 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -185,7 +185,10 @@ static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
 
 static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
 {
-	return &qdisc->q.lock;
+	if (unlikely(qdisc->flags & TCQ_F_BUILTIN))
+		return &qdisc->q.lock;
+
+	return &qdisc->dev_queue->qdisc_lock;
 }
 
 static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc)
diff --git a/net/core/dev.c b/net/core/dev.c
index 600bb23..9ec20e0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3859,6 +3859,7 @@ static void __netdev_init_queue_locks_one(struct net_device *dev,
 					  void *_unused)
 {
 	spin_lock_init(&dev_queue->_xmit_lock);
+	spin_lock_init(&dev_queue->qdisc_lock);
 	netdev_set_xmit_lockdep_class(&dev_queue->_xmit_lock, dev->type);
 	dev_queue->xmit_lock_owner = -1;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 1:39 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 2:10 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 2:31 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 2:47 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 3:10 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 3:35 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 3:43 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Denys Fedoryshchenko, (Mon Aug 18, 4:04 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 4:06 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 4:20 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 4:35 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Denys Fedoryshchenko, (Mon Aug 18, 5:45 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 5:58 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 8:55 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., Denys Fedoryshchenko, (Mon Aug 18, 11:05 am)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 4:56 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 8:51 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 8:54 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 9:08 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 10:37 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Mon Aug 18, 10:39 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 10:42 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., Jarek Poplawski, (Mon Aug 18, 11:59 pm)
Re: [PATCH]: Schedule correct qdisc in watchdog., David Miller, (Tue Aug 19, 12:03 am)