netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netdevice: Use existing macros
@ 2009-08-30  6:21 Krishna Kumar
  2009-08-31  5:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Krishna Kumar @ 2009-08-30  6:21 UTC (permalink / raw)
  To: davem; +Cc: netdev, Krishna Kumar

From: Krishna Kumar <krkumar2@in.ibm.com>

netdevice: Consolidate to use existing macros where available.

Patch compiled and 32 simultaneous netperf testing ran fine. 

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---

 include/linux/netdevice.h |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff -ruNp org/include/linux/netdevice.h new/include/linux/netdevice.h
--- org/include/linux/netdevice.h	2009-08-29 13:53:51.000000000 +0530
+++ new/include/linux/netdevice.h	2009-08-29 13:54:07.000000000 +0530
@@ -1257,7 +1257,7 @@ static inline void netif_tx_wake_queue(s
 {
 #ifdef CONFIG_NETPOLL_TRAP
 	if (netpoll_trap()) {
-		clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
+		netif_tx_start_queue(dev_queue);
 		return;
 	}
 #endif
@@ -1363,7 +1363,8 @@ static inline int netif_running(const st
 static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
 {
 	struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
-	clear_bit(__QUEUE_STATE_XOFF, &txq->state);
+
+	netif_tx_start_queue(txq);
 }
 
 /**
@@ -1380,7 +1381,7 @@ static inline void netif_stop_subqueue(s
 	if (netpoll_trap())
 		return;
 #endif
-	set_bit(__QUEUE_STATE_XOFF, &txq->state);
+	netif_tx_stop_queue(txq);
 }
 
 /**
@@ -1394,7 +1395,8 @@ static inline int __netif_subqueue_stopp
 					 u16 queue_index)
 {
 	struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
-	return test_bit(__QUEUE_STATE_XOFF, &txq->state);
+
+	return netif_tx_queue_stopped(txq);
 }
 
 static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1746,8 +1748,7 @@ static inline void netif_tx_unlock(struc
 		 * force a schedule.
 		 */
 		clear_bit(__QUEUE_STATE_FROZEN, &txq->state);
-		if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
-			__netif_schedule(txq->qdisc);
+		netif_schedule_queue(txq);
 	}
 	spin_unlock(&dev->tx_global_lock);
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netdevice: Use existing macros
  2009-08-30  6:21 [PATCH] netdevice: Use existing macros Krishna Kumar
@ 2009-08-31  5:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-08-31  5:15 UTC (permalink / raw)
  To: krkumar2; +Cc: netdev

From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Sun, 30 Aug 2009 11:51:21 +0530

> From: Krishna Kumar <krkumar2@in.ibm.com>
> 
> netdevice: Consolidate to use existing macros where available.
> 
> Patch compiled and 32 simultaneous netperf testing ran fine. 
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-31  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-30  6:21 [PATCH] netdevice: Use existing macros Krishna Kumar
2009-08-31  5:15 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).