[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZV8qJ1QX9vz3mfpT@nanopsycho>
Date: Thu, 23 Nov 2023 11:32:07 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, pabeni@...hat.com, davem@...emloft.net,
edumazet@...gle.com, jacob.e.keller@...el.com, jhs@...atatu.com,
johannes@...solutions.net, andriy.shevchenko@...ux.intel.com,
amritha.nambiar@...el.com, sdf@...gle.com, horms@...nel.org
Subject: Re: [patch net-next v3 5/9] genetlink: implement release callback
and free sk_user_data there
Wed, Nov 22, 2023 at 06:08:20PM CET, kuba@...nel.org wrote:
>On Wed, 22 Nov 2023 10:29:44 +0100 Jiri Pirko wrote:
>> >If you're doing it centrally, please put the state as a new field in
>> >the netlink socket. sk_user_data is for the user.
>>
>> I planned to use sk_user_data. What do you mean it is for the user?
>> I see it is already used for similar usecase by connector for example:
>
>I'm pretty sure I complained when it was being added. Long story.
>AFAIU user as in if the socket is opened by a kernel module, the kernel
>module is the user. There's no need to use this field for the
>implementation since the implementation can simply extend its
>own structure to add a properly typed field.
In this case, the socket is not opened by kernel, but it is opened by
the userspace app.
I basically need to have per-user-sk pointer somewhere I'm not clear why
to put it in struct netlink_sock when I can use sk_user_data which is
already there. From the usage of this pointer in kernel, I understand
this is exactly the reason to have it.
Are you afraid of a collision of sk_user_data use with somebody else
here? I don't see how that could happen for netlink socket.
Powered by blists - more mailing lists