From: Ajit Khaparde Date: Tue, 1 May 2018 01:06:13 +0000 (-0700) Subject: net/bnxt: fix to reset status of initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e40981101925a2b4403c8760658e6e7b36c35cfa;p=dpdk.git net/bnxt: fix to reset status of initialization clear flag on stop at proper location to avoid race conditions. Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index cd5acc6c1e..35d7c08500 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -648,13 +648,13 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; + bp->flags &= ~BNXT_FLAG_INIT_DONE; if (bp->eth_dev->data->dev_started) { /* TBD: STOP HW queues DMA */ eth_dev->data->dev_link.link_status = 0; } bnxt_set_hwrm_link_config(bp, false); bnxt_hwrm_port_clr_stats(bp); - bp->flags &= ~BNXT_FLAG_INIT_DONE; bnxt_shutdown_nic(bp); bp->dev_stopped = 1; }