path: root/drivers/net/mlx5/mlx5.h
diff options
authorViacheslav Ovsiienko <>2019-05-27 04:58:32 +0000
committerFerruh Yigit <>2019-06-06 20:21:20 +0900
commit5897ac139355e2d6602c89b0a1d28e609d6f6ebc (patch)
tree8f37960856152ec3c1a559304885ad4c1065e558 /drivers/net/mlx5/mlx5.h
parent0d51a5ec26ccca4582f4762854ac3b28208c4a04 (diff)
net/mlx5: fix event handler uninstall
When device is being closed and tries to unregister interrupt callback, there is a chance the handler is still active (called in context of eal_intr_thread_main thread). If so the rte_intr_callback_unregister returns -EAGAIN and keeps the handler registered, causing crash when underlaying resourse is gone away. This race condition may happen if event handling in application takes a long time. We should check the return code of unregistering routine and try again to unregister the handler. The diagnostic messages are shown once a second, while trying to unregister. Fixes: 028b2a28c3cb ("net/mlx5: update event handler for multiport IB devices") Cc: Signed-off-by: Viacheslav Ovsiienko <> Acked-by: Yongseok Koh <>
Diffstat (limited to 'drivers/net/mlx5/mlx5.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index caabdfc..01cfd65 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -438,6 +438,8 @@ void mlx5_nl_check_switch_info(bool nun_vf_set,
struct mlx5_switch_info *switch_info);
void mlx5_translate_port_name(const char *port_name_in,
struct mlx5_switch_info *port_info_out);
+void mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,
+ rte_intr_callback_fn cb_fn, void *cb_arg);
/* mlx5_mac.c */