Merge "Add support for other_config:dpdk-socket-limit"

This commit is contained in:
Zuul 2022-01-07 23:42:31 +00:00 committed by Gerrit Code Review
commit 4924354d51
3 changed files with 26 additions and 1 deletions

View File

@ -29,6 +29,11 @@
# socket 1 and no allocation for socket 0, the value should be "0,1024"
# Defaults to undef.
#
# [*socket_limit*]
# (Optional) Limits the maximum amount of memory that can be used from
# the hugepage pool, on a per-socket basis.
# Defaults to undef.
#
# [*enable_hw_offload*]
# (optional) Configure OVS to use
# Hardware Offload. This feature is
@ -62,6 +67,7 @@ class vswitch::dpdk (
$package_ensure = 'present',
$pmd_core_list = undef,
$socket_mem = undef,
$socket_limit = undef,
$enable_hw_offload = false,
$disable_emc = false,
$vlan_limit = undef,
@ -103,6 +109,7 @@ class vswitch::dpdk (
$dpdk_configs = {
'other_config:dpdk-extra' => { value => $memory_channels_conf},
'other_config:dpdk-socket-mem' => { value => join(any2array($socket_mem), ',')},
'other_config:dpdk-socket-limit' => { value => join(any2array($socket_limit), ',')},
'other_config:dpdk-lcore-mask' => { value => $dpdk_lcore_mask},
'other_config:pmd-cpu-mask' => { value => $pmd_core_mask},
'other_config:n-revalidator-threads' => { value => $revalidator_cores},

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``vswitch::dpdk::socket_limit`` parameter has been added.

View File

@ -25,6 +25,7 @@ describe 'vswitch::dpdk' do
before :each do
params.merge!(:host_core_list => '')
params.merge!(:socket_mem => '')
params.merge!(:socket_limit => '')
params.merge!(:memory_channels => '' )
params.merge!(:pmd_core_list => '')
params.merge!(:enable_hw_offload => false)
@ -40,6 +41,9 @@ describe 'vswitch::dpdk' do
is_expected.to contain_vs_config('other_config:dpdk-socket-mem').with(
:value => '', :wait => false,
)
is_expected.to contain_vs_config('other_config:dpdk-socket-limit').with(
:value => '', :wait => false,
)
is_expected.to contain_vs_config('other_config:dpdk-lcore-mask').with(
:value => nil, :wait => false,
)
@ -61,6 +65,7 @@ describe 'vswitch::dpdk' do
before :each do
params.merge!(:host_core_list => '1,2')
params.merge!(:socket_mem => '1024,1024')
params.merge!(:socket_limit => '2048,2048')
params.merge!(:memory_channels => 2)
params.merge!(:pmd_core_list => '22,23,24,25,66,67,68,69')
params.merge!(:enable_hw_offload => true)
@ -77,6 +82,9 @@ describe 'vswitch::dpdk' do
is_expected.to contain_vs_config('other_config:dpdk-socket-mem').with(
:value => '1024,1024', :wait => false,
)
is_expected.to contain_vs_config('other_config:dpdk-socket-limit').with(
:value => '2048,2048', :wait => false,
)
is_expected.to contain_vs_config('other_config:dpdk-lcore-mask').with(
:value => '6', :wait => false,
)
@ -97,13 +105,19 @@ describe 'vswitch::dpdk' do
context 'when passing arrays' do
before :each do
params.merge!(:socket_mem => [1024, 1024])
params.merge!({
:socket_mem => [1024, 1024],
:socket_limit => [2048, 2048],
})
end
it 'configres dpdk options with comma-separated lists' do
is_expected.to contain_vs_config('other_config:dpdk-socket-mem').with(
:value => '1024,1024', :wait => false,
)
is_expected.to contain_vs_config('other_config:dpdk-socket-limit').with(
:value => '2048,2048', :wait => false,
)
end
end