• Jacob Keller's avatar
    ice: cleanup error logging for ice_ena_vfs · 94ab2488
    Jacob Keller authored
    
    
    The ice_ena_vfs function and some of its sub-functions like
    ice_set_per_vf_res use a "if (<function>) { <print error> ; <exit> }"
    flow. This flow discards specialized errors reported by the called
    function.
    
    This style is generally not preferred as it makes tracing error sources
    more difficult. It also means we cannot log the actual error received
    properly.
    
    Refactor several calls in the ice_ena_vfs function that do this to catch
    the error in the 'ret' variable. Report this in the messages, and then
    return the more precise error value.
    
    Doing this reveals that ice_set_per_vf_res returns -EINVAL or -EIO in
    places where -ENOSPC makes more sense. Fix these calls up to return the
    more appropriate value.
    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>
    94ab2488
ice_sriov.c 180 KB