]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'devlink-sanitize-per-port-region-creation-destruction'
authorJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 01:17:22 +0000 (18:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 1 Oct 2022 01:17:23 +0000 (18:17 -0700)
commit669158ce6e83bfb3586a1a99d7a69626d4956ba3
tree03eeb395f256a2b127980740d47c74ef6448ff95
parent1c590d038f419d918a542e3f303c86f3f9116c86
parenta8625931918e1b2e9af447a71ed2d3ad45209dfd
Merge branch 'devlink-sanitize-per-port-region-creation-destruction'

Jiri Pirko says:

====================
devlink: sanitize per-port region creation/destruction

Currently the only user of per-port devlink regions is DSA. All drivers
that use regions register them before devlink registration. For DSA,
this was not possible as the internals of struct devlink_port needed for
region creation are initialized during port registration.

This introduced a mismatch in creation flow of devlink and devlink port
regions. As you can see, it causes the DSA driver to make the port
init/exit flow a bit cumbersome.

Fix this by introducing port_init/fini() which could be optionally
called by drivers like DSA, to prepare struct devlink_port to be used
for region creation purposes before devlink port register is called.

Tested by Vladimir on his setup.
====================

Link: https://lore.kernel.org/r/20220929072902.2986539-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>