Skip to content

Commit

Permalink
ionic: move debugfs add/delete to match alloc/free
Browse files Browse the repository at this point in the history
Move the qcq debugfs add to the queue alloc, and likewise move
the debugfs delete to the queue free.  The LIF debugfs add
also needs to be moved, but the del is already in the LIF free.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Mar 30, 2020
1 parent 987c087 commit 2a8c2c1
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions drivers/net/ethernet/pensando/ionic/ionic_lif.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ static void ionic_lif_qcq_deinit(struct ionic_lif *lif, struct ionic_qcq *qcq)
if (!qcq)
return;

ionic_debugfs_del_qcq(qcq);

if (!(qcq->flags & IONIC_QCQ_F_INITED))
return;

Expand All @@ -295,6 +293,8 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq)
if (!qcq)
return;

ionic_debugfs_del_qcq(qcq);

dma_free_coherent(dev, qcq->total_size, qcq->base, qcq->base_pa);
qcq->base = NULL;
qcq->base_pa = 0;
Expand Down Expand Up @@ -509,6 +509,7 @@ static int ionic_qcqs_alloc(struct ionic_lif *lif)
0, lif->kern_pid, &lif->adminqcq);
if (err)
return err;
ionic_debugfs_add_qcq(lif, lif->adminqcq);

if (lif->ionic->nnqs_per_lif) {
flags = IONIC_QCQ_F_NOTIFYQ;
Expand All @@ -519,6 +520,7 @@ static int ionic_qcqs_alloc(struct ionic_lif *lif)
0, lif->kern_pid, &lif->notifyqcq);
if (err)
goto err_out_free_adminqcq;
ionic_debugfs_add_qcq(lif, lif->notifyqcq);

/* Let the notifyq ride on the adminq interrupt */
ionic_link_qcq_interrupts(lif->adminqcq, lif->notifyqcq);
Expand Down Expand Up @@ -616,8 +618,6 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)

qcq->flags |= IONIC_QCQ_F_INITED;

ionic_debugfs_add_qcq(lif, qcq);

return 0;
}

Expand Down Expand Up @@ -672,8 +672,6 @@ static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq)

qcq->flags |= IONIC_QCQ_F_INITED;

ionic_debugfs_add_qcq(lif, qcq);

return 0;
}

Expand Down Expand Up @@ -1490,6 +1488,7 @@ static int ionic_txrx_alloc(struct ionic_lif *lif)
goto err_out;

lif->txqcqs[i].qcq->stats = lif->txqcqs[i].stats;
ionic_debugfs_add_qcq(lif, lif->txqcqs[i].qcq);
}

flags = IONIC_QCQ_F_RX_STATS | IONIC_QCQ_F_SG | IONIC_QCQ_F_INTR;
Expand All @@ -1510,6 +1509,7 @@ static int ionic_txrx_alloc(struct ionic_lif *lif)
lif->rx_coalesce_hw);
ionic_link_qcq_interrupts(lif->rxqcqs[i].qcq,
lif->txqcqs[i].qcq);
ionic_debugfs_add_qcq(lif, lif->rxqcqs[i].qcq);
}

return 0;
Expand Down Expand Up @@ -1974,6 +1974,8 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index
goto err_out_free_netdev;
}

ionic_debugfs_add_lif(lif);

/* allocate queues */
err = ionic_qcqs_alloc(lif);
if (err)
Expand Down Expand Up @@ -2154,8 +2156,6 @@ static int ionic_lif_adminq_init(struct ionic_lif *lif)

qcq->flags |= IONIC_QCQ_F_INITED;

ionic_debugfs_add_qcq(lif, qcq);

return 0;
}

Expand Down Expand Up @@ -2203,8 +2203,6 @@ static int ionic_lif_notifyq_init(struct ionic_lif *lif)

qcq->flags |= IONIC_QCQ_F_INITED;

ionic_debugfs_add_qcq(lif, qcq);

return 0;
}

Expand Down Expand Up @@ -2258,8 +2256,6 @@ static int ionic_lif_init(struct ionic_lif *lif)
int dbpage_num;
int err;

ionic_debugfs_add_lif(lif);

mutex_lock(&lif->ionic->dev_cmd_lock);
ionic_dev_cmd_lif_init(idev, lif->index, lif->info_pa);
err = ionic_dev_cmd_wait(lif->ionic, DEVCMD_TIMEOUT);
Expand Down

0 comments on commit 2a8c2c1

Please sign in to comment.