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

Function eth_dev_close

dpdk/drivers/net/pcap/pcap_ethdev.c:829–866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829static int
830eth_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
868static int
869eth_link_update(struct rte_eth_dev *dev __rte_unused,

Callers 1

pmd_pcap_removeFunction · 0.70

Calls 5

rte_socket_idFunction · 0.85
rte_freeFunction · 0.85
rte_eal_process_typeFunction · 0.85
infinite_rx_ring_freeFunction · 0.85
eth_dev_stopFunction · 0.70

Tested by

no test coverage detected