patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: stable@dpdk.org
Cc: ktraynor@redhat.com
Subject: [dpdk-stable] [PATCH 18.11 18/19] net/bnxt: fix deferred start of Tx queues
Date: Wed, 18 Dec 2019 11:54:10 +0530	[thread overview]
Message-ID: <20191218062411.13079-19-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20191218062411.13079-1-somnath.kotur@broadcom.com>

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

[ upstream commit aa2c00702bad7b2c742e11a86cb9dbbb8364fd88 ]
[ upstream commit 3955e26870bcc3336c87d1fabe6ebdf18b2a337b ]

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")

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_txq.c | 6 ++++++
 drivers/net/bnxt/bnxt_txq.h | 1 +
 drivers/net/bnxt/bnxt_txr.c | 6 +++---
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index b76ad05..cf6ddfb 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -113,6 +113,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)
@@ -139,6 +140,11 @@ 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;
 }
diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h
index 720ca90..29b90bf 100644
--- a/drivers/net/bnxt/bnxt_txq.h
+++ b/drivers/net/bnxt/bnxt_txq.h
@@ -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;
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 95272c9..348b111 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -418,7 +418,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;
 	}
@@ -448,7 +448,7 @@ int bnxt_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
 	struct bnxt_tx_queue *txq = bp->tx_queues[tx_queue_id];
 
 	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;
@@ -463,7 +463,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;
-- 
2.10.1


  parent reply	other threads:[~2019-12-18  6:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  6:23 [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 01/19] net/bnxt: fix setting default MAC address Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 02/19] net/bnxt: fix error checking of FW commands Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 03/19] net/bnxt: fix check of address mapping Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 04/19] net/bnxt: fix stats errors handling Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 05/19] net/bnxt: move macro definitions to header file Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 06/19] net/bnxt: fix extended port counter statistics Somnath Kotur
2019-12-18  6:23 ` [dpdk-stable] [PATCH 18.11 07/19] net/bnxt: fix VF probe when MAC address is zero Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 08/19] net/bnxt: fix coding style Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 09/19] net/bnxt: fix async link handling and update Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 10/19] net/bnxt: fix flow flush handling Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 11/19] net/bnxt: update trusted VF status only when it changes Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 12/19] net/bnxt: fix doorbell register offset for Tx ring Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 13/19] net/bnxt: get default HWRM command timeout from FW Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 14/19] net/bnxt: fix MAC/VLAN filter allocation Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 15/19] net/bnxt: fix forwarding with higher mbuf size Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 16/19] net/bnxt: fix crash after removing and adding slaves Somnath Kotur
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 17/19] net/bnxt: fix Rx queue count Somnath Kotur
2019-12-18  6:24 ` Somnath Kotur [this message]
2019-12-18 10:21   ` [dpdk-stable] [PATCH 18.11 18/19] net/bnxt: fix deferred start of Tx queues Kevin Traynor
2019-12-18  6:24 ` [dpdk-stable] [PATCH 18.11 19/19] net/bnxt: fix rx queue start/stop Somnath Kotur
2019-12-18 11:22 ` [dpdk-stable] [PATCH 18.11 00/19] bnxt patchset for 18.11 Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218062411.13079-19-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=ktraynor@redhat.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).