Skip to content

Commit f8e9889

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: change vfs.num_msix_per to vf->num_msix
vfs::num_msix_per should be only used as default value for vf->num_msix. For other use cases vf->num_msix should be used, as VF can have different MSI-X amount values. Fix incorrect register index calculation. vfs::num_msix_per and pf->sriov_base_vector shouldn't be used after implementation of changing MSI-X amount on VFs. Instead vf->first_vector_idx should be used, as it is storing value for first irq index. Fixes: fe1c5ca ("ice: implement num_msix field per VF") Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 3c91c90 commit f8e9889

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,11 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)
374374
*/
375375
int ice_calc_vf_reg_idx(struct ice_vf *vf, struct ice_q_vector *q_vector)
376376
{
377-
struct ice_pf *pf;
378-
379377
if (!vf || !q_vector)
380378
return -EINVAL;
381379

382-
pf = vf->pf;
383-
384380
/* always add one to account for the OICR being the first MSIX */
385-
return pf->sriov_base_vector + pf->vfs.num_msix_per * vf->vf_id +
386-
q_vector->v_idx + 1;
381+
return vf->first_vector_idx + q_vector->v_idx + 1;
387382
}
388383

389384
/**

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,6 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15231523
u16 num_q_vectors_mapped, vsi_id, vector_id;
15241524
struct virtchnl_irq_map_info *irqmap_info;
15251525
struct virtchnl_vector_map *map;
1526-
struct ice_pf *pf = vf->pf;
15271526
struct ice_vsi *vsi;
15281527
int i;
15291528

@@ -1535,7 +1534,7 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15351534
* there is actually at least a single VF queue vector mapped
15361535
*/
15371536
if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) ||
1538-
pf->vfs.num_msix_per < num_q_vectors_mapped ||
1537+
vf->num_msix < num_q_vectors_mapped ||
15391538
!num_q_vectors_mapped) {
15401539
v_ret = VIRTCHNL_STATUS_ERR_PARAM;
15411540
goto error_param;
@@ -1557,7 +1556,7 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
15571556
/* vector_id is always 0-based for each VF, and can never be
15581557
* larger than or equal to the max allowed interrupts per VF
15591558
*/
1560-
if (!(vector_id < pf->vfs.num_msix_per) ||
1559+
if (!(vector_id < vf->num_msix) ||
15611560
!ice_vc_isvalid_vsi_id(vf, vsi_id) ||
15621561
(!vector_id && (map->rxq_map || map->txq_map))) {
15631562
v_ret = VIRTCHNL_STATUS_ERR_PARAM;

0 commit comments

Comments
 (0)