On 1/7/25 22:46, Ilya Maximets wrote:
> OVS allows enabling prefix match optimizations per flow table. This
> enables masked matches whenever possible on fields that otherwise would
> be exact matched in the datapath flow.
>
> By default, however, only nw_src and nw_dst are enabled (L4 ports are
> also always enabled, but this is not configurable). OVN is using mixed
> flow tables that match on both IPv4 and IPv6 addresses, meaning that
> IPv6 traffic generates exact match datapath flows where IPv4 generates
> masked matches, causing datapath flow explosion under heavy IPv6 load.
>
> OVN owns the "br-int" bridge and the flow tables, so it should enable
> appropriate fields per flow table to avoid flow explosion and achieve
> better performance overall.
>
> Example on how the prefixes can be configured manually:
>
> for i in $(seq 0 254); do
> ovs-vsctl set Bridge br-int flow_tables:${i}=@N -- \
> --id=@N create Flow_Table name=t${i} \
> prefixes=nw_src,nw_dst,ipv6_dst,ipv6_src;
> done
>
> Until recently, OVS only supported up to 3 prefixes per flow table, but
> now the limit will be increased to 4 in OVS 3.5 and some newer minor
> releases of older versions down to 3.3.
> Unfortunately, that means that ovn-controller needs to check and choose
> the appropriate number of prefixes. For the 3 we may just add ipv6_src
> and leave ipv6_dst unoptimized.
>
> OVS 3.5 will have all 4 prefixes enabled by default, but OVN will be
> paired with older versions of OVS for a long time, so it's better to
> set these config options to better support older setups.
>
> Unfortunately, IDL doesn't provide a way today to get the type of the
> column from the server side, so it's hard to tell how many prefixes
> are actually supported. A few approaches:
>
> 1. Try 3 and 4 and check if transaction fails.
> 2. Try to get and parse the schema from the server.
> 3. Enhance IDL to provide server column type information.
>
> While the first approach seems simpler, it's actually not trivial to
> figure out why exactly the transaction failed from the application
> level. IDL only has the string representation of the error and doesn't
> provide it to the application.
>
> The third approach is the most clean one, but it requires modifications
> of the IDL and CS layers in order to get this information. This would
> significantly complicate the process of getting this change backported
> to OVN 24.03 LTS, for example.
>
> The second approach is taken by this commit with intention to replace
> the schema parsing with the enhanced IDL API, once it is available.
> This allows for easier backports today with a cleaner solution in the
> future.
>
> IMO, the backportability is important due to increasing importance of
> IPv6 in OVN clusters and the cloud environments in general.
>
> Reported-at: https://issues.redhat.com/browse/FDP-1024
> Signed-off-by: Ilya Maximets <[email protected]>
> ---
>
> Posting this version as a continuation to internal discussion with
> Dumitru and Ales on how to detect server-side database types.
>
> However, this version is fully functional and is ready for review if we
> agree on the approach.
>
> Note: For backpotrs, OVS submodules on older OVN branches will need to
> be moved to latest commits on corresponding OVS branches.
>
> NEWS | 3 ++
> TODO.rst | 3 ++
> controller/ovn-controller.c | 79 ++++++++++++++++++++++++++-
> include/ovn/features.h | 4 +-
> lib/features.c | 105 +++++++++++++++++++++++++++++++++++-
> lib/test-ovn-features.c | 6 +--
> tests/ovn-controller.at | 50 +++++++++++++++++
> 7 files changed, 244 insertions(+), 6 deletions(-)
Recheck-request: github-robot-_ovn-kubernetes
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev