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

Function ntb_dev_close

dpdk/drivers/raw/ntb/ntb.c:1032–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030}
1031
1032static int
1033ntb_dev_close(struct rte_rawdev *dev)
1034{
1035 struct ntb_hw *hw = dev->dev_private;
1036 struct rte_intr_handle *intr_handle;
1037 int i;
1038
1039 if (dev->started)
1040 ntb_dev_stop(dev);
1041
1042 /* free queues */
1043 for (i = 0; i < hw->queue_pairs; i++)
1044 ntb_queue_release(dev, i);
1045 hw->queue_pairs = 0;
1046
1047 intr_handle = hw->pci_dev->intr_handle;
1048 /* Disable interrupt only once */
1049 if (!rte_intr_nb_efd_get(intr_handle) &&
1050 !rte_intr_max_intr_get(intr_handle))
1051 return 0;
1052
1053 /* Clean datapath event and vec mapping */
1054 rte_intr_efd_disable(intr_handle);
1055 rte_intr_vec_list_free(intr_handle);
1056 /* Disable uio intr before callback unregister */
1057 rte_intr_disable(intr_handle);
1058
1059 /* Unregister callback func to eal lib */
1060 rte_intr_callback_unregister(intr_handle,
1061 ntb_dev_intr_handler, dev);
1062
1063 return 0;
1064}
1065
1066static int
1067ntb_dev_reset(struct rte_rawdev *rawdev __rte_unused)

Callers

nothing calls this directly

Calls 8

ntb_dev_stopFunction · 0.85
ntb_queue_releaseFunction · 0.85
rte_intr_nb_efd_getFunction · 0.85
rte_intr_max_intr_getFunction · 0.85
rte_intr_vec_list_freeFunction · 0.85
rte_intr_efd_disableFunction · 0.50
rte_intr_disableFunction · 0.50

Tested by

no test coverage detected