diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2010-01-22 17:46:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-23 04:13:55 -0500 |
commit | 767081adbd920ce93e3f1cbe797d0631637f92b3 (patch) | |
tree | ac2abe391813533691229513fb89dbcfe4d4a0ea /drivers/net/ixgbe | |
parent | c9205697c7527173c8f8bfa9f8c9dabdbced3c49 (diff) |
ixgbe: Improve reset coordination between the PF and the VF
Inadequate coordination between the PF driver and the VF driver results
in tx hangs in the VF driver when you perform certain actions that will
lead to a re-init of the PF. Add feature to notify active VFs when the PF
is about to re-initialize so that the VFs can take appropriate action.
Signed-off-by: Greg Rose <gregory.v.rose@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/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 11 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_sriov.c | 26 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_sriov.h | 2 |
3 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index b96afd98fa3d..ee41d331a35f 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3203,6 +3203,17 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3203 | /* signal that we are down to the interrupt handler */ | 3203 | /* signal that we are down to the interrupt handler */ |
3204 | set_bit(__IXGBE_DOWN, &adapter->state); | 3204 | set_bit(__IXGBE_DOWN, &adapter->state); |
3205 | 3205 | ||
3206 | /* disable receive for all VFs and wait one second */ | ||
3207 | if (adapter->num_vfs) { | ||
3208 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
3209 | adapter->vfinfo[i].clear_to_send = 0; | ||
3210 | |||
3211 | /* ping all the active vfs to let them know we are going down */ | ||
3212 | ixgbe_ping_all_vfs(adapter); | ||
3213 | /* Disable all VFTE/VFRE TX/RX */ | ||
3214 | ixgbe_disable_tx_rx(adapter); | ||
3215 | } | ||
3216 | |||
3206 | /* disable receives */ | 3217 | /* disable receives */ |
3207 | rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); | 3218 | rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); |
3208 | IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl & ~IXGBE_RXCTRL_RXEN); | 3219 | IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl & ~IXGBE_RXCTRL_RXEN); |
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c index 74bca74d57c1..d4cd20f30199 100644 --- a/drivers/net/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ixgbe/ixgbe_sriov.c | |||
@@ -334,3 +334,29 @@ void ixgbe_msg_task(struct ixgbe_adapter *adapter) | |||
334 | } | 334 | } |
335 | } | 335 | } |
336 | 336 | ||
337 | void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter) | ||
338 | { | ||
339 | struct ixgbe_hw *hw = &adapter->hw; | ||
340 | |||
341 | /* disable transmit and receive for all vfs */ | ||
342 | IXGBE_WRITE_REG(hw, IXGBE_VFTE(0), 0); | ||
343 | IXGBE_WRITE_REG(hw, IXGBE_VFTE(1), 0); | ||
344 | |||
345 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(0), 0); | ||
346 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(1), 0); | ||
347 | } | ||
348 | |||
349 | void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter) | ||
350 | { | ||
351 | struct ixgbe_hw *hw = &adapter->hw; | ||
352 | u32 ping; | ||
353 | int i; | ||
354 | |||
355 | for (i = 0 ; i < adapter->num_vfs; i++) { | ||
356 | ping = IXGBE_PF_CONTROL_MSG; | ||
357 | if (adapter->vfinfo[i].clear_to_send) | ||
358 | ping |= IXGBE_VT_MSGTYPE_CTS; | ||
359 | ixgbe_write_mbx(hw, &ping, 1, i); | ||
360 | } | ||
361 | } | ||
362 | |||
diff --git a/drivers/net/ixgbe/ixgbe_sriov.h b/drivers/net/ixgbe/ixgbe_sriov.h index 664b237eacb9..51d1106c45a1 100644 --- a/drivers/net/ixgbe/ixgbe_sriov.h +++ b/drivers/net/ixgbe/ixgbe_sriov.h | |||
@@ -39,6 +39,8 @@ void ixgbe_msg_task(struct ixgbe_adapter *adapter); | |||
39 | int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, | 39 | int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, |
40 | int vf, unsigned char *mac_addr); | 40 | int vf, unsigned char *mac_addr); |
41 | int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); | 41 | int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask); |
42 | void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter); | ||
43 | void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter); | ||
42 | void ixgbe_dump_registers(struct ixgbe_adapter *adapter); | 44 | void ixgbe_dump_registers(struct ixgbe_adapter *adapter); |
43 | 45 | ||
44 | #endif /* _IXGBE_SRIOV_H_ */ | 46 | #endif /* _IXGBE_SRIOV_H_ */ |