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
This commit is contained in:
Takashi Kajinami 2022-07-29 08:30:36 +09:00
parent 9d5c61630a
commit 28031fa700
3 changed files with 33 additions and 1 deletions

View File

@ -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,

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``ovs::dpdk`` class now supports the ``vhost_postcopy_support``
parameter, which enables/disables postcopy support.

View File

@ -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,
)