OSDN Git Service

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)
commite9310aed8e6a5003abb2aa6b9229d2fb9ceb9e85
tree080c567524fefabb1e3b2754d2fedf82ca0c5ec9
parentdc50b930be89b82acc21bdefd24df863e47d5cf1
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: 82e6c96f04e1 ("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