Commit 6a23449a authored by Avinash Dayanand's avatar Avinash Dayanand Committed by Jeff Kirsher

i40e: Don't notify client of VF reset during VF creation

VF goes through reset path during VF creation which happens to also
have notification of VF reset to client. Adding conditional check to
avoid wrongly notifying VF reset during VF creation.

Also changing the call order of VF enable, calling it after VF creation
rather than before.

Change-ID: I96eabd99deae746a2f0fc465194c886f196178ce
Signed-off-by: default avatarAvinash Dayanand <avinash.dayanand@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 70df973b
...@@ -991,7 +991,9 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) ...@@ -991,7 +991,9 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
i40e_enable_vf_mappings(vf); i40e_enable_vf_mappings(vf);
set_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states); set_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states);
clear_bit(I40E_VF_STAT_DISABLED, &vf->vf_states); clear_bit(I40E_VF_STAT_DISABLED, &vf->vf_states);
i40e_notify_client_of_vf_reset(pf, abs_vf_id); /* Do not notify the client during VF init */
if (vf->pf->num_alloc_vfs)
i40e_notify_client_of_vf_reset(pf, abs_vf_id);
vf->num_vlan = 0; vf->num_vlan = 0;
} }
/* tell the VF the reset is done */ /* tell the VF the reset is done */
...@@ -1090,7 +1092,6 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) ...@@ -1090,7 +1092,6 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
goto err_iov; goto err_iov;
} }
} }
i40e_notify_client_of_vf_enable(pf, num_alloc_vfs);
/* allocate memory */ /* allocate memory */
vfs = kcalloc(num_alloc_vfs, sizeof(struct i40e_vf), GFP_KERNEL); vfs = kcalloc(num_alloc_vfs, sizeof(struct i40e_vf), GFP_KERNEL);
if (!vfs) { if (!vfs) {
...@@ -1114,6 +1115,8 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs) ...@@ -1114,6 +1115,8 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
} }
pf->num_alloc_vfs = num_alloc_vfs; pf->num_alloc_vfs = num_alloc_vfs;
i40e_notify_client_of_vf_enable(pf, num_alloc_vfs);
err_alloc: err_alloc:
if (ret) if (ret)
i40e_free_vfs(pf); i40e_free_vfs(pf);
......
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