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 7DB0BA04B3; Tue, 28 Jan 2020 08:31:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A9AB81C11E; Tue, 28 Jan 2020 08:30:57 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 06C9E1C0C8 for ; Tue, 28 Jan 2020 08:30:49 +0100 (CET) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 474EF2904FB; Mon, 27 Jan 2020 23:30:48 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 474EF2904FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1580196648; bh=AKvERZg3cIIXimI3IZUJN7SqtRYNe5OTy5cJjfm/bM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CJTIVdOQtV6lmQX7bRlg+HBBi+8Hx9ZBRW3RcBV5y6uHWwGZ5kXOCrKIxyAdq5EmO ZUXtPBDmv+SjMKHhj+/zlwLL71Y0CSD4uspfvT+feWsDw825Sh2+swOQSoM7GFh2P9 NePzkz7IEHNT/lB1eYSfD/UqdDmSRbkxSfISF+Bc= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Tue, 28 Jan 2020 12:59:19 +0530 Message-Id: <20200128072923.9912-6-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200128072923.9912-1-somnath.kotur@broadcom.com> References: <20200128072923.9912-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 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") Reviewed-by: Santoshkumar Karanappa Rastapur Reviewed-by: Ajit Kumar Khaparde Signed-off-by: Somnath Kotur --- 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