Skip to content

Commit 963fb46

Browse files
mfijalkoanguy11
authored andcommitted
ice: xsk: fix txq interrupt mapping
ice_cfg_txq_interrupt() internally handles XDP Tx ring. Do not use ice_for_each_tx_ring() in ice_qvec_cfg_msix() as this causing us to treat XDP ring that belongs to queue vector as Tx ring and therefore misconfiguring the interrupts. Fixes: 2d4238f ("ice: Add support for AF_XDP") Reviewed-by: Shannon Nelson <[email protected]> Tested-by: Chandan Kumar Rout <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Maciej Fijalkowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 6044ca2 commit 963fb46

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,29 @@ ice_qvec_dis_irq(struct ice_vsi *vsi, struct ice_rx_ring *rx_ring,
110110
* ice_qvec_cfg_msix - Enable IRQ for given queue vector
111111
* @vsi: the VSI that contains queue vector
112112
* @q_vector: queue vector
113+
* @qid: queue index
113114
*/
114115
static void
115-
ice_qvec_cfg_msix(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
116+
ice_qvec_cfg_msix(struct ice_vsi *vsi, struct ice_q_vector *q_vector, u16 qid)
116117
{
117118
u16 reg_idx = q_vector->reg_idx;
118119
struct ice_pf *pf = vsi->back;
119120
struct ice_hw *hw = &pf->hw;
120-
struct ice_tx_ring *tx_ring;
121-
struct ice_rx_ring *rx_ring;
121+
int q, _qid = qid;
122122

123123
ice_cfg_itr(hw, q_vector);
124124

125-
ice_for_each_tx_ring(tx_ring, q_vector->tx)
126-
ice_cfg_txq_interrupt(vsi, tx_ring->reg_idx, reg_idx,
127-
q_vector->tx.itr_idx);
125+
for (q = 0; q < q_vector->num_ring_tx; q++) {
126+
ice_cfg_txq_interrupt(vsi, _qid, reg_idx, q_vector->tx.itr_idx);
127+
_qid++;
128+
}
128129

129-
ice_for_each_rx_ring(rx_ring, q_vector->rx)
130-
ice_cfg_rxq_interrupt(vsi, rx_ring->reg_idx, reg_idx,
131-
q_vector->rx.itr_idx);
130+
_qid = qid;
131+
132+
for (q = 0; q < q_vector->num_ring_rx; q++) {
133+
ice_cfg_rxq_interrupt(vsi, _qid, reg_idx, q_vector->rx.itr_idx);
134+
_qid++;
135+
}
132136

133137
ice_flush(hw);
134138
}
@@ -241,7 +245,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
241245
fail = err;
242246

243247
q_vector = vsi->rx_rings[q_idx]->q_vector;
244-
ice_qvec_cfg_msix(vsi, q_vector);
248+
ice_qvec_cfg_msix(vsi, q_vector, q_idx);
245249

246250
err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true);
247251
if (!fail)

0 commit comments

Comments
 (0)