提交 db582944 编写于 作者: J Jesse Brandeburg 提交者: Jeff Garzik

ixgb: remove lltx support and update tx routine

a) kernel developers suggest LLTX is broken and unsafe to use, remove it.
b) remember to pre-stop the queue if we won't have room
c) removing lltx means we can remove our tx lock
Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 12579697
...@@ -157,7 +157,6 @@ struct ixgb_adapter { ...@@ -157,7 +157,6 @@ struct ixgb_adapter {
u32 part_num; u32 part_num;
u16 link_speed; u16 link_speed;
u16 link_duplex; u16 link_duplex;
spinlock_t tx_lock;
struct work_struct tx_timeout_task; struct work_struct tx_timeout_task;
struct timer_list blink_timer; struct timer_list blink_timer;
......
...@@ -448,9 +448,6 @@ ixgb_probe(struct pci_dev *pdev, ...@@ -448,9 +448,6 @@ ixgb_probe(struct pci_dev *pdev,
NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER; NETIF_F_HW_VLAN_FILTER;
netdev->features |= NETIF_F_TSO; netdev->features |= NETIF_F_TSO;
#ifdef NETIF_F_LLTX
netdev->features |= NETIF_F_LLTX;
#endif
if(pci_using_dac) if(pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HIGHDMA;
...@@ -577,8 +574,6 @@ ixgb_sw_init(struct ixgb_adapter *adapter) ...@@ -577,8 +574,6 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
/* enable flow control to be programmed */ /* enable flow control to be programmed */
hw->fc.send_xon = 1; hw->fc.send_xon = 1;
spin_lock_init(&adapter->tx_lock);
set_bit(__IXGB_DOWN, &adapter->flags); set_bit(__IXGB_DOWN, &adapter->flags);
return 0; return 0;
} }
...@@ -1441,7 +1436,6 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1441,7 +1436,6 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
struct ixgb_adapter *adapter = netdev_priv(netdev); struct ixgb_adapter *adapter = netdev_priv(netdev);
unsigned int first; unsigned int first;
unsigned int tx_flags = 0; unsigned int tx_flags = 0;
unsigned long flags;
int vlan_id = 0; int vlan_id = 0;
int tso; int tso;
...@@ -1455,26 +1449,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1455,26 +1449,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return 0; return 0;
} }
#ifdef NETIF_F_LLTX
if (!spin_trylock_irqsave(&adapter->tx_lock, flags)) {
/* Collision - tell upper layer to requeue */
local_irq_restore(flags);
return NETDEV_TX_LOCKED;
}
#else
spin_lock_irqsave(&adapter->tx_lock, flags);
#endif
if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring,
DESC_NEEDED))) { DESC_NEEDED)))
netif_stop_queue(netdev);
spin_unlock_irqrestore(&adapter->tx_lock, flags);
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
}
#ifndef NETIF_F_LLTX
spin_unlock_irqrestore(&adapter->tx_lock, flags);
#endif
if(adapter->vlgrp && vlan_tx_tag_present(skb)) { if(adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= IXGB_TX_FLAGS_VLAN; tx_flags |= IXGB_TX_FLAGS_VLAN;
...@@ -1486,9 +1463,6 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1486,9 +1463,6 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tso = ixgb_tso(adapter, skb); tso = ixgb_tso(adapter, skb);
if (tso < 0) { if (tso < 0) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
#ifdef NETIF_F_LLTX
spin_unlock_irqrestore(&adapter->tx_lock, flags);
#endif
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -1502,13 +1476,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) ...@@ -1502,13 +1476,9 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
netdev->trans_start = jiffies; netdev->trans_start = jiffies;
#ifdef NETIF_F_LLTX
/* Make sure there is space in the ring for the next send. */ /* Make sure there is space in the ring for the next send. */
ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED); ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED);
spin_unlock_irqrestore(&adapter->tx_lock, flags);
#endif
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册