[2/6] net/ionic: combine queue init and enable commands
diff mbox series

Message ID 20210111190209.70928-3-aboyer@pensando.io
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • net/ionic: fix device configuration and init
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Boyer Jan. 11, 2021, 7:02 p.m. UTC
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  | 4 ++--
 drivers/net/ionic/ionic_rxtx.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

Patch
diff mbox series

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;