• Jacob Keller's avatar
    ice: move vsi_type assignment from ice_vsi_alloc to ice_vsi_cfg · e1588197
    Jacob Keller authored
    The ice_vsi_alloc and ice_vsi_cfg functions are used together to allocate
    and configure a new VSI, called as part of the ice_vsi_setup function.
    
    In the future with the addition of the subfunction code the ice driver
    will want to be able to allocate a VSI while delaying the configuration to
    a later point of the port activation.
    
    Currently this requires that the port code know what type of VSI should
    be allocated. This is required because ice_vsi_alloc assigns the VSI type.
    
    Refactor the ice_vsi_alloc and ice_vsi_cfg functions so that VSI type
    assignment isn't done until the configuration stage. This will allow the
    devlink port addition logic to reserve a VSI as early as possible before
    the type of the port is known. In this way, the port add can fail in the
    event that all hardware VSI resources are exhausted.
    
    Since the ice_vsi_cfg function already takes the ice_vsi_cfg_params
    structure, this is relatively straight forward.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    e1588197
ice_lib.c 112 KB