diff options
author | Feng Pan <fpan@redhat.com> | 2017-09-16 23:03:24 -0400 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2017-09-17 08:30:04 -0400 |
commit | a96d2dfb135f93a74f070d1c27374351f5b064a4 (patch) | |
tree | abc61c16503a766061e05c249ac34a1a19fa886c | |
parent | d9ad6d211b86111bdca6b78891808a1bbdec86d2 (diff) |
Add capability to configure socket-mem
JIRA: PUP-5
Change-Id: I6fef4c129356d7a2d8b6d4975aada9abdeb68758
Signed-off-by: Feng Pan <fpan@redhat.com>
-rw-r--r-- | manifests/config.pp | 1 | ||||
-rw-r--r-- | manifests/init.pp | 6 | ||||
-rw-r--r-- | manifests/params.pp | 1 | ||||
-rw-r--r-- | spec/acceptance/fdio_spec.rb | 3 | ||||
-rw-r--r-- | spec/classes/fdio_spec.rb | 13 |
5 files changed, 23 insertions, 1 deletions
diff --git a/manifests/config.pp b/manifests/config.pp index b1ed7ad..d3773b7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -16,6 +16,7 @@ class fdio::config { vpp_config { 'dpdk/dev/default': value => $fdio::vpp_dpdk_dev_default_options; 'dpdk/uio-driver': value => $fdio::vpp_dpdk_uio_driver; + 'dpdk/socket-mem': value => $fdio::vpp_dpdk_socket_mem; } fdio::config::vpp_devices { $fdio::vpp_dpdk_devs: } diff --git a/manifests/init.pp b/manifests/init.pp index ddbf411..8e0b9bf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -27,6 +27,11 @@ # Example: 'vlan-strip-offload on num-rx-queues 3' # Default to undef. # +# [*vpp_dpdk_socket_mem*] +# (optional) DPDK hugepage memory allocation per socket. +# Example: '1024,1024' +# Default to undef. +# # [*vpp_cpu_main_core*] # (optional) VPP main thread pinning core. # Defaults to undef (no pinning) @@ -47,6 +52,7 @@ class fdio ( $vpp_dpdk_devs = $::fdio::params::vpp_dpdk_devs, $vpp_dpdk_uio_driver = $::fdio::params::vpp_dpdk_uio_driver, $vpp_dpdk_dev_default_options = $::fdio::params::vpp_dpdk_dev_default_options, + $vpp_dpdk_socket_mem = $::fdio::params::vpp_dpdk_socket_mem, $vpp_cpu_main_core = $::fdio::params::vpp_cpu_main_core, $vpp_cpu_corelist_workers = $::fdio::params::vpp_cpu_corelist_workers, $copy_kernel_nic_ip = $::fdio::params::copy_kernel_nic_ip, diff --git a/manifests/params.pp b/manifests/params.pp index c3c3ed8..796b198 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,6 +8,7 @@ class fdio::params { $vpp_dpdk_devs = [] $vpp_dpdk_uio_driver = 'uio_pci_generic' $vpp_dpdk_dev_default_options = undef + $vpp_dpdk_socket_mem = undef $vpp_cpu_main_core = undef $vpp_cpu_corelist_workers = undef $copy_kernel_nic_ip = true diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb index a3a0a17..18e54b0 100644 --- a/spec/acceptance/fdio_spec.rb +++ b/spec/acceptance/fdio_spec.rb @@ -7,7 +7,7 @@ describe 'fdio' do it 'should work with no errors' do pp= <<-EOS class { '::fdio': - repo_branch => 'stable.1704' + repo_branch => 'stable.1707' } EOS @@ -35,6 +35,7 @@ describe 'fdio' do it 'should work with no errors' do pp= <<-EOS class { '::fdio': + repo_branch => 'stable.1707', vpp_cpu_main_core => '1', vpp_cpu_corelist_workers => '2', } diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb index 847bc08..8f0a088 100644 --- a/spec/classes/fdio_spec.rb +++ b/spec/classes/fdio_spec.rb @@ -2,6 +2,10 @@ require 'spec_helper' describe 'fdio' do + let :params do + {} + end + shared_examples_for 'fdio - default' do it { should compile } it { should compile.with_all_deps } @@ -58,6 +62,15 @@ describe 'fdio' do 'unless' => 'lsmod | grep uio_pci_generic', ) } + + context 'with socket_mem' do + before :each do + params.merge!(:vpp_dpdk_socket_mem => '1024,1024') + end + it 'should configure socket_mem' do + is_expected.to contain_vpp_config('dpdk/socket-mem').with_value('1024,1024') + end + end end shared_examples_for 'fdio - service' do |