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 <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
#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)
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);
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.
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,
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;
}