* Stop device: disable rx and tx functions to allow for reconfiguring. */
| 600 | * Stop device: disable rx and tx functions to allow for reconfiguring. |
| 601 | */ |
| 602 | static int |
| 603 | atl_dev_stop(struct rte_eth_dev *dev) |
| 604 | { |
| 605 | struct rte_eth_link link; |
| 606 | struct aq_hw_s *hw = |
| 607 | ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 608 | struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); |
| 609 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 610 | |
| 611 | PMD_INIT_FUNC_TRACE(); |
| 612 | dev->data->dev_started = 0; |
| 613 | |
| 614 | /* disable interrupts */ |
| 615 | atl_disable_intr(hw); |
| 616 | |
| 617 | /* reset the NIC */ |
| 618 | atl_reset_hw(hw); |
| 619 | hw->adapter_stopped = 1; |
| 620 | |
| 621 | atl_stop_queues(dev); |
| 622 | |
| 623 | /* Clear stored conf */ |
| 624 | dev->data->scattered_rx = 0; |
| 625 | dev->data->lro = 0; |
| 626 | |
| 627 | /* Clear recorded link status */ |
| 628 | memset(&link, 0, sizeof(link)); |
| 629 | rte_eth_linkstatus_set(dev, &link); |
| 630 | |
| 631 | if (!rte_intr_allow_others(intr_handle)) |
| 632 | /* resume to the default handler */ |
| 633 | rte_intr_callback_register(intr_handle, |
| 634 | atl_dev_interrupt_handler, |
| 635 | (void *)dev); |
| 636 | |
| 637 | /* Clean datapath event and queue/vec mapping */ |
| 638 | rte_intr_efd_disable(intr_handle); |
| 639 | rte_intr_vec_list_free(intr_handle); |
| 640 | |
| 641 | return 0; |
| 642 | } |
| 643 | |
| 644 | /* |
| 645 | * Set device link up: enable tx. |
no test coverage detected