net/bnxt: fix to reset status of initialization
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 1 May 2018 01:06:13 +0000 (18:06 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:49 +0000 (22:31 +0100)
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 <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index cd5acc6..35d7c08 100644 (file)
@@ -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;
 }