Commit 625777e3 authored by Mitch Williams's avatar Mitch Williams Committed by David S. Miller

i40evf: request reset on tx hang

If the kernel watchdog bites us, ask the PF to reset us and attempt to
reinit the driver.

Change-ID: Ic97665aeeed71ce712b9c4f057e78ff8372522b9
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Signed-off-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 61cc776f
...@@ -287,6 +287,7 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter); ...@@ -287,6 +287,7 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter);
void i40evf_del_vlans(struct i40evf_adapter *adapter); void i40evf_del_vlans(struct i40evf_adapter *adapter);
void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags); void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags);
void i40evf_request_stats(struct i40evf_adapter *adapter); void i40evf_request_stats(struct i40evf_adapter *adapter);
void i40evf_request_reset(struct i40evf_adapter *adapter);
void i40evf_virtchnl_completion(struct i40evf_adapter *adapter, void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,
enum i40e_virtchnl_ops v_opcode, enum i40e_virtchnl_ops v_opcode,
i40e_status v_retval, u8 *msg, u16 msglen); i40e_status v_retval, u8 *msg, u16 msglen);
......
...@@ -167,9 +167,13 @@ static void i40evf_tx_timeout(struct net_device *netdev) ...@@ -167,9 +167,13 @@ static void i40evf_tx_timeout(struct net_device *netdev)
struct i40evf_adapter *adapter = netdev_priv(netdev); struct i40evf_adapter *adapter = netdev_priv(netdev);
adapter->tx_timeout_count++; adapter->tx_timeout_count++;
dev_info(&adapter->pdev->dev, "TX timeout detected.\n");
/* Do the reset outside of interrupt context */ if (!(adapter->flags & I40EVF_FLAG_RESET_PENDING)) {
dev_info(&adapter->pdev->dev, "Requesting reset from PF\n");
i40evf_request_reset(adapter);
adapter->flags |= I40EVF_FLAG_RESET_PENDING;
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
}
} }
/** /**
......
...@@ -654,6 +654,18 @@ void i40evf_request_stats(struct i40evf_adapter *adapter) ...@@ -654,6 +654,18 @@ void i40evf_request_stats(struct i40evf_adapter *adapter)
/* if the request failed, don't lock out others */ /* if the request failed, don't lock out others */
adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN; adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
} }
/**
* i40evf_request_reset
* @adapter: adapter structure
*
* Request that the PF reset this VF. No response is expected.
**/
void i40evf_request_reset(struct i40evf_adapter *adapter)
{
/* Don't check CURRENT_OP - this is always higher priority */
i40evf_send_pf_msg(adapter, I40E_VIRTCHNL_OP_RESET_VF, NULL, 0);
adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
}
/** /**
* i40evf_virtchnl_completion * i40evf_virtchnl_completion
......
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