]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: fix deferred start of Tx queues
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 2 Oct 2019 17:17:37 +0000 (10:17 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 8 Oct 2019 10:14:30 +0000 (12:14 +0200)
Driver should not change "deferred_start" state of the tx queues.
It should get the state in queue_setup_op() and use that value.

Since the deferred start state was being used in the packet transmit
functions to determine whether the queue has been stopped already,
introduced a per-txq flag to track queue stopped/started state.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
drivers/net/bnxt/bnxt_rxtx_vec_sse.c
drivers/net/bnxt/bnxt_txq.c
drivers/net/bnxt/bnxt_txq.h
drivers/net/bnxt/bnxt_txr.c

index 5ae812f3b9d3dc9b85b312f15b6de3542ccd80fb..029053e305983d66288428e97070a304b58dd4ab 100644 (file)
@@ -482,7 +482,7 @@ bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
        struct bnxt_tx_queue *txq = tx_queue;
 
        /* Tx queue was stopped; wait for it to be restarted */
-       if (unlikely(txq->tx_deferred_start)) {
+       if (unlikely(!txq->tx_started)) {
                PMD_DRV_LOG(DEBUG, "Tx q stopped;return\n");
                return 0;
        }
index 0901324793a70e3a836aa529007687e80c9fa055..ea20d737fe403fb36ecc76cc855ab18af11153bf 100644 (file)
@@ -131,6 +131,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
        txq->bp = bp;
        txq->nb_tx_desc = nb_desc;
        txq->tx_free_thresh = tx_conf->tx_free_thresh;
+       txq->tx_deferred_start = tx_conf->tx_deferred_start;
 
        rc = bnxt_init_tx_ring_struct(txq, socket_id);
        if (rc)
@@ -157,6 +158,10 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
        eth_dev->data->tx_queues[queue_idx] = txq;
 
+       if (txq->tx_deferred_start)
+               txq->tx_started = false;
+       else
+               txq->tx_started = true;
 out:
        return rc;
 }
index 9190e3f7314904cf0297f5b638609b83603af38b..7a442516d294f014abded51dd59de131f38961e0 100644 (file)
@@ -24,6 +24,7 @@ struct bnxt_tx_queue {
        uint8_t                 wthresh; /* Write-back threshold reg */
        uint32_t                ctx_curr; /* Hardware context states */
        uint8_t                 tx_deferred_start; /* not in global dev start */
+       uint8_t                 tx_started; /* TX queue is started */
 
        struct bnxt             *bp;
        int                     index;
index 172b480b2ea89842463b5355b96ccedff41b2841..99d20090553c35163d8a63cd6c0bddfc7adf16bf 100644 (file)
@@ -469,7 +469,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
        bnxt_handle_tx_cp(txq);
 
        /* Tx queue was stopped; wait for it to be restarted */
-       if (txq->tx_deferred_start) {
+       if (unlikely(!txq->tx_started)) {
                PMD_DRV_LOG(DEBUG, "Tx q stopped;return\n");
                return 0;
        }
@@ -518,7 +518,7 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
                return rc;
 
        dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED;
-       txq->tx_deferred_start = false;
+       txq->tx_started = true;
        PMD_DRV_LOG(DEBUG, "Tx queue started\n");
 
        return 0;
@@ -538,7 +538,7 @@ int bnxt_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
        bnxt_handle_tx_cp(txq);
 
        dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
-       txq->tx_deferred_start = true;
+       txq->tx_started = false;
        PMD_DRV_LOG(DEBUG, "Tx queue stopped\n");
 
        return 0;