]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:19 +0000 (09:48 +0100)
commit416c49abdd093f424f445f43ecf8228d97e5b223
tree6d11288dec8140ad37d578f123e205898238a394
parent3f86188b425780ddd8f9310e47bb09a4bac0a660
net/mlx5: Publish and unpublish all devlink parameters at once

BugLink: https://bugs.launchpad.net/bugs/1951822
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c