MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bnxt_dev_stop

Function bnxt_dev_stop

dpdk/drivers/net/bnxt/bnxt_ethdev.c:1504–1577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1502}
1503
1504static 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;

Callers 5

bnxt_dev_stop_opFunction · 0.85
bnxt_dev_start_opFunction · 0.85
bnxt_dev_close_opFunction · 0.85
bnxt_dev_cleanupFunction · 0.85
bnxt_dev_recoverFunction · 0.85

Calls 15

bnxt_stop_rxtxFunction · 0.85
bnxt_disable_intFunction · 0.85
bnxt_rep_stop_allFunction · 0.85
bnxt_ulp_port_deinitFunction · 0.85
bnxt_cancel_ptp_alarmFunction · 0.85
is_bnxt_in_errorFunction · 0.85
rte_delay_msFunction · 0.85
memsetFunction · 0.85
rte_eth_linkstatus_setFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85

Tested by

no test coverage detected