From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>,
Florent Fourcot <florent.fourcot@wifirst.fr>,
Nikolay Aleksandrov <razor@blackwall.org>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Guillaume Nault <gnault@redhat.com>,
David Ahern <dsahern@kernel.org>,
Hangbin Liu <liuhangbin@gmail.com>
Subject: [PATCHv7 net-next 0/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, del}link
Date: Fri, 28 Oct 2022 04:42:20 -0400 [thread overview]
Message-ID: <20221028084224.3509611-1-liuhangbin@gmail.com> (raw)
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.
v7:
1) Fix unregister_netdevice_many() prototype warnning in patch 02
v6:
1) Rename pid to portid, make all nlh const
2) Re-order the portid, nlh parameter for each function
3) Do not add rtnl_configure_link_notify() warpper as Guillaume suggested.
Just modify rtnl_configure_link() directly in patch 01. Also remove
the rtmsg_ifinfo_nlh() wrapper.
4) Un-export unregister_netdevice_many_notify() in patch 02
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: pass netlink message header and portid to
rtnl_configure_link()
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
drivers/net/can/vxcan.c | 2 +-
drivers/net/geneve.c | 2 +-
drivers/net/veth.c | 2 +-
drivers/net/vxlan/vxlan_core.c | 4 +--
drivers/net/wwan/wwan_core.c | 2 +-
include/linux/netdevice.h | 2 --
include/linux/rtnetlink.h | 9 ++++---
include/net/netlink.h | 11 ++++++++
include/net/rtnetlink.h | 5 ++--
net/core/dev.c | 48 ++++++++++++++++++++--------------
net/core/dev.h | 7 +++++
net/core/rtnetlink.c | 46 ++++++++++++++++++--------------
net/ipv4/ip_gre.c | 2 +-
net/openvswitch/vport-geneve.c | 2 +-
net/openvswitch/vport-gre.c | 2 +-
net/openvswitch/vport-netdev.c | 2 +-
net/openvswitch/vport-vxlan.c | 2 +-
17 files changed, 91 insertions(+), 59 deletions(-)
--
2.37.3
next reply other threads:[~2022-10-28 8:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 8:42 Hangbin Liu [this message]
2022-10-28 8:42 ` [PATCHv7 net-next 1/4] rtnetlink: pass netlink message header and portid to rtnl_configure_link() Hangbin Liu
2022-10-28 8:42 ` [PATCHv7 net-next 2/4] net: add new helper unregister_netdevice_many_notify Hangbin Liu
2022-10-28 8:42 ` [PATCHv7 net-next 3/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_newlink_create Hangbin Liu
2022-10-28 8:42 ` [PATCHv7 net-next 4/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link Hangbin Liu
2022-10-31 17:43 ` [PATCHv7 net-next 0/4] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, del}link Guillaume Nault
2022-11-01 3:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221028084224.3509611-1-liuhangbin@gmail.com \
--to=liuhangbin@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=florent.fourcot@wifirst.fr \
--cc=gnault@redhat.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).