diff mbox series

[S58,09/13] ice: Set vsi->vf_id as ICE_INVAL_VFID for non VF VSI types

Message ID 20210331211708.55205-9-anthony.l.nguyen@intel.com
State Accepted
Delegated to: Anthony Nguyen
Headers show
Series [S58,01/13] ice: refactor interrupt moderation writes | expand

Commit Message

Tony Nguyen March 31, 2021, 9:17 p.m. UTC
From: Brett Creeley <brett.creeley@intel.com>

Currently the vsi->vf_id is set only for ICE_VSI_VF and it's left as 0
for all other VSI types. This is confusing and could be problematic
since 0 is a valid vf_id. Fix this by always setting non VF VSI types to
ICE_INVAL_VFID.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Brelinski, TonyX April 8, 2021, 10:24 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Wednesday, March 31, 2021 2:17 PM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S58 09/13] ice: Set vsi->vf_id as
> ICE_INVAL_VFID for non VF VSI types
> 
> From: Brett Creeley <brett.creeley@intel.com>
> 
> Currently the vsi->vf_id is set only for ICE_VSI_VF and it's left as 0 for all
> other VSI types. This is confusing and could be problematic since 0 is a valid
> vf_id. Fix this by always setting non VF VSI types to ICE_INVAL_VFID.
> 
> Signed-off-by: Brett Creeley <brett.creeley@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> A Contingent Worker at Intel
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 4e93005686a4..c379b4ddffbd 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -158,7 +158,8 @@  static void ice_vsi_set_num_qs(struct ice_vsi *vsi, u16 vf_id)
 
 	if (vsi->type == ICE_VSI_VF)
 		vsi->vf_id = vf_id;
-
+	else
+		vsi->vf_id = ICE_INVAL_VFID;
 	switch (vsi->type) {
 	case ICE_VSI_PF:
 		vsi->alloc_txq = min3(pf->num_lan_msix,