Message ID | 20201001000518.685243-1-kuba@kernel.org |
---|---|
Headers | show |
Series | genetlink: support per-command policy dump | expand |
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote: > We want to add maxattr and policy back to genl_ops, to enable > dumping per command policy to user space. This, however, would > cause bloat for all the families with global policies. Introduce > smaller version of ops (half the size of genl_ops). Translate > these smaller ops into a full blown struct before use in the > core. LGTM. That part about the WARN_ON was even easier than I thought :) Reviewed-by: Johannes Berg <johannes@sipsolutions.net> johannes
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote: > The structure of ctrl_dumppolicy() is clearly split into > init and dumping. Move the init to a .start callback > for clarity, it's a more idiomatic netlink dump code structure. Yep, makes sense. Reviewed-by: Johannes Berg <johannes@sipsolutions.net> johannes
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote: > Add policy to the struct genl_ops structure, this time > with maxattr, so it can be used properly. > > Propagate .policy and .maxattr from the family > in genl_get_cmd() if needed, this say the rest of the typo: "this way" > code does not have to worry if the policy is per op > or global. Maybe make 'taskstats', which I munged a bit in commit 3b0f31f2b8c9 ("genetlink: make policy common to family") go back to using per-command policy - properly this time with maxattr? But the code here looks good to me. Reviewed-by: Johannes Berg <johannes@sipsolutions.net> johannes