]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ionic: move debugfs add/delete to match alloc/free
authorShannon Nelson <snelson@pensando.io>
Sat, 28 Mar 2020 03:14:43 +0000 (20:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Mar 2020 18:40:50 +0000 (11:40 -0700)
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>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 3b34c6215422c090beab3c781809c25adc455b6f..a6f2ff56098d566d0b6e6f7542b6cb99f043d3f5 100644 (file)
@@ -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;
 
@@ -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;
@@ -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;
@@ -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);
@@ -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;
 }
 
@@ -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;
 }
 
@@ -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;
@@ -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;
@@ -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)
@@ -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;
 }
 
@@ -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;
 }
 
@@ -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);