[1/6] net/bnxt: add missing checks for fw reset

Message ID 20191113082945.21277-2-somnath.kotur@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt patchset with bug fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Somnath Kotur Nov. 13, 2019, 8:29 a.m. UTC
  From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Driver should fail the eth_dev_ops callbacks and accessing
Tx and Rx queues when device is in reset or in error state.
Added missing checks for fw reset in few routines.

Fixes: be14720def9c ("net/bnxt: support FW reset")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b9b055e71..9aff38298 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2063,8 +2063,12 @@  static void
 bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 	struct rte_eth_rxq_info *qinfo)
 {
+	struct bnxt *bp = dev->data->dev_private;
 	struct bnxt_rx_queue *rxq;
 
+	if (is_bnxt_in_error(bp))
+		return;
+
 	rxq = dev->data->rx_queues[queue_id];
 
 	qinfo->mp = rxq->mb_pool;
@@ -2080,8 +2084,12 @@  static void
 bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo)
 {
+	struct bnxt *bp = dev->data->dev_private;
 	struct bnxt_tx_queue *txq;
 
+	if (is_bnxt_in_error(bp))
+		return;
+
 	txq = dev->data->tx_queues[queue_id];
 
 	qinfo->nb_desc = txq->nb_tx_desc;