From 28031fa70052a93d505d5239f8fb6a348386d8cc Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 29 Jul 2022 08:30:36 +0900 Subject: [PATCH] Add support for other_config:vhost-postcopy-support ovs v2.12.0 introduced the option to enable postcopy support[1]. This adds the capability to manage the option. [1] https://github.com/openvswitch/ovs/commit/30e834dcb5 Change-Id: Ie295a8207fdac4afb4eff37fe4eb49b3c942ea77 --- manifests/dpdk.pp | 22 ++++++++++++++++++- ...ost-postcopy-support-268a206b8ab7bc1f.yaml | 5 +++++ spec/classes/vswitch_dpdk_spec.rb | 7 ++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/vhost-postcopy-support-268a206b8ab7bc1f.yaml diff --git a/manifests/dpdk.pp b/manifests/dpdk.pp index da01bcd4..cb746866 100644 --- a/manifests/dpdk.pp +++ b/manifests/dpdk.pp @@ -58,6 +58,11 @@ # (Optional) Enable TSO support. # Defaults to false. # +# [*vhost_postcopy_support*] +# (Optional) Allow switching live migration of VM attached to +# dpdkvhostuserclient port to post-copy mode. +# Defaults to false +# # [*pmd_auto_lb*] # (Optional) Configures PMD Auto Load Balancing # Defaults to false. @@ -98,6 +103,7 @@ class vswitch::dpdk ( $revalidator_cores = undef, $handler_cores = undef, $enable_tso = false, + $vhost_postcopy_support = false, $pmd_auto_lb = false, $pmd_auto_lb_rebal_interval = undef, $pmd_auto_lb_load_threshold = undef, @@ -189,7 +195,7 @@ class vswitch::dpdk ( if $enable_tso { vs_config { 'other_config:userspace-tso-enable': - value => $enable_tso, + value => true, wait => false, } } else { @@ -199,6 +205,20 @@ class vswitch::dpdk ( } } + if $vhost_postcopy_support { + vs_config { 'other_config:vhost-postcopy-support': + value => true, + restart => true, + wait => false + } + } else { + vs_config { 'other_config:vhost-postcopy-support': + ensure => absent, + restart => true, + wait => false + } + } + if $pmd_auto_lb { vs_config { 'other_config:pmd-auto-lb': value => true, diff --git a/releasenotes/notes/vhost-postcopy-support-268a206b8ab7bc1f.yaml b/releasenotes/notes/vhost-postcopy-support-268a206b8ab7bc1f.yaml new file mode 100644 index 00000000..aaab3a4f --- /dev/null +++ b/releasenotes/notes/vhost-postcopy-support-268a206b8ab7bc1f.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The ``ovs::dpdk`` class now supports the ``vhost_postcopy_support`` + parameter, which enables/disables postcopy support. diff --git a/spec/classes/vswitch_dpdk_spec.rb b/spec/classes/vswitch_dpdk_spec.rb index 4f02867e..487a0e2c 100644 --- a/spec/classes/vswitch_dpdk_spec.rb +++ b/spec/classes/vswitch_dpdk_spec.rb @@ -62,6 +62,9 @@ describe 'vswitch::dpdk' do is_expected.to contain_vs_config('other_config:userspace-tso-enable').with( :ensure => 'absent', :wait => false, ) + is_expected.to contain_vs_config('other_config:vhost-postcopy-support').with( + :ensure => 'absent', :restart => true, :wait => false, + ) is_expected.to contain_vs_config('other_config:pmd-auto-lb').with( :ensure => 'absent', :wait => false, ) @@ -96,6 +99,7 @@ describe 'vswitch::dpdk' do :disable_emc => true, :vlan_limit => 2, :enable_tso => true, + :vhost_postcopy_support => true, :pmd_auto_lb => true, :pmd_auto_lb_rebal_interval => 1, :pmd_auto_lb_load_threshold => 95, @@ -133,6 +137,9 @@ describe 'vswitch::dpdk' do is_expected.to contain_vs_config('other_config:userspace-tso-enable').with( :value => true, :wait => false, ) + is_expected.to contain_vs_config('other_config:vhost-postcopy-support').with( + :value => true, :restart => true, :wait => false, + ) is_expected.to contain_vs_config('other_config:pmd-auto-lb').with( :value => true, :wait => false, )