ice: move vsi_type assignment from ice_vsi_alloc to ice_vsi_cfg
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 19 Jan 2023 01:16:44 +0000 (17:16 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 6 Feb 2023 17:38:25 +0000 (09:38 -0800)
commite15881970692f9e65175e9dcb1f4d2dba0672861
treea635f2836a9650f0f4452904e326887b7360cf17
parent5e509ab237f175a0985e9ca7d696fbdc62434e56
ice: move vsi_type assignment from ice_vsi_alloc to ice_vsi_cfg

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: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c