]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Allocate devlink directly in requested net namespace
authorLeon Romanovsky <leonro@nvidia.com>
Thu, 29 Jul 2021 17:19:25 +0000 (20:19 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Jul 2021 20:16:38 +0000 (13:16 -0700)
commitf1a6f076cb4de9e94c6fadb64aa3957038a072ae
tree91c846c831266cdd737c0d3f5e78bc191558dfbe
parent5637bcf4b785fc66817346ca4337303c6c9aaa2d
devlink: Allocate devlink directly in requested net namespace

There is no need in extra call indirection and check from impossible
flow where someone tries to set namespace without prior call
to devlink_alloc().

Instead of this extra logic and additional EXPORT_SYMBOL, use specialized
devlink allocation function that receives net namespace as an argument.

Such specialized API allows clear view when devlink initialized in wrong
net namespace and/or kernel users don't try to change devlink namespace
under the hood.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/dev.c
include/net/devlink.h
net/core/devlink.c