Skip to content

Commit eac0442

Browse files
lczapnikanguy11
authored andcommitted
i40e: add mask to apply valid bits for itr_idx
The ITR index (itr_idx) is only 2 bits wide. When constructing the register value for QINT_RQCTL, all fields are ORed together. Without masking, higher bits from itr_idx may overwrite adjacent fields in the register. Apply I40E_QINT_RQCTL_ITR_INDX_MASK to ensure only the intended bits are set. Fixes: 5c3c48a ("i40e: implement virtual device interface") Cc: [email protected] Signed-off-by: Lukasz Czapnik <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent cb79fa7 commit eac0442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,
448448
(qtype << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT) |
449449
(pf_queue_id << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) |
450450
BIT(I40E_QINT_RQCTL_CAUSE_ENA_SHIFT) |
451-
(itr_idx << I40E_QINT_RQCTL_ITR_INDX_SHIFT);
451+
FIELD_PREP(I40E_QINT_RQCTL_ITR_INDX_MASK, itr_idx);
452452
wr32(hw, reg_idx, reg);
453453
}
454454

0 commit comments

Comments
 (0)