[dpdk-dev] [PATCH 2/6] net/ionic: combine queue init and enable commands

Andrew Boyer aboyer at pensando.io
Mon Jan 11 20:02:05 CET 2021


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 at pensando.io>
Signed-off-by: Neel Patel <neel at pensando.io>
---
 drivers/net/ionic/ionic_lif.c  | 4 ++--
 drivers/net/ionic/ionic_rxtx.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index ed1595e62..673f789f3 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -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,
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index cf7ff6ce7..5d0e9d5d5 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -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;
-- 
2.17.1



More information about the dev mailing list