Skip to content

Commit e8797a0

Browse files
nspatel1986kuba-moo
authored andcommitted
ionic: clean interrupt before enabling queue to avoid credit race
Clear the interrupt credits before enabling the queue rather than after to be sure that the enabled queue starts at 0 and that we don't wipe away possible credits after enabling the queue. Fixes: 0f3154e ("ionic: Add Tx and Rx handling") Signed-off-by: Neel Patel <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 69ff53e commit e8797a0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,32 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq)
269269
.oper = IONIC_Q_ENABLE,
270270
},
271271
};
272+
int ret;
272273

273274
idev = &lif->ionic->idev;
274275
dev = lif->ionic->dev;
275276

276277
dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n",
277278
ctx.cmd.q_control.index, ctx.cmd.q_control.type);
278279

280+
if (qcq->flags & IONIC_QCQ_F_INTR)
281+
ionic_intr_clean(idev->intr_ctrl, qcq->intr.index);
282+
283+
ret = ionic_adminq_post_wait(lif, &ctx);
284+
if (ret)
285+
return ret;
286+
287+
if (qcq->napi.poll)
288+
napi_enable(&qcq->napi);
289+
279290
if (qcq->flags & IONIC_QCQ_F_INTR) {
280291
irq_set_affinity_hint(qcq->intr.vector,
281292
&qcq->intr.affinity_mask);
282-
napi_enable(&qcq->napi);
283-
ionic_intr_clean(idev->intr_ctrl, qcq->intr.index);
284293
ionic_intr_mask(idev->intr_ctrl, qcq->intr.index,
285294
IONIC_INTR_MASK_CLEAR);
286295
}
287296

288-
return ionic_adminq_post_wait(lif, &ctx);
297+
return 0;
289298
}
290299

291300
static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err)

0 commit comments

Comments
 (0)