diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2012-04-17 00:29:34 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-05-03 05:37:20 -0400 |
commit | 795180d8bf9285bf2308123c21ea59ebc6dcefa2 (patch) | |
tree | fc90954d81701a6cc67b52aa3411b89618b19b39 | |
parent | 31a1b3758e41d225695222793e5947e13ddcaba2 (diff) |
ixgbevf: Make sure jumbo frames are set correctly after PF reset
If the Physical Function (PF) resets after the VF has set jumbo
frame MTU then the VF jumbo frame is overwritten. Make sure the
VF driver always requests proper MTU size after reset
synchronization.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h index dfed420a1bf6..0a1b99240d43 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | |||
@@ -287,7 +287,7 @@ extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops; | |||
287 | extern const char ixgbevf_driver_name[]; | 287 | extern const char ixgbevf_driver_name[]; |
288 | extern const char ixgbevf_driver_version[]; | 288 | extern const char ixgbevf_driver_version[]; |
289 | 289 | ||
290 | extern int ixgbevf_up(struct ixgbevf_adapter *adapter); | 290 | extern void ixgbevf_up(struct ixgbevf_adapter *adapter); |
291 | extern void ixgbevf_down(struct ixgbevf_adapter *adapter); | 291 | extern void ixgbevf_down(struct ixgbevf_adapter *adapter); |
292 | extern void ixgbevf_reinit_locked(struct ixgbevf_adapter *adapter); | 292 | extern void ixgbevf_reinit_locked(struct ixgbevf_adapter *adapter); |
293 | extern void ixgbevf_reset(struct ixgbevf_adapter *adapter); | 293 | extern void ixgbevf_reset(struct ixgbevf_adapter *adapter); |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 307611ae831d..5a0e22830463 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1608,13 +1608,14 @@ static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) | |||
1608 | adapter->stats.base_vfmprc = adapter->stats.last_vfmprc; | 1608 | adapter->stats.base_vfmprc = adapter->stats.last_vfmprc; |
1609 | } | 1609 | } |
1610 | 1610 | ||
1611 | static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | 1611 | static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) |
1612 | { | 1612 | { |
1613 | struct net_device *netdev = adapter->netdev; | 1613 | struct net_device *netdev = adapter->netdev; |
1614 | struct ixgbe_hw *hw = &adapter->hw; | 1614 | struct ixgbe_hw *hw = &adapter->hw; |
1615 | int i, j = 0; | 1615 | int i, j = 0; |
1616 | int num_rx_rings = adapter->num_rx_queues; | 1616 | int num_rx_rings = adapter->num_rx_queues; |
1617 | u32 txdctl, rxdctl; | 1617 | u32 txdctl, rxdctl; |
1618 | u32 msg[2]; | ||
1618 | 1619 | ||
1619 | for (i = 0; i < adapter->num_tx_queues; i++) { | 1620 | for (i = 0; i < adapter->num_tx_queues; i++) { |
1620 | j = adapter->tx_ring[i].reg_idx; | 1621 | j = adapter->tx_ring[i].reg_idx; |
@@ -1653,6 +1654,10 @@ static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | |||
1653 | hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0); | 1654 | hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0); |
1654 | } | 1655 | } |
1655 | 1656 | ||
1657 | msg[0] = IXGBE_VF_SET_LPE; | ||
1658 | msg[1] = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; | ||
1659 | hw->mbx.ops.write_posted(hw, msg, 2); | ||
1660 | |||
1656 | clear_bit(__IXGBEVF_DOWN, &adapter->state); | 1661 | clear_bit(__IXGBEVF_DOWN, &adapter->state); |
1657 | ixgbevf_napi_enable_all(adapter); | 1662 | ixgbevf_napi_enable_all(adapter); |
1658 | 1663 | ||
@@ -1667,24 +1672,20 @@ static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | |||
1667 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 1672 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
1668 | adapter->link_check_timeout = jiffies; | 1673 | adapter->link_check_timeout = jiffies; |
1669 | mod_timer(&adapter->watchdog_timer, jiffies); | 1674 | mod_timer(&adapter->watchdog_timer, jiffies); |
1670 | return 0; | ||
1671 | } | 1675 | } |
1672 | 1676 | ||
1673 | int ixgbevf_up(struct ixgbevf_adapter *adapter) | 1677 | void ixgbevf_up(struct ixgbevf_adapter *adapter) |
1674 | { | 1678 | { |
1675 | int err; | ||
1676 | struct ixgbe_hw *hw = &adapter->hw; | 1679 | struct ixgbe_hw *hw = &adapter->hw; |
1677 | 1680 | ||
1678 | ixgbevf_configure(adapter); | 1681 | ixgbevf_configure(adapter); |
1679 | 1682 | ||
1680 | err = ixgbevf_up_complete(adapter); | 1683 | ixgbevf_up_complete(adapter); |
1681 | 1684 | ||
1682 | /* clear any pending interrupts, may auto mask */ | 1685 | /* clear any pending interrupts, may auto mask */ |
1683 | IXGBE_READ_REG(hw, IXGBE_VTEICR); | 1686 | IXGBE_READ_REG(hw, IXGBE_VTEICR); |
1684 | 1687 | ||
1685 | ixgbevf_irq_enable(adapter, true, true); | 1688 | ixgbevf_irq_enable(adapter, true, true); |
1686 | |||
1687 | return err; | ||
1688 | } | 1689 | } |
1689 | 1690 | ||
1690 | /** | 1691 | /** |
@@ -2673,9 +2674,7 @@ static int ixgbevf_open(struct net_device *netdev) | |||
2673 | */ | 2674 | */ |
2674 | ixgbevf_map_rings_to_vectors(adapter); | 2675 | ixgbevf_map_rings_to_vectors(adapter); |
2675 | 2676 | ||
2676 | err = ixgbevf_up_complete(adapter); | 2677 | ixgbevf_up_complete(adapter); |
2677 | if (err) | ||
2678 | goto err_up; | ||
2679 | 2678 | ||
2680 | /* clear any pending interrupts, may auto mask */ | 2679 | /* clear any pending interrupts, may auto mask */ |
2681 | IXGBE_READ_REG(hw, IXGBE_VTEICR); | 2680 | IXGBE_READ_REG(hw, IXGBE_VTEICR); |
@@ -2689,7 +2688,6 @@ static int ixgbevf_open(struct net_device *netdev) | |||
2689 | 2688 | ||
2690 | err_req_irq: | 2689 | err_req_irq: |
2691 | ixgbevf_down(adapter); | 2690 | ixgbevf_down(adapter); |
2692 | err_up: | ||
2693 | ixgbevf_free_irq(adapter); | 2691 | ixgbevf_free_irq(adapter); |
2694 | err_setup_rx: | 2692 | err_setup_rx: |
2695 | ixgbevf_free_all_rx_resources(adapter); | 2693 | ixgbevf_free_all_rx_resources(adapter); |
@@ -3196,9 +3194,11 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu) | |||
3196 | /* must set new MTU before calling down or up */ | 3194 | /* must set new MTU before calling down or up */ |
3197 | netdev->mtu = new_mtu; | 3195 | netdev->mtu = new_mtu; |
3198 | 3196 | ||
3199 | msg[0] = IXGBE_VF_SET_LPE; | 3197 | if (!netif_running(netdev)) { |
3200 | msg[1] = max_frame; | 3198 | msg[0] = IXGBE_VF_SET_LPE; |
3201 | hw->mbx.ops.write_posted(hw, msg, 2); | 3199 | msg[1] = max_frame; |
3200 | hw->mbx.ops.write_posted(hw, msg, 2); | ||
3201 | } | ||
3202 | 3202 | ||
3203 | if (netif_running(netdev)) | 3203 | if (netif_running(netdev)) |
3204 | ixgbevf_reinit_locked(adapter); | 3204 | ixgbevf_reinit_locked(adapter); |