> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of
> Jacob Keller
> Sent: Friday, February 16, 2024 11:07 PM
> To: Nguyen, Anthony L <[email protected]>; Intel Wired LAN
> <[email protected]>
> Cc: Keller, Jacob E <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next 1/4] ice: pass VSI pointer into
> ice_vc_isvalid_q_id
> 
> The ice_vc_isvalid_q_id() function takes a VSI index and a queue ID. It looks 
> up
> the VSI from its index, and then validates that the queue number is valid for
> that VSI.
> 
> The VSI ID passed is typically a VSI index from the VF. This VSI number is
> validated by the PF to ensure that it matches the VSI associated with the VF
> already.
> 
> In every flow where ice_vc_isvalid_q_id() is called, the PF driver already 
> has a
> pointer to the VSI associated with the VF. This pointer is obtained using
> ice_get_vf_vsi(), rather than looking up the VSI using the index sent by the 
> VF.
> 
> Since we already know which VSI to operate on, we can modify
> ice_vc_isvalid_q_id() to take a VSI pointer instead of a VSI index. Pass the 
> VSI
> we found from ice_get_vf_vsi() instead of re-doing the lookup. This removes
> some unnecessary computation and scanning of the VSI list.
> 
> It also removes the last place where the driver directly used the VSI number
> from the VF. This will pave the way for refactoring to communicate relative 
> VSI
> numbers to the VF instead of absolute numbers from the PF space.
> 
> Signed-off-by: Jacob Keller <[email protected]>
> Reviewed-by: Przemek Kitszel <[email protected]>
> ---
>  drivers/net/ethernet/intel/ice/ice_virtchnl.c | 22 +++++++++----------
>  1 file changed, 10 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> index 6f2328a049bf..29449030174f 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
> @@ -555,17 +555,15 @@ bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16


Tested-by: Rafal Romanowski <[email protected]>


Reply via email to