Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

e1000: drop lltx, remove unnecessary lock

LLTX is deprecated, don't use it. This completes the removal of LLTX from
the Intel Network drivers.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexander Duyck and committed by
David S. Miller
8017943e 921aa749

+3 -28
-2
drivers/net/e1000/e1000.h
··· 182 182 /* array of buffer information structs */ 183 183 struct e1000_buffer *buffer_info; 184 184 185 - spinlock_t tx_lock; 186 185 u16 tdh; 187 186 u16 tdt; 188 187 bool last_tx_tso; ··· 237 238 u16 link_speed; 238 239 u16 link_duplex; 239 240 spinlock_t stats_lock; 240 - spinlock_t tx_queue_lock; 241 241 unsigned int total_tx_bytes; 242 242 unsigned int total_tx_packets; 243 243 unsigned int total_rx_bytes;
+3 -26
drivers/net/e1000/e1000_main.c
··· 31 31 32 32 char e1000_driver_name[] = "e1000"; 33 33 static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; 34 - #define DRV_VERSION "7.3.20-k3-NAPI" 34 + #define DRV_VERSION "7.3.21-k2-NAPI" 35 35 const char e1000_driver_version[] = DRV_VERSION; 36 36 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; 37 37 ··· 1048 1048 if (pci_using_dac) 1049 1049 netdev->features |= NETIF_F_HIGHDMA; 1050 1050 1051 - netdev->features |= NETIF_F_LLTX; 1052 - 1053 1051 netdev->vlan_features |= NETIF_F_TSO; 1054 1052 netdev->vlan_features |= NETIF_F_TSO6; 1055 1053 netdev->vlan_features |= NETIF_F_HW_CSUM; ··· 1366 1368 return -ENOMEM; 1367 1369 } 1368 1370 1369 - spin_lock_init(&adapter->tx_queue_lock); 1370 - 1371 1371 /* Explicitly disable IRQ since the NIC can be in any state. */ 1372 1372 e1000_irq_disable(adapter); 1373 1373 ··· 1620 1624 1621 1625 txdr->next_to_use = 0; 1622 1626 txdr->next_to_clean = 0; 1623 - spin_lock_init(&txdr->tx_lock); 1624 1627 1625 1628 return 0; 1626 1629 } ··· 3180 3185 unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; 3181 3186 unsigned int tx_flags = 0; 3182 3187 unsigned int len = skb->len - skb->data_len; 3183 - unsigned long flags; 3184 3188 unsigned int nr_frags; 3185 3189 unsigned int mss; 3186 3190 int count = 0; ··· 3284 3290 (hw->mac_type == e1000_82573)) 3285 3291 e1000_transfer_dhcp_info(adapter, skb); 3286 3292 3287 - if (!spin_trylock_irqsave(&tx_ring->tx_lock, flags)) 3288 - /* Collision - tell upper layer to requeue */ 3289 - return NETDEV_TX_LOCKED; 3290 - 3291 3293 /* need: count + 2 desc gap to keep tail from touching 3292 3294 * head, otherwise try next time */ 3293 - if (unlikely(e1000_maybe_stop_tx(netdev, tx_ring, count + 2))) { 3294 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 3295 + if (unlikely(e1000_maybe_stop_tx(netdev, tx_ring, count + 2))) 3295 3296 return NETDEV_TX_BUSY; 3296 - } 3297 3297 3298 3298 if (unlikely(hw->mac_type == e1000_82547)) { 3299 3299 if (unlikely(e1000_82547_fifo_workaround(adapter, skb))) { 3300 3300 netif_stop_queue(netdev); 3301 3301 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1); 3302 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 3303 3302 return NETDEV_TX_BUSY; 3304 3303 } 3305 3304 } ··· 3307 3320 tso = e1000_tso(adapter, tx_ring, skb); 3308 3321 if (tso < 0) { 3309 3322 dev_kfree_skb_any(skb); 3310 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 3311 3323 return NETDEV_TX_OK; 3312 3324 } 3313 3325 ··· 3331 3345 /* Make sure there is space in the ring for the next send. */ 3332 3346 e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2); 3333 3347 3334 - spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 3335 3348 return NETDEV_TX_OK; 3336 3349 } 3337 3350 ··· 3758 3773 3759 3774 adapter = netdev_priv(poll_dev); 3760 3775 3761 - /* e1000_clean is called per-cpu. This lock protects 3762 - * tx_ring[0] from being cleaned by multiple cpus 3763 - * simultaneously. A failure obtaining the lock means 3764 - * tx_ring[0] is currently being cleaned anyway. */ 3765 - if (spin_trylock(&adapter->tx_queue_lock)) { 3766 - tx_cleaned = e1000_clean_tx_irq(adapter, 3767 - &adapter->tx_ring[0]); 3768 - spin_unlock(&adapter->tx_queue_lock); 3769 - } 3776 + tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[0]); 3770 3777 3771 3778 adapter->clean_rx(adapter, &adapter->rx_ring[0], 3772 3779 &work_done, budget);