OSDN Git Service

net/mlx5: Rename events notifier header
authorAya Levin <ayal@nvidia.com>
Tue, 26 Jan 2021 23:24:10 +0000 (15:24 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Jan 2021 03:53:51 +0000 (19:53 -0800)
Change the naming of events notifier head to clarify that it handles
only firmware events. Coming patches in the set, add event notifier for
software events.

Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/events.c

index 3ce17c3..054c0bc 100644 (file)
@@ -23,7 +23,7 @@ static int temp_warn(struct notifier_block *, unsigned long, void *);
 static int port_module(struct notifier_block *, unsigned long, void *);
 static int pcie_core(struct notifier_block *, unsigned long, void *);
 
-/* handler which forwards the event to events->nh, driver notifiers */
+/* handler which forwards the event to events->fw_nh, driver notifiers */
 static int forward_event(struct notifier_block *, unsigned long, void *);
 
 static struct mlx5_nb events_nbs_ref[] = {
@@ -55,8 +55,8 @@ struct mlx5_events {
        struct mlx5_core_dev *dev;
        struct workqueue_struct *wq;
        struct mlx5_event_nb  notifiers[ARRAY_SIZE(events_nbs_ref)];
-       /* driver notifier chain */
-       struct atomic_notifier_head nh;
+       /* driver notifier chain for fw events */
+       struct atomic_notifier_head fw_nh;
        /* port module events stats */
        struct mlx5_pme_stats pme_stats;
        /*pcie_core*/
@@ -331,7 +331,7 @@ static int forward_event(struct notifier_block *nb, unsigned long event, void *d
 
        mlx5_core_dbg(events->dev, "Async eqe type %s, subtype (%d) forward to interfaces\n",
                      eqe_type_str(eqe->type), eqe->sub_type);
-       atomic_notifier_call_chain(&events->nh, event, data);
+       atomic_notifier_call_chain(&events->fw_nh, event, data);
        return NOTIFY_OK;
 }
 
@@ -342,7 +342,7 @@ int mlx5_events_init(struct mlx5_core_dev *dev)
        if (!events)
                return -ENOMEM;
 
-       ATOMIC_INIT_NOTIFIER_HEAD(&events->nh);
+       ATOMIC_INIT_NOTIFIER_HEAD(&events->fw_nh);
        events->dev = dev;
        dev->priv.events = events;
        events->wq = create_singlethread_workqueue("mlx5_events");
@@ -383,11 +383,14 @@ void mlx5_events_stop(struct mlx5_core_dev *dev)
        flush_workqueue(events->wq);
 }
 
+/* This API is used only for processing and forwarding firmware
+ * events to mlx5 consumer.
+ */
 int mlx5_notifier_register(struct mlx5_core_dev *dev, struct notifier_block *nb)
 {
        struct mlx5_events *events = dev->priv.events;
 
-       return atomic_notifier_chain_register(&events->nh, nb);
+       return atomic_notifier_chain_register(&events->fw_nh, nb);
 }
 EXPORT_SYMBOL(mlx5_notifier_register);
 
@@ -395,11 +398,11 @@ int mlx5_notifier_unregister(struct mlx5_core_dev *dev, struct notifier_block *n
 {
        struct mlx5_events *events = dev->priv.events;
 
-       return atomic_notifier_chain_unregister(&events->nh, nb);
+       return atomic_notifier_chain_unregister(&events->fw_nh, nb);
 }
 EXPORT_SYMBOL(mlx5_notifier_unregister);
 
 int mlx5_notifier_call_chain(struct mlx5_events *events, unsigned int event, void *data)
 {
-       return atomic_notifier_call_chain(&events->nh, event, data);
+       return atomic_notifier_call_chain(&events->fw_nh, event, data);
 }