• Jacob Keller's avatar
    ice: introduce VF accessor functions · fb916db1
    Jacob Keller authored
    Before we switch the VF data structure storage mechanism to a hash,
    introduce new accessor functions to define the new interface.
    
    * ice_get_vf_by_id is a function used to obtain a reference to a VF from
      the table based on its VF ID
    * ice_has_vfs is used to quickly check if any VFs are configured
    * ice_get_num_vfs is used to get an exact count of how many VFs are
      configured
    
    We can drop the old ice_validate_vf_id function, since every caller was
    just going to immediately access the VF table to get a reference
    anyways. This way we simply use the single ice_get_vf_by_id to both
    validate the VF ID is within range and that there exists a VF with that
    ID.
    
    This change enables us to more easily convert the codebase to the hash
    table since most callers now properly use the interface.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    fb916db1
ice_lib.c 109 KB