Merge branch 'genetlink-provide-struct-genl_info-to-dumps'
authorJakub Kicinski <kuba@kernel.org>
Tue, 15 Aug 2023 22:01:03 +0000 (15:01 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Aug 2023 22:01:03 +0000 (15:01 -0700)
commitc65dffc6f25c59e3c637ab4e124f8686a08f3c15
tree5e2ed5a4d6937188be0b8b3f13746716ec5a50a3
parent479b322ee6feaff612285a0e7f22c022e8cd84eb
parentf946270d05c26044c67511ef5a9d91e06962d79f
Merge branch 'genetlink-provide-struct-genl_info-to-dumps'

Jakub Kicinski says:

====================
genetlink: provide struct genl_info to dumps

One of the biggest (which is not to say only) annoyances with genetlink
handling today is that doit and dumpit need some of the same information,
but it is passed to them in completely different structs.

The implementations commonly end up writing a _fill() method which
populates a message and have to pass at least 6 parameters. 3 of which
are extracted manually from request info.

After a lot of umming and ahing I decided to populate struct genl_info
for dumps, without trying to factor out only the common parts.
This makes the adoption easiest.

In the future we may add a new version of dump which takes
struct genl_info *info as the second argument, instead of
struct netlink_callback *cb. For now developers have to call
genl_info_dump(cb) to get the info.

Typical genetlink families no longer get exposed to netlink protocol
internals like pid and seq numbers.

v3:
 - correct the condition in ethtool code (patch 10)
v2: https://lore.kernel.org/all/20230810233845.2318049-1-kuba@kernel.org/
 - replace the GENL_INFO_NTF() macro with init helper
 - fix the commit messages
v1: https://lore.kernel.org/all/20230809182648.1816537-1-kuba@kernel.org/
====================

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