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

Function swtim_uninit

dpdk/lib/eventdev/rte_event_timer_adapter.c:1022–1052  ·  view source on GitHub ↗

Traverse the list of outstanding timers and put them back in the mempool * before freeing the adapter to avoid leaking the memory. */

Source from the content-addressed store, hash-verified

1020 * before freeing the adapter to avoid leaking the memory.
1021 */
1022static int
1023swtim_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
1054static inline int32_t
1055get_mapped_count_for_service(uint32_t service_id)

Callers

nothing calls this directly

Calls 6

swtim_pmd_privFunction · 0.85
rte_timer_stop_allFunction · 0.85
rte_timer_data_deallocFunction · 0.85
rte_mempool_freeFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected