| 827 | } |
| 828 | |
| 829 | static int |
| 830 | eth_dev_close(struct rte_eth_dev *dev) |
| 831 | { |
| 832 | unsigned int i; |
| 833 | struct pmd_internals *internals = dev->data->dev_private; |
| 834 | |
| 835 | PMD_LOG(INFO, "Closing pcap ethdev on NUMA socket %d", |
| 836 | rte_socket_id()); |
| 837 | |
| 838 | eth_dev_stop(dev); |
| 839 | |
| 840 | rte_free(dev->process_private); |
| 841 | |
| 842 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 843 | return 0; |
| 844 | |
| 845 | /* Device wide flag, but cleanup must be performed per queue. */ |
| 846 | if (internals->infinite_rx) { |
| 847 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 848 | struct pcap_rx_queue *pcap_q = &internals->rx_queue[i]; |
| 849 | |
| 850 | /* |
| 851 | * 'pcap_q->pkts' can be NULL if 'eth_dev_close()' |
| 852 | * called before 'eth_rx_queue_setup()' has been called |
| 853 | */ |
| 854 | if (pcap_q->pkts == NULL) |
| 855 | continue; |
| 856 | |
| 857 | infinite_rx_ring_free(pcap_q->pkts); |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | if (internals->phy_mac == 0) |
| 862 | /* not dynamically allocated, must not be freed */ |
| 863 | dev->data->mac_addrs = NULL; |
| 864 | |
| 865 | return 0; |
| 866 | } |
| 867 | |
| 868 | static int |
| 869 | eth_link_update(struct rte_eth_dev *dev __rte_unused, |
no test coverage detected