]> asedeno.scripts.mit.edu Git - linux.git/commit
i40e: add a helper function to validate a VF based on the vf id
authorHarshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tue, 28 Aug 2018 17:16:05 +0000 (10:16 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 25 Sep 2018 20:05:37 +0000 (13:05 -0700)
commited277c50c0752e11631bc79363385db0e1bb010a
tree0341e9689a04a28c0cf7fa29d41b58e090bb8c0b
parente7bac7afa612f911a9fe0a035007592e1b86c8d4
i40e: add a helper function to validate a VF based on the vf id

When we are trying to change VF settings, it is possible for 2 race
conditions to happen. One, when the VF is created but not yet enabled.
Second, the VF is enabled but the VSI is still not created or not yet
re-created in the VF reset flow.

This patch introduces a helper function to validate that the VF is
enabled and that the VSI is set up. This patch also calls this
function from other functions which could get into these race conditions.
While we are poking around here, remove unnecessary parenthesis that
checkpatch was complaining about.

Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c