diff mbox series

[v3,6/9] net/ionic: convert 'deferred' boolean to a flag bit

Message ID 20201204201646.51746-7-aboyer@pensando.io (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series net/ionic: minor updates and documentation | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Boyer Dec. 4, 2020, 8:16 p.m. UTC
This conserves resources.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
---
 drivers/net/ionic/ionic_lif.c  |  4 ++--
 drivers/net/ionic/ionic_lif.h  |  2 +-
 drivers/net/ionic/ionic_rxtx.c | 10 ++++++----
 3 files changed, 9 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index bc15d75fd..2e33fb8d9 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -1590,7 +1590,7 @@  ionic_lif_start(struct ionic_lif *lif)
 
 	for (i = 0; i < lif->nrxqcqs; i++) {
 		struct ionic_qcq *rxq = lif->rxqcqs[i];
-		if (!rxq->deferred_start) {
+		if (!(rxq->flags & IONIC_QCQ_F_DEFERRED)) {
 			err = ionic_dev_rx_queue_start(lif->eth_dev, i);
 
 			if (err)
@@ -1600,7 +1600,7 @@  ionic_lif_start(struct ionic_lif *lif)
 
 	for (i = 0; i < lif->ntxqcqs; i++) {
 		struct ionic_qcq *txq = lif->txqcqs[i];
-		if (!txq->deferred_start) {
+		if (!(txq->flags & IONIC_QCQ_F_DEFERRED)) {
 			err = ionic_dev_tx_queue_start(lif->eth_dev, i);
 
 			if (err)
diff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h
index 4e091719f..8e2b42443 100644
--- a/drivers/net/ionic/ionic_lif.h
+++ b/drivers/net/ionic/ionic_lif.h
@@ -50,6 +50,7 @@  struct ionic_rx_stats {
 #define IONIC_QCQ_F_SG		BIT(1)
 #define IONIC_QCQ_F_INTR	BIT(2)
 #define IONIC_QCQ_F_NOTIFYQ	BIT(3)
+#define IONIC_QCQ_F_DEFERRED	BIT(4)
 
 /* Queue / Completion Queue */
 struct ionic_qcq {
@@ -68,7 +69,6 @@  struct ionic_qcq {
 	uint32_t total_size;
 	uint32_t flags;
 	struct ionic_intr_info intr;
-	bool deferred_start;
 };
 
 #define IONIC_Q_TO_QCQ(q)	container_of(q, struct ionic_qcq, q)
diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c
index 2592f5cab..b953aff49 100644
--- a/drivers/net/ionic/ionic_rxtx.c
+++ b/drivers/net/ionic/ionic_rxtx.c
@@ -64,7 +64,7 @@  ionic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	qinfo->nb_desc = q->num_descs;
 	qinfo->conf.offloads = txq->offloads;
-	qinfo->conf.tx_deferred_start = txq->deferred_start;
+	qinfo->conf.tx_deferred_start = txq->flags & IONIC_QCQ_F_DEFERRED;
 }
 
 static inline void __rte_cold
@@ -196,7 +196,8 @@  ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
 	}
 
 	/* Do not start queue with rte_eth_dev_start() */
-	txq->deferred_start = tx_conf->tx_deferred_start;
+	if (tx_conf->tx_deferred_start)
+		txq->flags |= IONIC_QCQ_F_DEFERRED;
 
 	txq->offloads = offloads;
 
@@ -605,7 +606,7 @@  ionic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->mp = rxq->mb_pool;
 	qinfo->scattered_rx = dev->data->scattered_rx;
 	qinfo->nb_desc = q->num_descs;
-	qinfo->conf.rx_deferred_start = rxq->deferred_start;
+	qinfo->conf.rx_deferred_start = rxq->flags & IONIC_QCQ_F_DEFERRED;
 	qinfo->conf.offloads = rxq->offloads;
 }
 
@@ -703,7 +704,8 @@  ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	 */
 
 	/* Do not start queue with rte_eth_dev_start() */
-	rxq->deferred_start = rx_conf->rx_deferred_start;
+	if (rx_conf->rx_deferred_start)
+		rxq->flags |= IONIC_QCQ_F_DEFERRED;
 
 	rxq->offloads = offloads;