Commit d5eddde5 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: check for queues before deleting

Make sure the queue structures exist before trying
to delete them.  This addresses a couple of error
recovery issues.
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9c00e2c
......@@ -1437,42 +1437,61 @@ static void ionic_txrx_disable(struct ionic_lif *lif)
unsigned int i;
int err;
if (lif->txqcqs) {
for (i = 0; i < lif->nxqs; i++) {
err = ionic_qcq_disable(lif->txqcqs[i].qcq);
if (err == -ETIMEDOUT)
break;
}
}
if (lif->rxqcqs) {
for (i = 0; i < lif->nxqs; i++) {
err = ionic_qcq_disable(lif->rxqcqs[i].qcq);
if (err == -ETIMEDOUT)
break;
}
}
}
static void ionic_txrx_deinit(struct ionic_lif *lif)
{
unsigned int i;
if (lif->txqcqs) {
for (i = 0; i < lif->nxqs; i++) {
ionic_lif_qcq_deinit(lif, lif->txqcqs[i].qcq);
ionic_tx_flush(&lif->txqcqs[i].qcq->cq);
ionic_tx_empty(&lif->txqcqs[i].qcq->q);
}
}
if (lif->rxqcqs) {
for (i = 0; i < lif->nxqs; i++) {
ionic_lif_qcq_deinit(lif, lif->rxqcqs[i].qcq);
ionic_rx_flush(&lif->rxqcqs[i].qcq->cq);
ionic_rx_empty(&lif->rxqcqs[i].qcq->q);
}
}
}
static void ionic_txrx_free(struct ionic_lif *lif)
{
unsigned int i;
if (lif->txqcqs) {
for (i = 0; i < lif->nxqs; i++) {
ionic_qcq_free(lif, lif->txqcqs[i].qcq);
lif->txqcqs[i].qcq = NULL;
}
}
if (lif->rxqcqs) {
for (i = 0; i < lif->nxqs; i++) {
ionic_qcq_free(lif, lif->rxqcqs[i].qcq);
lif->rxqcqs[i].qcq = NULL;
}
}
}
static int ionic_txrx_alloc(struct ionic_lif *lif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment