| 349 | } |
| 350 | |
| 351 | int |
| 352 | virtio_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 | |
| 385 | static int |
| 386 | virtio_dev_promiscuous_enable(struct rte_eth_dev *dev) |
no test coverage detected