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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:23 +0000 (19:16 +0100)
commit0a97e2fb96906424c1a3dd24cb184e3725601c81
tree418f5c0b0abdf684c9058ce8f1bb1a1219e5cffb
parentd9b17a030a1bd165a4e396340e7d442f63cfa36c
net/mlx5: Publish and unpublish all devlink parameters at once

[ Upstream commit e9310aed8e6a5003abb2aa6b9229d2fb9ceb9e85 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c