aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index de387c5400b3..96964fb7478b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1265,10 +1265,15 @@ static inline void netif_rx_complete(struct net_device *dev,
1265 * 1265 *
1266 * Get network device transmit lock 1266 * Get network device transmit lock
1267 */ 1267 */
1268static inline void netif_tx_lock(struct net_device *dev) 1268static inline void __netif_tx_lock(struct net_device *dev, int cpu)
1269{ 1269{
1270 spin_lock(&dev->_xmit_lock); 1270 spin_lock(&dev->_xmit_lock);
1271 dev->xmit_lock_owner = smp_processor_id(); 1271 dev->xmit_lock_owner = cpu;
1272}
1273
1274static inline void netif_tx_lock(struct net_device *dev)
1275{
1276 __netif_tx_lock(dev, smp_processor_id());
1272} 1277}
1273 1278
1274static inline void netif_tx_lock_bh(struct net_device *dev) 1279static inline void netif_tx_lock_bh(struct net_device *dev)
@@ -1297,6 +1302,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
1297 spin_unlock_bh(&dev->_xmit_lock); 1302 spin_unlock_bh(&dev->_xmit_lock);
1298} 1303}
1299 1304
1305#define HARD_TX_LOCK(dev, cpu) { \
1306 if ((dev->features & NETIF_F_LLTX) == 0) { \
1307 __netif_tx_lock(dev, cpu); \
1308 } \
1309}
1310
1311#define HARD_TX_UNLOCK(dev) { \
1312 if ((dev->features & NETIF_F_LLTX) == 0) { \
1313 netif_tx_unlock(dev); \
1314 } \
1315}
1316
1300static inline void netif_tx_disable(struct net_device *dev) 1317static inline void netif_tx_disable(struct net_device *dev)
1301{ 1318{
1302 netif_tx_lock_bh(dev); 1319 netif_tx_lock_bh(dev);