]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Publish and unpublish all devlink parameters at once
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 14 Sep 2021 12:58:28 +0000 (15:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Sep 2021 15:12:55 +0000 (16:12 +0100)
commit33542cc7ea6797c12c939dc80cea3c1e0fe92664
tree080c567524fefabb1e3b2754d2fedf82ca0c5ec9
parent268769d7ddcaf580145dfc79baabecb022e0c1c9
net/mlx5: Publish and unpublish all devlink parameters at once

The devlink parameters were published in two steps despite being static
and known in advance.

First step was to use devlink_params_publish() which iterated over all
known up to that point parameters and sent notification messages.
In second step, the call was devlink_param_publish() that looped over
same parameters list and sent notification for new parameters.

In order to simplify the API, move devlink_params_publish() to be called
when all parameters were already added and save the need to iterate over
parameters list again.

As a side effect, this change fixes the error unwind flow in which
parameters were not marked as unpublished.

Fixes: f42c77610dad ("net/mlx5: Register to devlink ingress VLAN filter trap")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c