Re: [PATCH net-next 13/14] devlink: add by-instance dump infra

Jiri Pirko
2023-01-06T08:58:48Z

Thu, Jan 05, 2023 at 07:24:37PM CET, kuba@kernel.org wrote:
>On Thu, 5 Jan 2023 10:02:54 +0100 Jiri Pirko wrote:
>> Thu, Jan 05, 2023 at 04:46:04AM CET, kuba@kernel.org wrote:
>> >> What is "gen"? Generic netlink?
>> >
>> >Generic devlink command. In other words the implementation
>> >is straightforward enough to factor out the common parts.
>>
>> Could it be "genl" then?
>
>Why? What other kind of command is there?
>The distinction is weird vs generic, not genl vs IDK-what.

Compare outputs of:
git grep _gen_ net/
git grep _genl_ net/

My point is to see consistent naming scheme. I know you don't care about
that much, but I believe it helps readability and code understanding.
What is the downside? I'm not really sure why you are against it.

>
>> >> Do you plan to have more callbacks here? If no, wouldn't it be better
>> >> to just have typedef and assign the pointer to the dump_one in
>> >> devl_gen_cmds array?
>> >
>> >If I find the time - yes, more refactoring is possible.
>>
>> Could you elaborate a bit more about that?
>
>If I recall I was thinking about adding a "fill" op and policy related
>info to the structure. The details would fall into place during coding..
>
>> >You mean it doesn't have nl, cmd, dump_one in the name?
>> >Could you *please* at least say what you want the names to be if you're
>> >sending all those subjective nit picks? :/
>>
>> Well, I provided a suggested name, not sure why that was not clear.
>> The point was s/dump/dumpit/ to match the op name.
>
>Oh, just the "it" at the end? Sorry, I don't see the point.

The point is simple. Ops is a struct of callback by name X. If someone
implements this ops struct, it is nice to assign the callbacks functions
of name y_X so it is obvious from the first sight, what the function
is related to.

I'm not sure what's wrong about having this sort of consistency. I
believe that you as a maintainer should rather enforce it than to be
against it. Am I missing something?