Skip to content

Commit 7015ca3

Browse files
Sergey NemovJeff Kirsher
authored andcommitted
i40e: add num_vectors checker in iwarp handler
Field num_vectors from struct virtchnl_iwarp_qvlist_info should not be larger than num_msix_vectors_vf in the hw struct. The iwarp uses the same set of vectors as the LAN VF driver. Signed-off-by: Sergey Nemov <sergey.nemov@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 1aa874b commit 7015ca3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,16 @@ static int i40e_config_iwarp_qvlist(struct i40e_vf *vf,
442442
u32 next_q_idx, next_q_type;
443443
u32 msix_vf, size;
444444

445+
msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
446+
447+
if (qvlist_info->num_vectors > msix_vf) {
448+
dev_warn(&pf->pdev->dev,
449+
"Incorrect number of iwarp vectors %u. Maximum %u allowed.\n",
450+
qvlist_info->num_vectors,
451+
msix_vf);
452+
goto err;
453+
}
454+
445455
size = sizeof(struct virtchnl_iwarp_qvlist_info) +
446456
(sizeof(struct virtchnl_iwarp_qv_info) *
447457
(qvlist_info->num_vectors - 1));

0 commit comments

Comments
 (0)