netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv5 net-next 0/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, del}link
@ 2022-09-30  9:45 Hangbin Liu
  2022-09-30  9:45 ` [PATCHv5 net-next 1/4] rtnetlink: add new helper rtnl_configure_link_notify() Hangbin Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Hangbin Liu @ 2022-09-30  9:45 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ido Schimmel, Petr Machata, Florent Fourcot, Nikolay Aleksandrov,
	Nicolas Dichtel, Guillaume Nault, David Ahern, Hangbin Liu

Netlink messages are used for communicating between user and kernel space.
When user space configures the kernel with netlink messages, it can set the
NLM_F_ECHO flag to request the kernel to send the applied configuration back
to the caller. This allows user space to retrieve configuration information
that are filled by the kernel (either because these parameters can only be
set by the kernel or because user space let the kernel choose a default
value).

The kernel has support this feature in some places like RTM_{NEW, DEL}ADDR,
RTM_{NEW, DEL}ROUTE. This patch set handles NLM_F_ECHO flag and send link
info back after rtnl_{new, del}link.

v5:
1) make rtnl_configure_link_notify static, reported by kernel test robot

v4:
1) Add rtnl_configure_link_notify() helper so rtnl_newlink_create could
   use it instead of creating new notify function.
2) Add unregister_netdevice_many_notify() helper so rtnl_delete_link()
   could use it instead of creating new notify function
3) Split the previous patch to 4 small patches for easier reviewing.

v3:
1) Fix group parameter in rtnl_notify.
2) Use helper rtmsg_ifinfo_build_skb() instead re-write a new one.

v2:
1) Rename rtnl_echo_link_info() to rtnl_link_notify().
2) Remove IFLA_LINK_NETNSID and IFLA_EXT_MASK, which do not fit here.
3) Add NLM_F_ECHO in rtnl_dellink. But we can't re-use the rtnl_link_notify()
   helper as we need to get the link info before rtnl_delete_link().

Hangbin Liu (4):
  rtnetlink: add new helper rtnl_configure_link_notify()
  net: add new helper unregister_netdevice_many_notify
  rtnetlink: Honour NLM_F_ECHO flag in rtnl_newlink_create
  rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link

 include/linux/netdevice.h      |  4 ++-
 include/linux/rtnetlink.h      |  6 ++--
 include/net/rtnetlink.h        |  2 +-
 net/core/dev.c                 | 26 +++++++++++-----
 net/core/rtnetlink.c           | 56 ++++++++++++++++++++++------------
 net/openvswitch/vport-geneve.c |  2 +-
 net/openvswitch/vport-gre.c    |  2 +-
 net/openvswitch/vport-netdev.c |  2 +-
 net/openvswitch/vport-vxlan.c  |  2 +-
 9 files changed, 67 insertions(+), 35 deletions(-)

-- 
2.37.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-10-04  8:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-30  9:45 [PATCHv5 net-next 0/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, del}link Hangbin Liu
2022-09-30  9:45 ` [PATCHv5 net-next 1/4] rtnetlink: add new helper rtnl_configure_link_notify() Hangbin Liu
2022-09-30 14:22   ` Nicolas Dichtel
2022-09-30 16:01     ` Guillaume Nault
2022-09-30 21:40       ` Nicolas Dichtel
2022-10-04  8:22         ` Hangbin Liu
2022-09-30 16:28   ` Guillaume Nault
2022-09-30  9:45 ` [PATCHv5 net-next 2/4] net: add new helper unregister_netdevice_many_notify Hangbin Liu
2022-09-30 14:23   ` Nicolas Dichtel
2022-09-30 14:29     ` Guillaume Nault
2022-09-30 15:18       ` Jakub Kicinski
2022-09-30 16:31   ` Guillaume Nault
2022-09-30 16:45     ` Guillaume Nault
2022-09-30  9:45 ` [PATCHv5 net-next 3/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_newlink_create Hangbin Liu
2022-09-30 16:42   ` Guillaume Nault
2022-09-30  9:45 ` [PATCHv5 net-next 4/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link Hangbin Liu
2022-09-30 16:57   ` Guillaume Nault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).