DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com,
	Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 1/6] net/bnxt: add missing checks for firmware reset
Date: Wed, 13 Nov 2019 07:06:55 -0800	[thread overview]
Message-ID: <20191113150700.2517-2-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20191113150700.2517-1-ajit.khaparde@broadcom.com>

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

Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e39b87365..94dbe2f1d 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2067,8 +2067,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;
@@ -2084,8 +2088,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;
-- 
2.21.0 (Apple Git-122.2)


  reply	other threads:[~2019-11-13 15:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  8:29 [dpdk-dev] [PATCH 0/6] bnxt patchset with bug fixes Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add missing checks for fw reset Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to cap queue count for NS3/Stingray devices Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 3/6] net/bnxt: fix flow creation with non-consecutive group ids Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix a potential segfault in xstats get Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 5/6] net/bnxt: change print message type from ERR to DEBUG Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 6/6] net/bnxt: fix potential NULL pointer dereference Somnath Kotur
2019-11-13 15:06 ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde
2019-11-13 15:06   ` Ajit Khaparde [this message]
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 2/6] net/bnxt: cap queue count for NS3/Stingray devices Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 3/6] net/bnxt: fix flow creation with non-consecutive group ids Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 5/6] net/bnxt: change print message type from ERR to DEBUG Ajit Khaparde
2019-11-13 15:07   ` [dpdk-dev] [PATCH v2 6/6] net/bnxt: fix potential NULL pointer dereference Ajit Khaparde
2019-11-13 15:14   ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde

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=20191113150700.2517-2-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=santosh.rastapur@broadcom.com \
    /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).