[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b6143d1-d4d4-7765-3e27-c686abda25d5@blackwall.org>
Date: Sat, 27 Aug 2022 14:45:28 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Eyal Birger <eyal.birger@...il.com>, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
steffen.klassert@...unet.com, herbert@...dor.apana.org.au,
dsahern@...nel.org, contact@...elbtn.com, pablo@...filter.org,
nicolas.dichtel@...nd.com, daniel@...earbox.net
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH ipsec-next,v4 3/3] xfrm: lwtunnel: add lwtunnel support
for xfrm interfaces in collect_md mode
On 26/08/2022 14:47, Eyal Birger wrote:
> Allow specifying the xfrm interface if_id and link as part of a route
> metadata using the lwtunnel infrastructure.
>
> This allows for example using a single xfrm interface in collect_md
> mode as the target of multiple routes each specifying a different if_id.
>
> With the appropriate changes to iproute2, considering an xfrm device
> ipsec1 in collect_md mode one can for example add a route specifying
> an if_id like so:
>
> ip route add <SUBNET> dev ipsec1 encap xfrm if_id 1
>
> In which case traffic routed to the device via this route would use
> if_id in the xfrm interface policy lookup.
>
> Or in the context of vrf, one can also specify the "link" property:
>
> ip route add <SUBNET> dev ipsec1 encap xfrm if_id 1 link_dev eth15
>
> Note: LWT_XFRM_LINK uses NLA_U32 similar to IFLA_XFRM_LINK even though
> internally "link" is signed. This is consistent with other _LINK
> attributes in other devices as well as in bpf and should not have an
> effect as device indexes can't be negative.
>
> Signed-off-by: Eyal Birger <eyal.birger@...il.com>
>
> ----
>
> v4: use NLA_U32 for LWT_XFRM_LINK as suggested by Nicolas Dichtel
>
> v3: netlink improvements as suggested by Nikolay Aleksandrov and
> Nicolas Dichtel
>
> v2:
> - move lwt_xfrm_info() helper to dst_metadata.h
> - add "link" property as suggested by Nicolas Dichtel
> ---
> include/net/dst_metadata.h | 11 +++++
> include/uapi/linux/lwtunnel.h | 10 +++++
> net/core/lwtunnel.c | 1 +
> net/xfrm/xfrm_interface.c | 85 +++++++++++++++++++++++++++++++++++
> 4 files changed, 107 insertions(+)
>
Reviewed-by: Nikolay Aleksandrov <razor@...ckwall.org>
Powered by blists - more mailing lists