From b5d9a4f0d1b035306c1fa17231a18927a19dc363 Mon Sep 17 00:00:00 2001 From: Andrew Boyer Date: Mon, 11 Jan 2021 11:02:05 -0800 Subject: [PATCH] net/ionic: combine queue init and enable commands 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 Signed-off-by: Neel Patel --- 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 ed1595e62b..673f789f3f 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 cf7ff6ce7a..5d0e9d5d5a 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.20.1