Traverse the list of outstanding timers and put them back in the mempool * before freeing the adapter to avoid leaking the memory. */
| 1020 | * before freeing the adapter to avoid leaking the memory. |
| 1021 | */ |
| 1022 | static int |
| 1023 | swtim_uninit(struct rte_event_timer_adapter *adapter) |
| 1024 | { |
| 1025 | int ret; |
| 1026 | struct swtim *sw = swtim_pmd_priv(adapter); |
| 1027 | |
| 1028 | /* Free outstanding timers */ |
| 1029 | rte_timer_stop_all(sw->timer_data_id, |
| 1030 | (unsigned int *)(uintptr_t)sw->poll_lcores, |
| 1031 | sw->n_poll_lcores, |
| 1032 | swtim_free_tim, |
| 1033 | sw); |
| 1034 | |
| 1035 | ret = rte_timer_data_dealloc(sw->timer_data_id); |
| 1036 | if (ret < 0) { |
| 1037 | EVTIM_LOG_ERR("failed to deallocate timer data instance"); |
| 1038 | return ret; |
| 1039 | } |
| 1040 | |
| 1041 | ret = rte_service_component_unregister(sw->service_id); |
| 1042 | if (ret < 0) { |
| 1043 | EVTIM_LOG_ERR("failed to unregister service component"); |
| 1044 | return ret; |
| 1045 | } |
| 1046 | |
| 1047 | rte_mempool_free(sw->tim_pool); |
| 1048 | rte_free(sw); |
| 1049 | adapter->data->adapter_priv = NULL; |
| 1050 | |
| 1051 | return 0; |
| 1052 | } |
| 1053 | |
| 1054 | static inline int32_t |
| 1055 | get_mapped_count_for_service(uint32_t service_id) |
nothing calls this directly
no test coverage detected