aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnjali Singhai Jain <anjali.singhai@intel.com>2014-07-10 03:58:18 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-08-15 06:39:08 -0400
commit478c9e74204f7bd5f97cca92e917749434ed6f92 (patch)
tree3bd7339b7488fb832a14236ba173fad529947ae7
parentc9d26423e56ce1ab4d786f92aebecf859d419293 (diff)
i40e: Fix for recent kernel panic
Whenever we get a Tx hang we issue a PFR, which means we send AQ messages to VFS about the reset coming. Unfortunately with the recent fix to be able to send messages to all VFS which earlier was not happening at all we now are sending messages to not just the VFS that are up but also to VFS that are not up. AQ complains about this and sends us an error in ARQ called LAN overflow event for a queue. We check if the queue belongs to a VF and if it does we try to send a vc_notify_vf_reset message to that VF. Well if the VF is not up/enabled we will be entering this function with a non-active VF id. In this function we were assuming VF struct is populated but it won't be if the VF is not active. Change-ID: Ic6733cda4582d3609fe6d83b2872bb2dcdc73f4a Signed-off-by: Ashish N Shah <ashish.n.shah@intel.com> Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 89672551dce9..502b53441fa9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1928,17 +1928,22 @@ static void i40e_vc_vf_broadcast(struct i40e_pf *pf,
1928{ 1928{
1929 struct i40e_hw *hw = &pf->hw; 1929 struct i40e_hw *hw = &pf->hw;
1930 struct i40e_vf *vf = pf->vf; 1930 struct i40e_vf *vf = pf->vf;
1931 int abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id; 1931 int abs_vf_id;
1932 int i; 1932 int i;
1933 1933
1934 for (i = 0; i < pf->num_alloc_vfs; i++) { 1934 for (i = 0; i < pf->num_alloc_vfs; i++) {
1935 /* Not all vfs are enabled so skip the ones that are not */
1936 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states) &&
1937 !test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states))
1938 continue;
1939
1935 /* Ignore return value on purpose - a given VF may fail, but 1940 /* Ignore return value on purpose - a given VF may fail, but
1936 * we need to keep going and send to all of them 1941 * we need to keep going and send to all of them
1937 */ 1942 */
1943 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
1938 i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval, 1944 i40e_aq_send_msg_to_vf(hw, abs_vf_id, v_opcode, v_retval,
1939 msg, msglen, NULL); 1945 msg, msglen, NULL);
1940 vf++; 1946 vf++;
1941 abs_vf_id = vf->vf_id + hw->func_caps.vf_base_id;
1942 } 1947 }
1943} 1948}
1944 1949
@@ -2002,7 +2007,14 @@ void i40e_vc_notify_reset(struct i40e_pf *pf)
2002void i40e_vc_notify_vf_reset(struct i40e_vf *vf) 2007void i40e_vc_notify_vf_reset(struct i40e_vf *vf)
2003{ 2008{
2004 struct i40e_virtchnl_pf_event pfe; 2009 struct i40e_virtchnl_pf_event pfe;
2005 int abs_vf_id = vf->vf_id + vf->pf->hw.func_caps.vf_base_id; 2010 int abs_vf_id;
2011
2012 /* verify if the VF is in either init or active before proceeding */
2013 if (!test_bit(I40E_VF_STAT_INIT, &vf->vf_states) &&
2014 !test_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states))
2015 return;
2016
2017 abs_vf_id = vf->vf_id + vf->pf->hw.func_caps.vf_base_id;
2006 2018
2007 pfe.event = I40E_VIRTCHNL_EVENT_RESET_IMPENDING; 2019 pfe.event = I40E_VIRTCHNL_EVENT_RESET_IMPENDING;
2008 pfe.severity = I40E_PF_EVENT_SEVERITY_CERTAIN_DOOM; 2020 pfe.severity = I40E_PF_EVENT_SEVERITY_CERTAIN_DOOM;