Commit 696701b8 authored by David S. Miller's avatar David S. Miller

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates

This series contains updates to igb, e1000 and ixgbe.

Akeem provides a igb fix where WOL was being reported as supported on
some ethernet devices which did not have that capability.

Yanjun provides a fix for e1000 which is similar to a previous fix
for e1000e commit bb9e44d0 ("e1000e: prevent oops when adapter is
being closed and reset simultaneously"), where the same issue was
observed on the older e1000 cards.

Vladimir Davydov provides 2 e1000 fixes.  The first fixes a lockdep
warning e1000_down() tries to synchronously cancel e1000 auxiliary
works (reset_task, watchdog_task, phy_info_task and fifo_stall_task)
which take adapter->mutex in their handlers.  The second patch is to
fix a possible race condition where reset_task() would be running
after adapter down.

John provides 2 fixes for ixgbe.  First turns ixgbe_fwd_ring_down
to static and the second disables NETIF_F_HW_L2FW_DOFFLOAD by default
because it allows upper layer net devices to use queues in the hardware
to directly submit and receive skbs.

Mark Rustad provides a single patch for ixgbe to make
ixgbe_identify_qsfp_module_generic static to resolve compile
warnings.

v2: Drop igb patch "igb: Update queue reinit function to call dev_close
    when init of queues fails" from Carolyn, so that the solution can
    be re-worked based on feedback from David Miller.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f1d8cba6 88217547
...@@ -83,6 +83,11 @@ struct e1000_adapter; ...@@ -83,6 +83,11 @@ struct e1000_adapter;
#define E1000_MAX_INTR 10 #define E1000_MAX_INTR 10
/*
* Count for polling __E1000_RESET condition every 10-20msec.
*/
#define E1000_CHECK_RESET_COUNT 50
/* TX/RX descriptor defines */ /* TX/RX descriptor defines */
#define E1000_DEFAULT_TXD 256 #define E1000_DEFAULT_TXD 256
#define E1000_MAX_TXD 256 #define E1000_MAX_TXD 256
...@@ -312,8 +317,6 @@ struct e1000_adapter { ...@@ -312,8 +317,6 @@ struct e1000_adapter {
struct delayed_work watchdog_task; struct delayed_work watchdog_task;
struct delayed_work fifo_stall_task; struct delayed_work fifo_stall_task;
struct delayed_work phy_info_task; struct delayed_work phy_info_task;
struct mutex mutex;
}; };
enum e1000_state_t { enum e1000_state_t {
......
...@@ -494,13 +494,20 @@ static void e1000_down_and_stop(struct e1000_adapter *adapter) ...@@ -494,13 +494,20 @@ static void e1000_down_and_stop(struct e1000_adapter *adapter)
{ {
set_bit(__E1000_DOWN, &adapter->flags); set_bit(__E1000_DOWN, &adapter->flags);
/* Only kill reset task if adapter is not resetting */
if (!test_bit(__E1000_RESETTING, &adapter->flags))
cancel_work_sync(&adapter->reset_task);
cancel_delayed_work_sync(&adapter->watchdog_task); cancel_delayed_work_sync(&adapter->watchdog_task);
/*
* Since the watchdog task can reschedule other tasks, we should cancel
* it first, otherwise we can run into the situation when a work is
* still running after the adapter has been turned down.
*/
cancel_delayed_work_sync(&adapter->phy_info_task); cancel_delayed_work_sync(&adapter->phy_info_task);
cancel_delayed_work_sync(&adapter->fifo_stall_task); cancel_delayed_work_sync(&adapter->fifo_stall_task);
/* Only kill reset task if adapter is not resetting */
if (!test_bit(__E1000_RESETTING, &adapter->flags))
cancel_work_sync(&adapter->reset_task);
} }
void e1000_down(struct e1000_adapter *adapter) void e1000_down(struct e1000_adapter *adapter)
...@@ -544,21 +551,8 @@ void e1000_down(struct e1000_adapter *adapter) ...@@ -544,21 +551,8 @@ void e1000_down(struct e1000_adapter *adapter)
e1000_clean_all_rx_rings(adapter); e1000_clean_all_rx_rings(adapter);
} }
static void e1000_reinit_safe(struct e1000_adapter *adapter)
{
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
msleep(1);
mutex_lock(&adapter->mutex);
e1000_down(adapter);
e1000_up(adapter);
mutex_unlock(&adapter->mutex);
clear_bit(__E1000_RESETTING, &adapter->flags);
}
void e1000_reinit_locked(struct e1000_adapter *adapter) void e1000_reinit_locked(struct e1000_adapter *adapter)
{ {
/* if rtnl_lock is not held the call path is bogus */
ASSERT_RTNL();
WARN_ON(in_interrupt()); WARN_ON(in_interrupt());
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
msleep(1); msleep(1);
...@@ -1316,7 +1310,6 @@ static int e1000_sw_init(struct e1000_adapter *adapter) ...@@ -1316,7 +1310,6 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
e1000_irq_disable(adapter); e1000_irq_disable(adapter);
spin_lock_init(&adapter->stats_lock); spin_lock_init(&adapter->stats_lock);
mutex_init(&adapter->mutex);
set_bit(__E1000_DOWN, &adapter->flags); set_bit(__E1000_DOWN, &adapter->flags);
...@@ -1440,6 +1433,10 @@ static int e1000_close(struct net_device *netdev) ...@@ -1440,6 +1433,10 @@ static int e1000_close(struct net_device *netdev)
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
int count = E1000_CHECK_RESET_COUNT;
while (test_bit(__E1000_RESETTING, &adapter->flags) && count--)
usleep_range(10000, 20000);
WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
e1000_down(adapter); e1000_down(adapter);
...@@ -2325,11 +2322,8 @@ static void e1000_update_phy_info_task(struct work_struct *work) ...@@ -2325,11 +2322,8 @@ static void e1000_update_phy_info_task(struct work_struct *work)
struct e1000_adapter *adapter = container_of(work, struct e1000_adapter *adapter = container_of(work,
struct e1000_adapter, struct e1000_adapter,
phy_info_task.work); phy_info_task.work);
if (test_bit(__E1000_DOWN, &adapter->flags))
return;
mutex_lock(&adapter->mutex);
e1000_phy_get_info(&adapter->hw, &adapter->phy_info); e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
mutex_unlock(&adapter->mutex);
} }
/** /**
...@@ -2345,9 +2339,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work) ...@@ -2345,9 +2339,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work)
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
u32 tctl; u32 tctl;
if (test_bit(__E1000_DOWN, &adapter->flags))
return;
mutex_lock(&adapter->mutex);
if (atomic_read(&adapter->tx_fifo_stall)) { if (atomic_read(&adapter->tx_fifo_stall)) {
if ((er32(TDT) == er32(TDH)) && if ((er32(TDT) == er32(TDH)) &&
(er32(TDFT) == er32(TDFH)) && (er32(TDFT) == er32(TDFH)) &&
...@@ -2368,7 +2359,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work) ...@@ -2368,7 +2359,6 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work)
schedule_delayed_work(&adapter->fifo_stall_task, 1); schedule_delayed_work(&adapter->fifo_stall_task, 1);
} }
} }
mutex_unlock(&adapter->mutex);
} }
bool e1000_has_link(struct e1000_adapter *adapter) bool e1000_has_link(struct e1000_adapter *adapter)
...@@ -2422,10 +2412,6 @@ static void e1000_watchdog(struct work_struct *work) ...@@ -2422,10 +2412,6 @@ static void e1000_watchdog(struct work_struct *work)
struct e1000_tx_ring *txdr = adapter->tx_ring; struct e1000_tx_ring *txdr = adapter->tx_ring;
u32 link, tctl; u32 link, tctl;
if (test_bit(__E1000_DOWN, &adapter->flags))
return;
mutex_lock(&adapter->mutex);
link = e1000_has_link(adapter); link = e1000_has_link(adapter);
if ((netif_carrier_ok(netdev)) && link) if ((netif_carrier_ok(netdev)) && link)
goto link_up; goto link_up;
...@@ -2516,7 +2502,7 @@ static void e1000_watchdog(struct work_struct *work) ...@@ -2516,7 +2502,7 @@ static void e1000_watchdog(struct work_struct *work)
adapter->tx_timeout_count++; adapter->tx_timeout_count++;
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
/* exit immediately since reset is imminent */ /* exit immediately since reset is imminent */
goto unlock; return;
} }
} }
...@@ -2544,9 +2530,6 @@ static void e1000_watchdog(struct work_struct *work) ...@@ -2544,9 +2530,6 @@ static void e1000_watchdog(struct work_struct *work)
/* Reschedule the task */ /* Reschedule the task */
if (!test_bit(__E1000_DOWN, &adapter->flags)) if (!test_bit(__E1000_DOWN, &adapter->flags))
schedule_delayed_work(&adapter->watchdog_task, 2 * HZ); schedule_delayed_work(&adapter->watchdog_task, 2 * HZ);
unlock:
mutex_unlock(&adapter->mutex);
} }
enum latency_range { enum latency_range {
...@@ -3495,10 +3478,8 @@ static void e1000_reset_task(struct work_struct *work) ...@@ -3495,10 +3478,8 @@ static void e1000_reset_task(struct work_struct *work)
struct e1000_adapter *adapter = struct e1000_adapter *adapter =
container_of(work, struct e1000_adapter, reset_task); container_of(work, struct e1000_adapter, reset_task);
if (test_bit(__E1000_DOWN, &adapter->flags))
return;
e_err(drv, "Reset adapter\n"); e_err(drv, "Reset adapter\n");
e1000_reinit_safe(adapter); e1000_reinit_locked(adapter);
} }
/** /**
...@@ -4963,6 +4944,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) ...@@ -4963,6 +4944,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
netif_device_detach(netdev); netif_device_detach(netdev);
if (netif_running(netdev)) { if (netif_running(netdev)) {
int count = E1000_CHECK_RESET_COUNT;
while (test_bit(__E1000_RESETTING, &adapter->flags) && count--)
usleep_range(10000, 20000);
WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags)); WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
e1000_down(adapter); e1000_down(adapter);
} }
......
...@@ -2062,14 +2062,15 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) ...@@ -2062,14 +2062,15 @@ static void igb_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{ {
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
wol->supported = WAKE_UCAST | WAKE_MCAST |
WAKE_BCAST | WAKE_MAGIC |
WAKE_PHY;
wol->wolopts = 0; wol->wolopts = 0;
if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED)) if (!(adapter->flags & IGB_FLAG_WOL_SUPPORTED))
return; return;
wol->supported = WAKE_UCAST | WAKE_MCAST |
WAKE_BCAST | WAKE_MAGIC |
WAKE_PHY;
/* apply any specific unsupported masks here */ /* apply any specific unsupported masks here */
switch (adapter->hw.device_id) { switch (adapter->hw.device_id) {
default: default:
......
...@@ -4251,8 +4251,8 @@ static void ixgbe_disable_fwd_ring(struct ixgbe_fwd_adapter *vadapter, ...@@ -4251,8 +4251,8 @@ static void ixgbe_disable_fwd_ring(struct ixgbe_fwd_adapter *vadapter,
rx_ring->l2_accel_priv = NULL; rx_ring->l2_accel_priv = NULL;
} }
int ixgbe_fwd_ring_down(struct net_device *vdev, static int ixgbe_fwd_ring_down(struct net_device *vdev,
struct ixgbe_fwd_adapter *accel) struct ixgbe_fwd_adapter *accel)
{ {
struct ixgbe_adapter *adapter = accel->real_adapter; struct ixgbe_adapter *adapter = accel->real_adapter;
unsigned int rxbase = accel->rx_base_queue; unsigned int rxbase = accel->rx_base_queue;
...@@ -7986,10 +7986,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7986,10 +7986,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
NETIF_F_TSO | NETIF_F_TSO |
NETIF_F_TSO6 | NETIF_F_TSO6 |
NETIF_F_RXHASH | NETIF_F_RXHASH |
NETIF_F_RXCSUM | NETIF_F_RXCSUM;
NETIF_F_HW_L2FW_DOFFLOAD;
netdev->hw_features = netdev->features; netdev->hw_features = netdev->features | NETIF_F_HW_L2FW_DOFFLOAD;
switch (adapter->hw.mac.type) { switch (adapter->hw.mac.type) {
case ixgbe_mac_82599EB: case ixgbe_mac_82599EB:
......
...@@ -46,6 +46,7 @@ static bool ixgbe_get_i2c_data(u32 *i2cctl); ...@@ -46,6 +46,7 @@ static bool ixgbe_get_i2c_data(u32 *i2cctl);
static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw); static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw);
static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id);
static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); static s32 ixgbe_get_phy_id(struct ixgbe_hw *hw);
static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw);
/** /**
* ixgbe_identify_phy_generic - Get physical layer module * ixgbe_identify_phy_generic - Get physical layer module
...@@ -1164,7 +1165,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) ...@@ -1164,7 +1165,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
* *
* Searches for and identifies the QSFP module and assigns appropriate PHY type * Searches for and identifies the QSFP module and assigns appropriate PHY type
**/ **/
s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) static s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw)
{ {
struct ixgbe_adapter *adapter = hw->back; struct ixgbe_adapter *adapter = hw->back;
s32 status = IXGBE_ERR_PHY_ADDR_INVALID; s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
......
...@@ -145,7 +145,6 @@ s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw, ...@@ -145,7 +145,6 @@ s32 ixgbe_get_phy_firmware_version_generic(struct ixgbe_hw *hw,
s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw); s32 ixgbe_reset_phy_nl(struct ixgbe_hw *hw);
s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw); s32 ixgbe_identify_module_generic(struct ixgbe_hw *hw);
s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw); s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw);
s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw);
s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
u16 *list_offset, u16 *list_offset,
u16 *data_offset); u16 *data_offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment