DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 5/9] net/bnxt: remove redundant macro
Date: Tue, 28 Jan 2020 12:59:19 +0530
Message-ID: <20200128072923.9912-6-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20200128072923.9912-1-somnath.kotur@broadcom.com>

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

Use "dev->data->dev_started" state, instead of local BNXT_FLAG_INIT_DONE
to check whether device has been initialised or not.

Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats")

Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        | 1 -
 drivers/net/bnxt/bnxt_ethdev.c | 2 --
 drivers/net/bnxt/bnxt_stats.c  | 4 ++--
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index bca9ad4..95f1f1a 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -520,7 +520,6 @@ struct bnxt {
 #define BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED	BIT(18)
 #define BNXT_FLAG_EXT_STATS_SUPPORTED		BIT(19)
 #define BNXT_FLAG_NEW_RM			BIT(20)
-#define BNXT_FLAG_INIT_DONE			BIT(21)
 #define BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS		BIT(22)
 #define BNXT_FLAG_ADV_FLOW_MGMT			BIT(23)
 #define BNXT_FLAG_RX_VECTOR_PKT_MODE		BIT(24)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 267a361..b04685c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -887,7 +887,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev);
 	eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);
 
-	bp->flags |= BNXT_FLAG_INIT_DONE;
 	eth_dev->data->dev_started = 1;
 	pthread_mutex_lock(&bp->def_cp_lock);
 	bnxt_schedule_fw_health_check(bp);
@@ -947,7 +946,6 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 
 	bnxt_cancel_fw_health_check(bp);
 
-	bp->flags &= ~BNXT_FLAG_INIT_DONE;
 	bnxt_dev_set_link_down_op(eth_dev);
 
 	/* Wait for link to be reset and the async notification to process.
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 32f112b..4668629 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -389,7 +389,7 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	if (rc)
 		return rc;
 
-	if (!(bp->flags & BNXT_FLAG_INIT_DONE))
+	if (!eth_dev->data->dev_started)
 		return -EIO;
 
 	num_q_stats = RTE_MIN(bp->rx_cp_nr_rings,
@@ -434,7 +434,7 @@ int bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 	if (ret)
 		return ret;
 
-	if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
+	if (!eth_dev->data->dev_started) {
 		PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
 		return -EINVAL;
 	}
-- 
1.8.3.1


  parent reply	other threads:[~2020-01-28  7:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-28  7:29 [dpdk-dev] [PATCH v2 0/9] bnxt patchset Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 1/9] net/bnxt: fix bnxt_alloc_filter() to use a common routine Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 2/9] net/bnxt: fix bumping of L2 filter reference count Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 3/9] net/bnxt: fix to allow group ID 0 for RSS action Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 4/9] net/bnxt: remove redundant if statement Somnath Kotur
2020-01-28  7:29 ` Somnath Kotur [this message]
2020-01-28  7:29 ` [dpdk-dev] [PATCH 6/9] net/bnxt: remove unnecessary structure variable Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 7/9] net/bnxt: remove a redundant variable Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 8/9] net/bnxt: fix to support zero mark id along with RSS action Somnath Kotur
2020-01-28  7:29 ` [dpdk-dev] [PATCH 9/9] net/bnxt: fix coverity warnings Somnath Kotur
2020-01-28 21:01 ` [dpdk-dev] [PATCH v3 0/9] bnxt patch set Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 1/9] net/bnxt: fix alloc filter to use a common routine Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 2/9] net/bnxt: fix bumping of L2 filter reference count Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 3/9] net/bnxt: fix to allow group ID 0 for RSS action Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 4/9] net/bnxt: remove redundant if statement Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 5/9] net/bnxt: remove redundant macro Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 6/9] net/bnxt: remove unnecessary structure variable Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 7/9] net/bnxt: remove a redundant variable Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 8/9] net/bnxt: fix to support zero mark id along with RSS action Ajit Khaparde
2020-01-28 21:01   ` [dpdk-dev] [PATCH v3 9/9] net/bnxt: fix coverity warnings Ajit Khaparde
2020-01-29 12:30     ` Ferruh Yigit
2020-01-28 21:07   ` [dpdk-dev] [PATCH v3 0/9] bnxt patch set 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=20200128072923.9912-6-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git