From 9eb6a64b9ca1882aee995d4941e2f54d6a5d8607 Mon Sep 17 00:00:00 2001 From: Yoshi Kadokawa Date: Thu, 26 Sep 2024 17:41:52 +0900 Subject: [PATCH] Add config option for ovn_emit_need_to_frag Add a charm config option to enable/disable ovn_emit_need_to_frag. By default, the value is set to "True" as ovn_emit_need_to_frag is enabled by default. Closes-Bug: #1947391 Change-Id: I58fe365ce862430e172ebedf80ebaef9807c910c --- src/config.yaml | 12 ++++++++++++ src/reactive/neutron_api_plugin_ovn_handlers.py | 2 +- .../test_reactive_neutron_api_plugin_ovn_handlers.py | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/config.yaml b/src/config.yaml index 91e0cc8..d24e4cb 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -121,3 +121,15 @@ options: - ntp_server:,wpad:1.2.3.5 - Unset ntp_server and set wpad See the ovn-nb(5) man page for available options. + enable-emit-need-to-frag: + type: boolean + default: True + description: > + When enabled, the length of packets traversing router gateway ports + will be checked, and if necessary ICMPv4 type 3 (Destination + Unreachable) code 4 (Fragmentation Needed and Don't Fragment was Set) + or ICMPv6 type 2 (Packet Too Big) code 0 (no route to destination) + packets will be generated. + + Note that a performance penalty may incur on older kernel versions (<= 5.2) + or if hardware acceleration does not support the ``check_pkt_len`` action. diff --git a/src/reactive/neutron_api_plugin_ovn_handlers.py b/src/reactive/neutron_api_plugin_ovn_handlers.py index 9b52890..dfe9381 100644 --- a/src/reactive/neutron_api_plugin_ovn_handlers.py +++ b/src/reactive/neutron_api_plugin_ovn_handlers.py @@ -133,7 +133,7 @@ def configure_neutron(): # version of 5.2 or greater. Enabled by default # because charm supports focal or newer which has a # minimum kernel version of 5.4. - ('ovn_emit_need_to_frag', True), + ('ovn_emit_need_to_frag', options.enable_emit_need_to_frag), # NOTE(fnordahl): will be used on chassis with DPDK enabled # # Neutron will make per chassis decisions based on chassis diff --git a/unit_tests/test_reactive_neutron_api_plugin_ovn_handlers.py b/unit_tests/test_reactive_neutron_api_plugin_ovn_handlers.py index 87948fc..b344de9 100644 --- a/unit_tests/test_reactive_neutron_api_plugin_ovn_handlers.py +++ b/unit_tests/test_reactive_neutron_api_plugin_ovn_handlers.py @@ -145,6 +145,7 @@ class TestOvnHandlers(test_utils.PatchHelper): options.ovn_l3_scheduler = self.pmock('aSched') options.ovn_metadata_enabled = self.pmock('aMetaData') options.enable_distributed_floating_ip = self.pmock('dont') + options.enable_emit_need_to_frag = self.pmock(False) options.dns_servers = self.pmock('dns1 dns2') options.geneve_vni_ranges = self.pmock('vnia:vniA vnib:vniB') options.dhcp_default_lease_time = self.pmock(42) @@ -186,7 +187,7 @@ class TestOvnHandlers(test_utils.PatchHelper): ('dhcp_default_lease_time', 42), ('ovn_dhcp4_global_options', 'a:A4,b:B4'), ('ovn_dhcp6_global_options', 'a:A6,b:B6'), - ('ovn_emit_need_to_frag', True), + ('ovn_emit_need_to_frag', False), ('vhost_sock_dir', '/run/libvirt-vhost-user') ], 'ml2_type_geneve': [