[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZytG8LySPklk4ZOW@penguin>
Date: Wed, 6 Nov 2024 12:37:36 +0200
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Daniel Borkmann <daniel@...earbox.net>,
Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 net-next 2/7] rtnetlink: Add peer_type in struct
rtnl_link_ops.
On Tue, Nov 05, 2024 at 06:24:27PM -0800, Kuniyuki Iwashima wrote:
> In ops->newlink(), veth, vxcan, and netkit call rtnl_link_get_net() with
> a net pointer, which is the first argument of ->newlink().
>
> rtnl_link_get_net() could return another netns based on IFLA_NET_NS_PID
> and IFLA_NET_NS_FD in the peer device's attributes.
>
> We want to get it and fill rtnl_nets->nets[] in advance in rtnl_newlink()
> for per-netns RTNL.
>
> All of the three get the peer netns in the same way:
>
> 1. Call rtnl_nla_parse_ifinfomsg()
> 2. Call ops->validate() (vxcan doesn't have)
> 3. Call rtnl_link_get_net()
>
> Let's add a new field peer_type to struct rtnl_link_ops and prefetch
> netns in the peer ifla to add it to rtnl_nets in rtnl_newlink().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
> ---
> v2:
> * Rename the helper to rtnl_link_get_net_ifla()
> * Unexport rtnl_link_get_net_ifla() and made it static
> * Change peer_type to u16
> * squash patch 2 & 3 (due to static requires a user)
> ---
> include/net/rtnetlink.h | 2 ++
> net/core/rtnetlink.c | 55 ++++++++++++++++++++++++++++++++++++++---
> 2 files changed, 53 insertions(+), 4 deletions(-)
>
Reviewed-by: Nikolay Aleksandrov <razor@...ckwall.org>
Powered by blists - more mailing lists