From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFF03A04B3; Tue, 28 Jan 2020 22:03:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75A5B1D5D6; Tue, 28 Jan 2020 22:02:17 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 7E7E71D5A4; Tue, 28 Jan 2020 22:02:06 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 72EA530C1FF; Tue, 28 Jan 2020 12:55:11 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 72EA530C1FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1580244911; bh=ir0ALk99VFwrnFjGsa1888YpcADG2rgCE0c9rWEtA0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XN5q/ikm5WSEW1U0R8lBQeGAgg8IpBA/HYNAG9LJnMDxNBj89JXx729l5yk4bjoCZ LikTbzU0+HMu9nvRiZmSLMDC0773R8uYhXUgjgsJmE9EEzdJsWVDkz12jlzLbDumd+ 1NjnVnX7ApgBMgPHOBpnaQUxjtP9y9RHrhavxHBo= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.69.74.102]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 00C2214008B; Tue, 28 Jan 2020 13:02:04 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , stable@dpdk.org, Santoshkumar Karanappa Rastapur , Somnath Kotur Date: Tue, 28 Jan 2020 13:01:55 -0800 Message-Id: <20200128210159.6972-6-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) In-Reply-To: <20200128210159.6972-1-ajit.khaparde@broadcom.com> References: <20200128072923.9912-1-somnath.kotur@broadcom.com> <20200128210159.6972-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 5/9] net/bnxt: remove redundant macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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") Cc: stable@dpdk.org Reviewed-by: Santoshkumar Karanappa Rastapur Reviewed-by: Ajit Khaparde Signed-off-by: Somnath Kotur Signed-off-by: Kalesh AP --- 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 bca9ad418..95f1f1a20 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 267a36148..b04685cea 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 32f112b5b..466862995 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; } -- 2.21.0 (Apple Git-122.2)