| 1051 | } |
| 1052 | |
| 1053 | static int |
| 1054 | hn_dev_close(struct rte_eth_dev *dev) |
| 1055 | { |
| 1056 | int ret; |
| 1057 | struct hn_data *hv = dev->data->dev_private; |
| 1058 | struct hv_hotadd_context *hot_ctx; |
| 1059 | |
| 1060 | PMD_INIT_FUNC_TRACE(); |
| 1061 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 1062 | return 0; |
| 1063 | |
| 1064 | rte_spinlock_lock(&hv->hotadd_lock); |
| 1065 | while (!LIST_EMPTY(&hv->hotadd_list)) { |
| 1066 | hot_ctx = LIST_FIRST(&hv->hotadd_list); |
| 1067 | rte_eal_alarm_cancel(netvsc_hotplug_retry, hot_ctx); |
| 1068 | LIST_REMOVE(hot_ctx, list); |
| 1069 | rte_free(hot_ctx); |
| 1070 | } |
| 1071 | rte_spinlock_unlock(&hv->hotadd_lock); |
| 1072 | |
| 1073 | ret = hn_vf_close(dev); |
| 1074 | hn_dev_free_queues(dev); |
| 1075 | |
| 1076 | return ret; |
| 1077 | } |
| 1078 | |
| 1079 | /* |
| 1080 | * Setup connection between PMD and kernel. |
no test coverage detected