aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;