net/mlx5: Forward all mlx5 events to mlx5 notifiers chain
authorSaeed Mahameed <saeedm@mellanox.com>
Mon, 26 Nov 2018 22:38:59 +0000 (14:38 -0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 30 Nov 2018 00:40:31 +0000 (16:40 -0800)
This to allow seamless migration to the new notifier chain API, and to
eventually deprecate interfaces dev->event callback.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/dev.c
include/linux/mlx5/driver.h

index 7eedbea38a78500f2c9f15574f34452d8582d5ea..d63ba8813829dea90a53b4b5158b0deb2487c985 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <linux/mlx5/driver.h>
 #include "mlx5_core.h"
+#include "lib/mlx5.h"
 
 static LIST_HEAD(intf_list);
 static LIST_HEAD(mlx5_dev_list);
@@ -425,6 +426,8 @@ void mlx5_core_event(struct mlx5_core_dev *dev, enum mlx5_dev_event event,
                        dev_ctx->intf->event(dev, dev_ctx->context, event, param);
 
        spin_unlock_irqrestore(&priv->ctx_lock, flags);
+
+       mlx5_notifier_call_chain(dev->priv.events, event, (void *)param);
 }
 
 void mlx5_dev_list_lock(void)
index b96929d0cc9c176c12e4004d04e70c144ff58266..14ca7470727559d45dfe654c33a472c531a501a4 100644 (file)
@@ -195,7 +195,7 @@ struct mlx5_rsc_debug {
 };
 
 enum mlx5_dev_event {
-       MLX5_DEV_EVENT_SYS_ERROR,
+       MLX5_DEV_EVENT_SYS_ERROR = 128, /* 0 - 127 are FW events */
        MLX5_DEV_EVENT_PORT_UP,
        MLX5_DEV_EVENT_PORT_DOWN,
        MLX5_DEV_EVENT_PORT_INITIALIZED,