aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-11-23 05:42:02 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-28 13:47:18 -0500
commit5a0d2268d259886f0c87131639d19eb4a67b4532 (patch)
tree952e6225fcee027f3a4ae8e1c2b2c889eff3a8b2 /include/linux/netdevice.h
parentd3c15cab213becc49a6f2ad7f48a59513a5f17dd (diff)
net: add netif_tx_queue_frozen_or_stopped
When testing struct netdev_queue state against FROZEN bit, we also test XOFF bit. We can test both bits at once and save some cycles. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index badf9285fe0d..7c6ae2f4b9ab 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -493,6 +493,8 @@ static inline void napi_synchronize(const struct napi_struct *n)
493enum netdev_queue_state_t { 493enum netdev_queue_state_t {
494 __QUEUE_STATE_XOFF, 494 __QUEUE_STATE_XOFF,
495 __QUEUE_STATE_FROZEN, 495 __QUEUE_STATE_FROZEN,
496#define QUEUE_STATE_XOFF_OR_FROZEN ((1 << __QUEUE_STATE_XOFF) | \
497 (1 << __QUEUE_STATE_FROZEN))
496}; 498};
497 499
498struct netdev_queue { 500struct netdev_queue {
@@ -1629,9 +1631,9 @@ static inline int netif_queue_stopped(const struct net_device *dev)
1629 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); 1631 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1630} 1632}
1631 1633
1632static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) 1634static inline int netif_tx_queue_frozen_or_stopped(const struct netdev_queue *dev_queue)
1633{ 1635{
1634 return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); 1636 return dev_queue->state & QUEUE_STATE_XOFF_OR_FROZEN;
1635} 1637}
1636 1638
1637/** 1639/**