From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Eyal Birger <eyal.birger@gmail.com>,
Nikolay Aleksandrov <razor@blackwall.org>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, steffen.klassert@secunet.com,
herbert@gondor.apana.org.au, dsahern@kernel.org,
contact@proelbtn.com, pablo@netfilter.org,
netdev@vger.kernel.org, bpf@vger.kernel.org,
"daniel@iogearbox.net" <daniel@iogearbox.net>
Subject: Re: [PATCH ipsec-next,v2 2/3] xfrm: interface: support collect metadata mode
Date: Fri, 26 Aug 2022 09:53:30 +0200 [thread overview]
Message-ID: <e80f14c5-4ca4-55b0-57e0-108fb73fb828@6wind.com> (raw)
In-Reply-To: <CAHsH6Gv8Zv722pjtKrWDiSHYKvV0FUxUSnHf_8B+gJnAVYiziQ@mail.gmail.com>
Le 25/08/2022 à 17:14, Eyal Birger a écrit :
> On Thu, Aug 25, 2022 at 5:24 PM Nikolay Aleksandrov <razor@blackwall.org> wrote:
>>
>> On 25/08/2022 16:46, Eyal Birger wrote:
>>> This commit adds support for 'collect_md' mode on xfrm interfaces.
>>>
>>> Each net can have one collect_md device, created by providing the
>>> IFLA_XFRM_COLLECT_METADATA flag at creation. This device cannot be
>>> altered and has no if_id or link device attributes.
>>>
>>> On transmit to this device, the if_id is fetched from the attached dst
>>> metadata on the skb. If exists, the link property is also fetched from
>>> the metadata. The dst metadata type used is METADATA_XFRM which holds
>>> these properties.
>>>
>>> On the receive side, xfrmi_rcv_cb() populates a dst metadata for each
>>> packet received and attaches it to the skb. The if_id used in this case is
>>> fetched from the xfrm state, and the link is fetched from the incoming
>>> device. This information can later be used by upper layers such as tc,
>>> ebpf, and ip rules.
>>>
>>> Because the skb is scrubed in xfrmi_rcv_cb(), the attachment of the dst
>>> metadata is postponed until after scrubing. Similarly, xfrm_input() is
>>> adapted to avoid dropping metadata dsts by only dropping 'valid'
>>> (skb_valid_dst(skb) == true) dsts.
>>>
>>> Policy matching on packets arriving from collect_md xfrmi devices is
>>> done by using the xfrm state existing in the skb's sec_path.
>>> The xfrm_if_cb.decode_cb() interface implemented by xfrmi_decode_session()
>>> is changed to keep the details of the if_id extraction tucked away
>>> in xfrm_interface.c.
>>>
>>> Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
>>>
>>> ----
>>>
>>> v2:
>>> - add "link" property as suggested by Nicolas Dichtel
>>> - rename xfrm_if_decode_session_params to xfrm_if_decode_session_result
>>> ---
>>
>> (+CC Daniel)
>>
>> Hi,
>> Generally I really like the idea, but I missed to comment the first round. :)
>> A few comments below..
>>
>
> Thanks for the review!
>
>>> include/net/xfrm.h | 11 +++-
> <...snip...>
>>>
>>> static const struct nla_policy xfrmi_policy[IFLA_XFRM_MAX + 1] = {
>>> - [IFLA_XFRM_LINK] = { .type = NLA_U32 },
>>> - [IFLA_XFRM_IF_ID] = { .type = NLA_U32 },
>>> + [IFLA_XFRM_UNSPEC] = { .strict_start_type = IFLA_XFRM_COLLECT_METADATA },
>>> + [IFLA_XFRM_LINK] = { .type = NLA_U32 },
>>
>> link is signed, so s32
>
> Ack on all comments except this one - I'm a little hesitant to change
> this one as the change would be unrelated to this series.
I agree, it's unrelated to this series.
next prev parent reply other threads:[~2022-08-26 7:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 13:46 [PATCH ipsec-next,v2 0/3] xfrm: support collect metadata mode for xfrm interfaces Eyal Birger
2022-08-25 13:46 ` [PATCH ipsec-next,v2 1/3] net: allow storing xfrm interface metadata in metadata_dst Eyal Birger
2022-08-25 13:46 ` [PATCH ipsec-next,v2 2/3] xfrm: interface: support collect metadata mode Eyal Birger
2022-08-25 14:24 ` Nikolay Aleksandrov
2022-08-25 15:14 ` Eyal Birger
2022-08-26 7:53 ` Nicolas Dichtel [this message]
2022-08-27 12:36 ` Nikolay Aleksandrov
2022-08-25 14:28 ` Nicolas Dichtel
2022-08-25 13:46 ` [PATCH ipsec-next,v2 3/3] xfrm: lwtunnel: add lwtunnel support for xfrm interfaces in collect_md mode Eyal Birger
2022-08-25 14:30 ` Nikolay Aleksandrov
2022-08-25 14:30 ` Nicolas Dichtel
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=e80f14c5-4ca4-55b0-57e0-108fb73fb828@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=bpf@vger.kernel.org \
--cc=contact@proelbtn.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=eyal.birger@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=razor@blackwall.org \
--cc=steffen.klassert@secunet.com \
/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