net/ionic: combine queue init and enable commands
authorAndrew Boyer <aboyer@pensando.io>
Mon, 11 Jan 2021 19:02:05 +0000 (11:02 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 Jan 2021 02:30:32 +0000 (03:30 +0100)
Adding F_ENA to the q_init command has the same effect as q_enable.
This reduces the startup time a bit.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Neel Patel <neel@pensando.io>
drivers/net/ionic/ionic_lif.c
drivers/net/ionic/ionic_rxtx.c

index ed1595e..673f789 100644 (file)
@@ -1371,7 +1371,7 @@ ionic_lif_txq_init(struct ionic_qcq *qcq)
                        .opcode = IONIC_CMD_Q_INIT,
                        .type = q->type,
                        .index = q->index,
-                       .flags = IONIC_QINIT_F_SG,
+                       .flags = IONIC_QINIT_F_SG | IONIC_QINIT_F_ENA,
                        .intr_index = cq->bound_intr->index,
                        .ring_size = rte_log2_u32(q->num_descs),
                        .ring_base = q->base_pa,
@@ -1417,7 +1417,7 @@ ionic_lif_rxq_init(struct ionic_qcq *qcq)
                        .opcode = IONIC_CMD_Q_INIT,
                        .type = q->type,
                        .index = q->index,
-                       .flags = IONIC_QINIT_F_SG,
+                       .flags = IONIC_QINIT_F_SG | IONIC_QINIT_F_ENA,
                        .intr_index = cq->bound_intr->index,
                        .ring_size = rte_log2_u32(q->num_descs),
                        .ring_base = q->base_pa,
index cf7ff6c..5d0e9d5 100644 (file)
@@ -232,10 +232,10 @@ ionic_dev_tx_queue_start(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
                err = ionic_lif_txq_init(txq);
                if (err)
                        return err;
+       } else {
+               ionic_qcq_enable(txq);
        }
 
-       ionic_qcq_enable(txq);
-
        tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;
@@ -988,6 +988,8 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
                err = ionic_lif_rxq_init(rxq);
                if (err)
                        return err;
+       } else {
+               ionic_qcq_enable(rxq);
        }
 
        /* Allocate buffers for descriptor rings */
@@ -997,8 +999,6 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
                return -1;
        }
 
-       ionic_qcq_enable(rxq);
-
        rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;