net/bnxt: fix traffic stall on Rx queue stop/start
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Thu, 1 Aug 2019 15:45:20 +0000 (08:45 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Aug 2019 21:33:12 +0000 (23:33 +0200)
Fixed a check in bnxt_alloc_hwrm_rx_ring() while initializing
the rx ring.

Driver should not change "deferred_start" status of rx/tx queues.
It should get the status in queue_setup_op() and use that value.

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>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_ring.c
drivers/net/bnxt/bnxt_rxq.c
drivers/net/bnxt/bnxt_txq.c
drivers/net/bnxt/bnxt_txr.c

index 6685ee7..25a345c 100644 (file)
@@ -1754,7 +1754,7 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 
        qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
        qinfo->conf.rx_drop_en = 0;
-       qinfo->conf.rx_deferred_start = 0;
+       qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
 }
 
 static void
index be15b4b..a9fcdab 100644 (file)
@@ -533,8 +533,7 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index)
        rxq->rx_buf_use_size = BNXT_MAX_MTU + RTE_ETHER_HDR_LEN +
                RTE_ETHER_CRC_LEN + (2 * VLAN_TAG_SIZE);
 
-       if (bp->eth_dev->data->rx_queue_state[queue_index] ==
-           RTE_ETH_QUEUE_STATE_STARTED) {
+       if (!rxq->rx_deferred_start) {
                if (bnxt_init_one_rx_ring(rxq)) {
                        RTE_LOG(ERR, PMD,
                                "bnxt_init_one_rx_ring failed!\n");
index 1d95f11..723e85f 100644 (file)
@@ -436,11 +436,9 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
                rc = bnxt_vnic_rss_configure(bp, vnic);
        }
 
-       if (rc == 0) {
+       if (rc == 0)
                dev->data->rx_queue_state[rx_queue_id] =
                                RTE_ETH_QUEUE_STATE_STARTED;
-               rxq->rx_deferred_start = false;
-       }
 
        PMD_DRV_LOG(INFO,
                    "queue %d, rx_deferred_start %d, state %d!\n",
@@ -475,7 +473,6 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        }
 
        dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;
-       rxq->rx_deferred_start = true;
        PMD_DRV_LOG(DEBUG, "Rx queue stopped\n");
 
        if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
index 43b3496..ba8d390 100644 (file)
@@ -131,6 +131,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
        txq->queue_id = queue_idx;
        txq->port_id = eth_dev->data->port_id;
+       txq->tx_deferred_start = tx_conf->tx_deferred_start;
 
        /* Allocate TX ring hardware descriptors */
        if (bnxt_alloc_rings(bp, queue_idx, txq, NULL, txq->cp_ring,
index c71e6f1..9adfee3 100644 (file)
@@ -506,7 +506,6 @@ 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;
        PMD_DRV_LOG(DEBUG, "Tx queue stopped\n");
 
        return 0;