Re: [PATCH net-next] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, set}link
From: Jakub Kicinski <kuba@kernel.org>
Date: 2022-09-23 13:49:02
Let me clarify one more time in case Hangbin is waiting for the discussion to resolve... On Fri, 23 Sep 2022 10:43:53 +0200 Nicolas Dichtel wrote:
Le 22/09/2022 à 16:51, Guillaume Nault a écrit :quoted
I just don't see any way to pass a handle back to user space at the moment. The echo mechanism did that and was generic to all netlink families (as long as nlmsg_notify() was called with the right parameters).
In NEWLINK, right? In NEWLINK there is no way to pass it back at the moment. A newly added command can just respond with the handle always. The problem with NEWLINK is that it _used to_ not respond so we can't make it start responding because it will confuse existing user space. At the protocol level NEW is no different than GET, whether it sends a response back is decided by whoever implements the command. So yes, for NEWLINK we need a way to inform the kernel that user space wants a reply. It can be via ECHO, it could be via a new attr. What I'm trying to argue about is *not* whether NEWLINK should support ECHO but whether requiring ECHO to get a response for newly added CREATE / NEW commands is a good idea. I think it is not, and new commands should just always respond with the handle. My main concern with using ECHO is that it breaks the one-to-one relationship between a request and a response. There may be multiple notifications generated due to a command, and if we want to retain the "ECHO will loop back to you all resulting notifications" semantics, which I think we should, then there can be multiple "responses". This also has implications for the command IDs used in notifications. A lot of modern genl families use different IDs for notifications to make it easily distinguishable from responses. I guess tl;dr is Hangbin should go forward with the v2, and I should document the expectations clearly..