aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netdev_features.h2
-rw-r--r--include/linux/netdevice.h24
2 files changed, 21 insertions, 5 deletions
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 5a09a48f2658..c26d0ec2ef3a 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -63,6 +63,7 @@ enum {
63 NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */ 63 NETIF_F_HW_VLAN_STAG_RX_BIT, /* Receive VLAN STAG HW acceleration */
64 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */ 64 NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
65 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */ 65 NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
66 NETIF_F_BUSY_POLL_BIT, /* Busy poll */
66 67
67 /* 68 /*
68 * Add your fresh new feature above and remember to update 69 * Add your fresh new feature above and remember to update
@@ -118,6 +119,7 @@ enum {
118#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) 119#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX)
119#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 120#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
120#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) 121#define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
122#define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
121 123
122/* Features valid for ethtool to change */ 124/* Features valid for ethtool to change */
123/* = all defined minus driver/device-class-related */ 125/* = all defined minus driver/device-class-related */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 775cc956ff78..7ed3a3aa6604 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -519,11 +519,18 @@ enum netdev_queue_state_t {
519 __QUEUE_STATE_DRV_XOFF, 519 __QUEUE_STATE_DRV_XOFF,
520 __QUEUE_STATE_STACK_XOFF, 520 __QUEUE_STATE_STACK_XOFF,
521 __QUEUE_STATE_FROZEN, 521 __QUEUE_STATE_FROZEN,
522#define QUEUE_STATE_ANY_XOFF ((1 << __QUEUE_STATE_DRV_XOFF) | \
523 (1 << __QUEUE_STATE_STACK_XOFF))
524#define QUEUE_STATE_ANY_XOFF_OR_FROZEN (QUEUE_STATE_ANY_XOFF | \
525 (1 << __QUEUE_STATE_FROZEN))
526}; 522};
523
524#define QUEUE_STATE_DRV_XOFF (1 << __QUEUE_STATE_DRV_XOFF)
525#define QUEUE_STATE_STACK_XOFF (1 << __QUEUE_STATE_STACK_XOFF)
526#define QUEUE_STATE_FROZEN (1 << __QUEUE_STATE_FROZEN)
527
528#define QUEUE_STATE_ANY_XOFF (QUEUE_STATE_DRV_XOFF | QUEUE_STATE_STACK_XOFF)
529#define QUEUE_STATE_ANY_XOFF_OR_FROZEN (QUEUE_STATE_ANY_XOFF | \
530 QUEUE_STATE_FROZEN)
531#define QUEUE_STATE_DRV_XOFF_OR_FROZEN (QUEUE_STATE_DRV_XOFF | \
532 QUEUE_STATE_FROZEN)
533
527/* 534/*
528 * __QUEUE_STATE_DRV_XOFF is used by drivers to stop the transmit queue. The 535 * __QUEUE_STATE_DRV_XOFF is used by drivers to stop the transmit queue. The
529 * netif_tx_* functions below are used to manipulate this flag. The 536 * netif_tx_* functions below are used to manipulate this flag. The
@@ -2252,11 +2259,18 @@ static inline bool netif_xmit_stopped(const struct netdev_queue *dev_queue)
2252 return dev_queue->state & QUEUE_STATE_ANY_XOFF; 2259 return dev_queue->state & QUEUE_STATE_ANY_XOFF;
2253} 2260}
2254 2261
2255static inline bool netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue) 2262static inline bool
2263netif_xmit_frozen_or_stopped(const struct netdev_queue *dev_queue)
2256{ 2264{
2257 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN; 2265 return dev_queue->state & QUEUE_STATE_ANY_XOFF_OR_FROZEN;
2258} 2266}
2259 2267
2268static inline bool
2269netif_xmit_frozen_or_drv_stopped(const struct netdev_queue *dev_queue)
2270{
2271 return dev_queue->state & QUEUE_STATE_DRV_XOFF_OR_FROZEN;
2272}
2273
2260static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, 2274static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
2261 unsigned int bytes) 2275 unsigned int bytes)
2262{ 2276{