OVN: Add ovn_emit_need_to_frag configuration option

This patch is adding a new configuration option called
"ovn_emit_need_to_frag" to be set in the "ovn" section of
etc/neutron/plugins/ml2_conf.ini.

When set to True the option tells ovn whether it should emit "need to
frag" packets in case of MTU mismatch. Before enabling this configuration
make sure that its supported by the host kernel (version >= 5.2) or by
checking the output of the following command: ovs-appctl -t ovs-vswitchd
dpif/show-dp-features br-int | grep "Check pkt length action". Defaults
to False.

This option was intruced by networking-ovn at:
https://review.opendev.org/#/c/671766/

Change-Id: I258402e8033726aa9abf2dc5f801fdf724ab9e3a
Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
This commit is contained in:
Lucas Alvares Gomes 2019-10-10 10:39:39 +01:00
parent 06cf2f230d
commit 3478011d64
3 changed files with 34 additions and 0 deletions

View File

@ -91,6 +91,16 @@
# (optional) The vhost-user socket directory for OVS
# Type: String
# Defaults to $::os_service_default
#
# [*ovn_emit_need_to_frag*]
# (optional) Configure OVN to emit "need to frag" packets in case
# of MTU mismatch. Before enabling this configuration make
# sure that its supported by the host kernel (version >=
# 5.2) or by checking the output of the following command:
# ovs-appctl -t ovs-vswitchd dpif/show-dp-features br-int |
# grep "Check pkt length action".
# Type: boolean
# Defaults to $::os_service_default
class neutron::plugins::ml2::ovn(
$ovn_nb_connection = $::os_service_default,
@ -110,6 +120,7 @@ class neutron::plugins::ml2::ovn(
$dvr_enabled = $::os_service_default,
$dns_servers = $::os_service_default,
$vhostuser_socket_dir = $::os_service_default,
$ovn_emit_need_to_frag = $::os_service_default,
) {
include ::neutron::deps
@ -151,5 +162,6 @@ class neutron::plugins::ml2::ovn(
'ovn/enable_distributed_floating_ip' : value => $dvr_enabled;
'ovn/dns_servers' : value => join(any2array($dns_servers), ',');
'ovn/vhost_sock_dir' : value => $vhostuser_socket_dir;
'ovn/ovn_emit_need_to_frag' : value => $ovn_emit_need_to_frag;
}
}

View File

@ -0,0 +1,11 @@
---
features:
- |
Add a new configuration option called "ovn_emit_need_to_frag" to
the "ovn" section of etc/neutron/plugins/ml2_conf.ini. This new
option tells ovn whether it should emit "need to frag" packets
in case of MTU mismatch. Before enabling this configuration make
sure that its supported by the host kernel (version >= 5.2) or
by checking the output of the following command: ovs-appctl -t
ovs-vswitchd dpif/show-dp-features br-int | grep "Check pkt length
action". Defaults to False.

View File

@ -25,6 +25,7 @@ describe 'neutron::plugins::ml2::ovn' do
:vif_type => 'ovs',
:dvr_enabled => false,
:dns_servers => ['8.8.8.8', '10.10.10.10'],
:ovn_emit_need_to_frag => false,
}
end
@ -54,6 +55,7 @@ describe 'neutron::plugins::ml2::ovn' do
should contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(params[:dvr_enabled])
should contain_neutron_plugin_ml2('ovn/dns_servers').with_value(params[:dns_servers].join(','))
should contain_neutron_plugin_ml2('ovn/vhost_sock_dir').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('ovn/ovn_emit_need_to_frag').with_value(params[:ovn_emit_need_to_frag])
end
end
@ -93,6 +95,15 @@ describe 'neutron::plugins::ml2::ovn' do
should contain_neutron_plugin_ml2('ovn/enable_distributed_floating_ip').with_value(params[:dvr_enabled])
end
end
context 'with emit need to fragment enabled' do
before :each do
params.merge!(:ovn_emit_need_to_frag => true)
end
it 'should enable emit need to fragment option' do
should contain_neutron_plugin_ml2('ovn/ovn_emit_need_to_frag').with_value(params[:ovn_emit_need_to_frag])
end
end
end
on_supported_os({