DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: revert fix traffic stall on stop/start
@ 2019-08-09 17:22 Lance Richardson
  2019-08-09 17:46 ` Ajit Khaparde
  0 siblings, 1 reply; 3+ messages in thread
From: Lance Richardson @ 2019-08-09 17:22 UTC (permalink / raw)
  To: dev; +Cc: ajit.khaparde, kalesh-anakkur.purayil, Lance Richardson

This reverts commit aa2c00702bad7b2c742e11a86cb9dbbb8364fd88, which
introduced the possibility of an invalid address exception when running
an application with a stopped receive queue. The issues with rxq stop/start
 will be revisited in the 19.11 release timeframe.

Fixes: aa2c00702bad ("net/bnxt: fix traffic stall on Rx queue stop/start")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
---
 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, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 25a345cd4..6685ee7d9 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 = rxq->rx_deferred_start;
+	qinfo->conf.rx_deferred_start = 0;
 }
 
 static void
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index a9fcdabe8..be15b4bd1 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -533,7 +533,8 @@ 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 (!rxq->rx_deferred_start) {
+	if (bp->eth_dev->data->rx_queue_state[queue_index] ==
+	    RTE_ETH_QUEUE_STATE_STARTED) {
 		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 723e85f01..1d95f1139 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -436,9 +436,11 @@ 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",
@@ -473,6 +475,7 @@ 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 ba8d39063..43b3496c1 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -131,7 +131,6 @@ 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 9adfee368..c71e6f189 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -506,6 +506,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;
 	PMD_DRV_LOG(DEBUG, "Tx queue stopped\n");
 
 	return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: revert fix traffic stall on stop/start
  2019-08-09 17:22 [dpdk-dev] [PATCH] net/bnxt: revert fix traffic stall on stop/start Lance Richardson
@ 2019-08-09 17:46 ` Ajit Khaparde
  2019-08-10 21:58   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ajit Khaparde @ 2019-08-09 17:46 UTC (permalink / raw)
  To: Lance Richardson; +Cc: dev, Kalesh Anakkur Purayil

On Fri, Aug 9, 2019 at 10:22 AM Lance Richardson <
lance.richardson@broadcom.com> wrote:

> This reverts commit aa2c00702bad7b2c742e11a86cb9dbbb8364fd88, which
> introduced the possibility of an invalid address exception when running
> an application with a stopped receive queue. The issues with rxq stop/start
>  will be revisited in the 19.11 release timeframe.
>
> Fixes: aa2c00702bad ("net/bnxt: fix traffic stall on Rx queue stop/start")
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>


> ---
>  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, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index 25a345cd4..6685ee7d9 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 = rxq->rx_deferred_start;
> +       qinfo->conf.rx_deferred_start = 0;
>  }
>
>  static void
> diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
> index a9fcdabe8..be15b4bd1 100644
> --- a/drivers/net/bnxt/bnxt_ring.c
> +++ b/drivers/net/bnxt/bnxt_ring.c
> @@ -533,7 +533,8 @@ 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 (!rxq->rx_deferred_start) {
> +       if (bp->eth_dev->data->rx_queue_state[queue_index] ==
> +           RTE_ETH_QUEUE_STATE_STARTED) {
>                 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 723e85f01..1d95f1139 100644
> --- a/drivers/net/bnxt/bnxt_rxq.c
> +++ b/drivers/net/bnxt/bnxt_rxq.c
> @@ -436,9 +436,11 @@ 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",
> @@ -473,6 +475,7 @@ 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 ba8d39063..43b3496c1 100644
> --- a/drivers/net/bnxt/bnxt_txq.c
> +++ b/drivers/net/bnxt/bnxt_txq.c
> @@ -131,7 +131,6 @@ 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 9adfee368..c71e6f189 100644
> --- a/drivers/net/bnxt/bnxt_txr.c
> +++ b/drivers/net/bnxt/bnxt_txr.c
> @@ -506,6 +506,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;
>         PMD_DRV_LOG(DEBUG, "Tx queue stopped\n");
>
>         return 0;
> --
> 2.17.1
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: revert fix traffic stall on stop/start
  2019-08-09 17:46 ` Ajit Khaparde
@ 2019-08-10 21:58   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2019-08-10 21:58 UTC (permalink / raw)
  To: Lance Richardson; +Cc: dev, Ajit Khaparde, Kalesh Anakkur Purayil, stable

09/08/2019 19:46, Ajit Khaparde:
> On Fri, Aug 9, 2019 at 10:22 AM Lance Richardson <
> lance.richardson@broadcom.com> wrote:
> 
> > This reverts commit aa2c00702bad7b2c742e11a86cb9dbbb8364fd88, which
> > introduced the possibility of an invalid address exception when running
> > an application with a stopped receive queue. The issues with rxq stop/start
> >  will be revisited in the 19.11 release timeframe.
> >
> > Fixes: aa2c00702bad ("net/bnxt: fix traffic stall on Rx queue stop/start")
> > Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> >
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Cc: stable@dpdk.org

Applied at last minute for 19.08



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-10 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 17:22 [dpdk-dev] [PATCH] net/bnxt: revert fix traffic stall on stop/start Lance Richardson
2019-08-09 17:46 ` Ajit Khaparde
2019-08-10 21:58   ` Thomas Monjalon

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