| 2549 | } |
| 2550 | |
| 2551 | static int |
| 2552 | ice_dev_stop(struct rte_eth_dev *dev) |
| 2553 | { |
| 2554 | struct rte_eth_dev_data *data = dev->data; |
| 2555 | struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); |
| 2556 | struct ice_vsi *main_vsi = pf->main_vsi; |
| 2557 | struct rte_pci_device *pci_dev = ICE_DEV_TO_PCI(dev); |
| 2558 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 2559 | uint16_t i; |
| 2560 | |
| 2561 | /* avoid stopping again */ |
| 2562 | if (pf->adapter_stopped) |
| 2563 | return 0; |
| 2564 | |
| 2565 | /* stop and clear all Rx queues */ |
| 2566 | for (i = 0; i < data->nb_rx_queues; i++) |
| 2567 | ice_rx_queue_stop(dev, i); |
| 2568 | |
| 2569 | /* stop and clear all Tx queues */ |
| 2570 | for (i = 0; i < data->nb_tx_queues; i++) |
| 2571 | ice_tx_queue_stop(dev, i); |
| 2572 | |
| 2573 | /* disable all queue interrupts */ |
| 2574 | ice_vsi_disable_queues_intr(main_vsi); |
| 2575 | |
| 2576 | if (pf->init_link_up) |
| 2577 | ice_dev_set_link_up(dev); |
| 2578 | else |
| 2579 | ice_dev_set_link_down(dev); |
| 2580 | |
| 2581 | /* Clean datapath event and queue/vec mapping */ |
| 2582 | rte_intr_efd_disable(intr_handle); |
| 2583 | rte_intr_vec_list_free(intr_handle); |
| 2584 | |
| 2585 | pf->adapter_stopped = true; |
| 2586 | dev->data->dev_started = 0; |
| 2587 | |
| 2588 | return 0; |
| 2589 | } |
| 2590 | |
| 2591 | static int |
| 2592 | ice_dev_close(struct rte_eth_dev *dev) |
no test coverage detected