Skip to content

Commit 2d2a181

Browse files
Fix: incorrect cleanup of the stats alarm handler (#1198)
The current implementation may miss some of the registered statistics callbacks alarms causing segfault. The stats thread can run the statystics after stats_thread stopping MTL: stat_thread, stop MTL: * * M T D E V S T A T E * * MTL: * * E N D S T A T E * * Use the generic handler deregistration that ensures all registered callbacks are cleaned up properly.
1 parent f3a7ff0 commit 2d2a181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/mt_stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ int mt_stat_uinit(struct mtl_main_impl* impl) {
180180
mt_free(item);
181181
}
182182

183-
ret = rte_eal_alarm_cancel(stat_alarm_handler, impl);
183+
ret = rte_eal_alarm_cancel(stat_alarm_handler, (void*)-1);
184184
if (ret < 0) err("%s, alarm cancel fail %d\n", __func__, ret);
185185
if (mgr->stat_tid) {
186186
rte_atomic32_set(&mgr->stat_stop, 1);

0 commit comments

Comments
 (0)