aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeerav Parikh <neerav.parikh@intel.com>2014-06-03 21:23:15 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-06-24 21:18:27 -0400
commitdf430b1240d3375d053230d1f943383d59f9267a (patch)
treefa30c9f0b7d5bdc54acc83ab0c088396c4a6f28b
parent23cfbe074da66305d992c663b778d12476eeefce (diff)
i40e: Add PF reset when Malicious driver event for PF
As per the spec when the PF driver receives a Malicious driver event the queue that caused the event is already stopped and it is expected that the function that owns the queue will reset the queue. In some cases it may not be possible to determine the queue and it is suggested to reset the whole function. This patch takes the later approach when the event is owned by the PF that owns it. Change-ID: I40f9764a6a5e068c0ef8438db00c5aa9c2c6c1c8 Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3f60976a0805..80c5d55cf50b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5827,6 +5827,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
5827{ 5827{
5828 struct i40e_hw *hw = &pf->hw; 5828 struct i40e_hw *hw = &pf->hw;
5829 bool mdd_detected = false; 5829 bool mdd_detected = false;
5830 bool pf_mdd_detected = false;
5830 struct i40e_vf *vf; 5831 struct i40e_vf *vf;
5831 u32 reg; 5832 u32 reg;
5832 int i; 5833 int i;
@@ -5866,6 +5867,30 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
5866 mdd_detected = true; 5867 mdd_detected = true;
5867 } 5868 }
5868 5869
5870 if (mdd_detected) {
5871 reg = rd32(hw, I40E_PF_MDET_TX);
5872 if (reg & I40E_PF_MDET_TX_VALID_MASK) {
5873 wr32(hw, I40E_PF_MDET_TX, 0xFFFF);
5874 dev_info(&pf->pdev->dev,
5875 "MDD TX event is for this function 0x%08x, requesting PF reset.\n",
5876 reg);
5877 pf_mdd_detected = true;
5878 }
5879 reg = rd32(hw, I40E_PF_MDET_RX);
5880 if (reg & I40E_PF_MDET_RX_VALID_MASK) {
5881 wr32(hw, I40E_PF_MDET_RX, 0xFFFF);
5882 dev_info(&pf->pdev->dev,
5883 "MDD RX event is for this function 0x%08x, requesting PF reset.\n",
5884 reg);
5885 pf_mdd_detected = true;
5886 }
5887 /* Queue belongs to the PF, initiate a reset */
5888 if (pf_mdd_detected) {
5889 set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
5890 i40e_service_event_schedule(pf);
5891 }
5892 }
5893
5869 /* see if one of the VFs needs its hand slapped */ 5894 /* see if one of the VFs needs its hand slapped */
5870 for (i = 0; i < pf->num_alloc_vfs && mdd_detected; i++) { 5895 for (i = 0; i < pf->num_alloc_vfs && mdd_detected; i++) {
5871 vf = &(pf->vf[i]); 5896 vf = &(pf->vf[i]);