diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-27 11:53:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-28 04:20:35 -0400 |
commit | d4960307ea63a5625a175cc2d7b192e68e6b4fba (patch) | |
tree | 13df04dc963f3ed865d78f74c3aabb94da0bfe07 /drivers/net/igb/igb_main.c | |
parent | 06cf2666c7f5cc4ba4bf2687d041c61ada76fa3c (diff) |
igb: delay VF reset notification until after interrupts are enabed
This update delays the VF reset notification until after interrupts are
enabled. Otherwise there is a chance of having the VF try to reset itself too
soon and being ignored by the PF as a result.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ea0560484dc7..24a119ec005d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1165,6 +1165,13 @@ int igb_up(struct igb_adapter *adapter) | |||
1165 | rd32(E1000_ICR); | 1165 | rd32(E1000_ICR); |
1166 | igb_irq_enable(adapter); | 1166 | igb_irq_enable(adapter); |
1167 | 1167 | ||
1168 | /* notify VFs that reset has been completed */ | ||
1169 | if (adapter->vfs_allocated_count) { | ||
1170 | u32 reg_data = rd32(E1000_CTRL_EXT); | ||
1171 | reg_data |= E1000_CTRL_EXT_PFRSTD; | ||
1172 | wr32(E1000_CTRL_EXT, reg_data); | ||
1173 | } | ||
1174 | |||
1168 | netif_tx_start_all_queues(adapter->netdev); | 1175 | netif_tx_start_all_queues(adapter->netdev); |
1169 | 1176 | ||
1170 | /* Fire a link change interrupt to start the watchdog. */ | 1177 | /* Fire a link change interrupt to start the watchdog. */ |
@@ -1948,6 +1955,13 @@ static int igb_open(struct net_device *netdev) | |||
1948 | 1955 | ||
1949 | igb_irq_enable(adapter); | 1956 | igb_irq_enable(adapter); |
1950 | 1957 | ||
1958 | /* notify VFs that reset has been completed */ | ||
1959 | if (adapter->vfs_allocated_count) { | ||
1960 | u32 reg_data = rd32(E1000_CTRL_EXT); | ||
1961 | reg_data |= E1000_CTRL_EXT_PFRSTD; | ||
1962 | wr32(E1000_CTRL_EXT, reg_data); | ||
1963 | } | ||
1964 | |||
1951 | netif_tx_start_all_queues(netdev); | 1965 | netif_tx_start_all_queues(netdev); |
1952 | 1966 | ||
1953 | /* Fire a link status change interrupt to start the watchdog. */ | 1967 | /* Fire a link status change interrupt to start the watchdog. */ |
@@ -5785,19 +5799,18 @@ static int igb_set_vf_mac(struct igb_adapter *adapter, | |||
5785 | static void igb_vmm_control(struct igb_adapter *adapter) | 5799 | static void igb_vmm_control(struct igb_adapter *adapter) |
5786 | { | 5800 | { |
5787 | struct e1000_hw *hw = &adapter->hw; | 5801 | struct e1000_hw *hw = &adapter->hw; |
5788 | u32 reg_data; | ||
5789 | 5802 | ||
5790 | if (!adapter->vfs_allocated_count) | 5803 | /* replication is not supported for 82575 */ |
5804 | if (hw->mac.type == e1000_82575) | ||
5791 | return; | 5805 | return; |
5792 | 5806 | ||
5793 | /* VF's need PF reset indication before they | 5807 | if (adapter->vfs_allocated_count) { |
5794 | * can send/receive mail */ | 5808 | igb_vmdq_set_loopback_pf(hw, true); |
5795 | reg_data = rd32(E1000_CTRL_EXT); | 5809 | igb_vmdq_set_replication_pf(hw, true); |
5796 | reg_data |= E1000_CTRL_EXT_PFRSTD; | 5810 | } else { |
5797 | wr32(E1000_CTRL_EXT, reg_data); | 5811 | igb_vmdq_set_loopback_pf(hw, false); |
5798 | 5812 | igb_vmdq_set_replication_pf(hw, false); | |
5799 | igb_vmdq_set_loopback_pf(hw, true); | 5813 | } |
5800 | igb_vmdq_set_replication_pf(hw, true); | ||
5801 | } | 5814 | } |
5802 | 5815 | ||
5803 | /* igb_main.c */ | 5816 | /* igb_main.c */ |