From: Aaron Conole <aconole@redhat.com>
To: Adrian Moreno <amorenoz@redhat.com>
Cc: Ilya Maximets <i.maximets@ovn.org>,
netdev@vger.kernel.org, dev@openvswitch.org,
linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
linux-kselftest@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [ovs-dev] [RFC net-next 1/6] openvswitch: exclude kernel flow key from upcalls
Date: Tue, 29 Nov 2022 09:26:22 -0500 [thread overview]
Message-ID: <f7tedtlsupd.fsf@redhat.com> (raw)
In-Reply-To: <753d995d-d4f4-bf2e-994d-435a36414127@redhat.com> (Adrian Moreno's message of "Mon, 28 Nov 2022 10:12:21 +0100")
Adrian Moreno <amorenoz@redhat.com> writes:
> On 11/25/22 16:51, Ilya Maximets wrote:
>> On 11/25/22 16:29, Adrian Moreno wrote:
>>>
>>>
>>> On 11/23/22 22:22, Ilya Maximets wrote:
>>>> On 11/22/22 15:03, Aaron Conole wrote:
>>>>> When processing upcall commands, two groups of data are available to
>>>>> userspace for processing: the actual packet data and the kernel
>>>>> sw flow key data. The inclusion of the flow key allows the userspace
>>>>> avoid running through the dissection again.
>>>>>
>>>>> However, the userspace can choose to ignore the flow key data, as is
>>>>> the case in some ovs-vswitchd upcall processing. For these messages,
>>>>> having the flow key data merely adds additional data to the upcall
>>>>> pipeline without any actual gain. Userspace simply throws the data
>>>>> away anyway.
>>>>
>>>> Hi, Aaron. While it's true that OVS in userpsace is re-parsing the
>>>> packet from scratch and using the newly parsed key for the OpenFlow
>>>> translation, the kernel-porvided key is still used in a few important
>>>> places. Mainly for the compatibility checking. The use is described
>>>> here in more details:
>>>> https://docs.kernel.org/networking/openvswitch.html#flow-key-compatibility
>>>>
>>>> We need to compare the key generated in userspace with the key
>>>> generated by the kernel to know if it's safe to install the new flow
>>>> to the kernel, i.e. if the kernel and OVS userpsace are parsing the
>>>> packet in the same way.
>>>>
>>>
>>> Hi Ilya,
>>>
>>> Do we need to do that for every packet?
>>> Could we send a bitmask of supported fields to userspace at feature
>>> negotiation and let OVS slowpath flows that it knows the kernel won't
>>> be able to handle properly?
>> It's not that simple, because supported fields in a packet depend
>> on previous fields in that same packet. For example, parsing TCP
>> header is generally supported, but it won't be parsed for IPv6
>> fragments (even the first one), number of vlan headers will affect
>> the parsing as we do not parse deeper than 2 vlan headers, etc.
>> So, I'm afraid we have to have a per-packet information, unless we
>> can somehow probe all the possible valid combinations of packet
>> headers.
>>
>
> Surely. I understand that we'd need more than just a bit per
> field. Things like L4 on IPv6 frags would need another bit and the
> number of VLAN headers would need some more. But, are these a handful
> of exceptions or do we really need all the possible combinations of
> headers? If it's a matter of naming a handful of corner cases I think
> we could consider expressing them at initialization time and safe some
> buffer space plus computation time both in kernel and userspace.
I will take a bit more of a look here - there must surely be a way to
express this when pulling information via DP_GET command so that we
don't need to wait for a packet to come in to figure out whether we can
parse it.
next prev parent reply other threads:[~2022-11-29 14:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 14:03 [RFC net-next 0/6] Allow excluding sw flow key from upcalls Aaron Conole
2022-11-22 14:03 ` [RFC net-next 1/6] openvswitch: exclude kernel " Aaron Conole
2022-11-23 21:22 ` Ilya Maximets
2022-11-25 15:29 ` [ovs-dev] " Adrian Moreno
2022-11-25 15:51 ` Ilya Maximets
2022-11-28 9:12 ` Adrian Moreno
2022-11-29 14:26 ` Aaron Conole [this message]
2022-11-29 14:30 ` Aaron Conole
2022-11-22 14:03 ` [RFC net-next 2/6] selftests: openvswitch: add interface support Aaron Conole
2022-11-22 14:03 ` [RFC net-next 3/6] selftests: openvswitch: add flow dump support Aaron Conole
2022-11-22 14:03 ` [RFC net-next 4/6] selftests: openvswitch: adjust datapath NL message Aaron Conole
2022-11-22 14:03 ` [RFC net-next 5/6] selftests: openvswitch: add upcall support Aaron Conole
2022-11-22 14:03 ` [RFC net-next 6/6] selftests: openvswitch: add exclude support for packet commands Aaron Conole
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=f7tedtlsupd.fsf@redhat.com \
--to=aconole@redhat.com \
--cc=amorenoz@redhat.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=edumazet@google.com \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.