| 1699 | } |
| 1700 | |
| 1701 | static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev) |
| 1702 | { |
| 1703 | struct bnxt *bp = eth_dev->data->dev_private; |
| 1704 | int ret = 0; |
| 1705 | |
| 1706 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 1707 | return 0; |
| 1708 | |
| 1709 | pthread_mutex_lock(&bp->err_recovery_lock); |
| 1710 | if (bp->flags & BNXT_FLAG_FW_RESET) { |
| 1711 | PMD_DRV_LOG(ERR, |
| 1712 | "Adapter recovering from error...Please retry\n"); |
| 1713 | pthread_mutex_unlock(&bp->err_recovery_lock); |
| 1714 | return -EAGAIN; |
| 1715 | } |
| 1716 | pthread_mutex_unlock(&bp->err_recovery_lock); |
| 1717 | |
| 1718 | /* cancel the recovery handler before remove dev */ |
| 1719 | rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp); |
| 1720 | rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp); |
| 1721 | bnxt_cancel_fc_thread(bp); |
| 1722 | rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp); |
| 1723 | |
| 1724 | if (eth_dev->data->dev_started) |
| 1725 | ret = bnxt_dev_stop(eth_dev); |
| 1726 | |
| 1727 | bnxt_uninit_resources(bp, false); |
| 1728 | |
| 1729 | bnxt_drv_uninit(bp); |
| 1730 | |
| 1731 | return ret; |
| 1732 | } |
| 1733 | |
| 1734 | static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, |
| 1735 | uint32_t index) |
no test coverage detected