| 1502 | } |
| 1503 | |
| 1504 | static int bnxt_dev_stop(struct rte_eth_dev *eth_dev) |
| 1505 | { |
| 1506 | struct bnxt *bp = eth_dev->data->dev_private; |
| 1507 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); |
| 1508 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 1509 | struct rte_eth_link link; |
| 1510 | uint16_t i; |
| 1511 | int ret; |
| 1512 | |
| 1513 | eth_dev->data->dev_started = 0; |
| 1514 | |
| 1515 | /* Prevent crashes when queues are still in use */ |
| 1516 | bnxt_stop_rxtx(eth_dev); |
| 1517 | |
| 1518 | bnxt_disable_int(bp); |
| 1519 | |
| 1520 | /* disable uio/vfio intr/eventfd mapping */ |
| 1521 | rte_intr_disable(intr_handle); |
| 1522 | |
| 1523 | /* Stop the child representors for this device */ |
| 1524 | ret = bnxt_rep_stop_all(bp); |
| 1525 | if (ret != 0) |
| 1526 | return ret; |
| 1527 | |
| 1528 | /* delete the bnxt ULP port details */ |
| 1529 | bnxt_ulp_port_deinit(bp); |
| 1530 | |
| 1531 | bnxt_cancel_fw_health_check(bp); |
| 1532 | |
| 1533 | if (BNXT_P5_PTP_TIMESYNC_ENABLED(bp)) |
| 1534 | bnxt_cancel_ptp_alarm(bp); |
| 1535 | |
| 1536 | /* Do not bring link down during reset recovery */ |
| 1537 | if (!is_bnxt_in_error(bp)) { |
| 1538 | bnxt_dev_set_link_down_op(eth_dev); |
| 1539 | /* Wait for link to be reset */ |
| 1540 | if (BNXT_SINGLE_PF(bp)) |
| 1541 | rte_delay_ms(500); |
| 1542 | /* clear the recorded link status */ |
| 1543 | memset(&link, 0, sizeof(link)); |
| 1544 | rte_eth_linkstatus_set(eth_dev, &link); |
| 1545 | } |
| 1546 | |
| 1547 | /* Clean queue intr-vector mapping */ |
| 1548 | rte_intr_efd_disable(intr_handle); |
| 1549 | rte_intr_vec_list_free(intr_handle); |
| 1550 | |
| 1551 | bnxt_hwrm_port_clr_stats(bp); |
| 1552 | bnxt_free_tx_mbufs(bp); |
| 1553 | bnxt_free_rx_mbufs(bp); |
| 1554 | /* Process any remaining notifications in default completion queue */ |
| 1555 | bnxt_int_handler(eth_dev); |
| 1556 | bnxt_shutdown_nic(bp); |
| 1557 | bnxt_hwrm_if_change(bp, false); |
| 1558 | |
| 1559 | bnxt_free_prev_ring_stats(bp); |
| 1560 | rte_free(bp->mark_table); |
| 1561 | bp->mark_table = NULL; |
no test coverage detected