diff --git a/manifests/dpdk.pp b/manifests/dpdk.pp index c5fd3e21..263fb6a4 100644 --- a/manifests/dpdk.pp +++ b/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}, diff --git a/releasenotes/notes/dpdk-socket-limit-3a03f281787b776e.yaml b/releasenotes/notes/dpdk-socket-limit-3a03f281787b776e.yaml new file mode 100644 index 00000000..b2895936 --- /dev/null +++ b/releasenotes/notes/dpdk-socket-limit-3a03f281787b776e.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``vswitch::dpdk::socket_limit`` parameter has been added. diff --git a/spec/classes/vswitch_dpdk_spec.rb b/spec/classes/vswitch_dpdk_spec.rb index abf4de4c..c2b5a691 100644 --- a/spec/classes/vswitch_dpdk_spec.rb +++ b/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