Browse Source

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

changes/76/795476/38
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
4924354d51
  1. 7
      manifests/dpdk.pp
  2. 4
      releasenotes/notes/dpdk-socket-limit-3a03f281787b776e.yaml
  3. 16
      spec/classes/vswitch_dpdk_spec.rb

7
manifests/dpdk.pp

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

4
releasenotes/notes/dpdk-socket-limit-3a03f281787b776e.yaml

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

16
spec/classes/vswitch_dpdk_spec.rb

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

Loading…
Cancel
Save