net/bnxt: fix port start failure handling

Fixed to invoke clean up in the reverse sequence of
initialization in case any of the FW commands fail
during port start.

Fixes: 0b533591238f ("net/bnxt: inform firmware about IF state changes")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Kalesh AP 2020-04-21 14:33:48 -07:00 committed by Ferruh Yigit
parent ec16ad80c6
commit cf2445374c

View File

@ -1113,10 +1113,10 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
return 0;
error:
bnxt_hwrm_if_change(bp, false);
bnxt_shutdown_nic(bp);
bnxt_free_tx_mbufs(bp);
bnxt_free_rx_mbufs(bp);
bnxt_hwrm_if_change(bp, false);
eth_dev->data->dev_started = 0;
return rc;
}