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

Function virtio_dev_close

dpdk/drivers/net/virtio/virtio_ethdev.c:351–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351int
352virtio_dev_close(struct rte_eth_dev *dev)
353{
354 struct virtio_hw *hw = dev->data->dev_private;
355 struct rte_eth_intr_conf *intr_conf = &dev->data->dev_conf.intr_conf;
356
357 PMD_INIT_LOG(DEBUG, "virtio_dev_close");
358 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
359 return 0;
360
361 if (!hw->opened)
362 return 0;
363 hw->opened = 0;
364
365 /* reset the NIC */
366 if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
367 VIRTIO_OPS(hw)->set_config_irq(hw, VIRTIO_MSI_NO_VECTOR);
368 if (intr_conf->rxq)
369 virtio_queues_unbind_intr(dev);
370
371 if (intr_conf->lsc || intr_conf->rxq) {
372 virtio_intr_disable(dev);
373 rte_intr_efd_disable(dev->intr_handle);
374 rte_intr_vec_list_free(dev->intr_handle);
375 }
376
377 virtio_reset(hw);
378 virtio_dev_free_mbufs(dev);
379 virtio_free_queues(hw);
380 virtio_free_rss(hw);
381
382 return VIRTIO_OPS(hw)->dev_close(hw);
383}
384
385static int
386virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)

Callers 1

eth_virtio_pci_uninitFunction · 0.85

Calls 9

rte_eal_process_typeFunction · 0.85
virtio_intr_disableFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
virtio_resetFunction · 0.85
virtio_dev_free_mbufsFunction · 0.85
virtio_free_queuesFunction · 0.85
virtio_free_rssFunction · 0.85
rte_intr_efd_disableFunction · 0.50

Tested by

no test coverage detected