From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BAD0DA10DA for ; Thu, 1 Aug 2019 17:45:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 417B31C1D6; Thu, 1 Aug 2019 17:45:27 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 6CAD11C1B7 for ; Thu, 1 Aug 2019 17:45:25 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id C88DF30C0CF; Thu, 1 Aug 2019 08:45:21 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com C88DF30C0CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1564674321; bh=5hC67XAw+/Ui04sh7UNlgG8n1BrZYr1wHsZY6eVvA8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+cfsliQVnuCP1FJhCxfH23h/Cy8K6UZrUCqIvi9EPJyGfc4ubG09sVB9ko2mFKfF 1O7OXi3fIQG7AjAnHgglGL2/pZ0q3dhzvCT+u8BlcI8A8GiWCM+dKKhzh7MO4r9Gej VWtJasQw2VZrfMpozk9+xU3b+G1g3FCLQstLkTGc= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.69.74.102]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 01420AC0765; Thu, 1 Aug 2019 08:45:21 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP Date: Thu, 1 Aug 2019 08:45:20 -0700 Message-Id: <20190801154520.80065-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190801152559.71141-1-ajit.khaparde@broadcom.com> References: <20190801152559.71141-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH V2] net/bnxt: fix traffic stall on RX queue stop/start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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") Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde --- v1->v2: Fixes was pointing to incorrect commit id. Fixing it. --- drivers/net/bnxt/bnxt_ethdev.c | 2 +- drivers/net/bnxt/bnxt_ring.c | 3 +-- drivers/net/bnxt/bnxt_rxq.c | 5 +---- drivers/net/bnxt/bnxt_txq.c | 1 + drivers/net/bnxt/bnxt_txr.c | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6685ee7d9..25a345cd4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -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 diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index be15b4bd1..a9fcdabe8 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -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"); diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index 1d95f1139..723e85f01 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -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) { diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c index 43b3496c1..ba8d39063 100644 --- a/drivers/net/bnxt/bnxt_txq.c +++ b/drivers/net/bnxt/bnxt_txq.c @@ -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, diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index c71e6f189..9adfee368 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -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; -- 2.20.1 (Apple Git-117)