Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Jakub Kicinski
On Thu, 01 Oct 2020 18:57:35 +0200 Johannes Berg wrote: > On Thu, 2020-10-01 at 09:24 -0700, Jakub Kicinski wrote: > > > I guess the most compact representation, that also preserves the most > > > data about sharing, would be to do something like > > > > > > [ATTR_FAMILY_ID] > > > [ATTR_POLICY] >

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
On Thu, 2020-10-01 at 09:24 -0700, Jakub Kicinski wrote: > > I guess the most compact representation, that also preserves the most > > data about sharing, would be to do something like > > > > [ATTR_FAMILY_ID] > > [ATTR_POLICY] > > [policy idx, 0 = main policy] > > [bla] > > ... > > .

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Jakub Kicinski
On Thu, 01 Oct 2020 18:00:58 +0200 Johannes Berg wrote: > On Thu, 2020-10-01 at 08:41 -0700, Jakub Kicinski wrote: > > > > Even if I don't have a good idea now on how to avoid the duplication, it > > > might be nicer to have a (flag) attribute here for "CTRL_ATTR_ALL_OPS"? > > > > Hm. How would

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
On Thu, 2020-10-01 at 08:41 -0700, Jakub Kicinski wrote: > > Even if I don't have a good idea now on how to avoid the duplication, it > > might be nicer to have a (flag) attribute here for "CTRL_ATTR_ALL_OPS"? > > Hm. How would you see the dump structured? Yeah, that's the tricky part ... Hence

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Jakub Kicinski
On Thu, 01 Oct 2020 09:59:47 +0200 Johannes Berg wrote: > On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote: > > Right now CTRL_CMD_GETPOLICY can only dump the family-wide > > policy. Support dumping policy of a specific op. > > So, hmm. > > Yeah, I guess this is fine, but you could end u

Re: [RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-10-01 Thread Johannes Berg
On Wed, 2020-09-30 at 17:05 -0700, Jakub Kicinski wrote: > Right now CTRL_CMD_GETPOLICY can only dump the family-wide > policy. Support dumping policy of a specific op. So, hmm. Yeah, I guess this is fine, but you could end up having to do a lot of dumps, and with e.g. ethtool you'd end up with a

[RFC net-next 9/9] genetlink: allow dumping command-specific policy

2020-09-30 Thread Jakub Kicinski
Right now CTRL_CMD_GETPOLICY can only dump the family-wide policy. Support dumping policy of a specific op. Signed-off-by: Jakub Kicinski --- include/uapi/linux/genetlink.h | 1 + net/netlink/genetlink.c| 23 +-- 2 files changed, 22 insertions(+), 2 deletions(-) dif