diff options
author | Feng Pan <fpan@redhat.com> | 2017-09-20 07:50:44 -0400 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2017-09-20 17:54:27 -0400 |
commit | 19fa56176090ca9a1dbce1dff944d8946d15b20a (patch) | |
tree | 37432599bc63f625ac9d3f326f9ce79c1a1a619c | |
parent | dcda81db3eb61bdf69751ce6963b564abf7b7e0c (diff) |
Add tuntap/tapcli configuration support
JIRA: PUP-3
Change-Id: Ia3e00887289b7b069ac8e3e39943bed264b78982
Signed-off-by: Feng Pan <fpan@redhat.com>
-rw-r--r-- | manifests/config.pp | 32 | ||||
-rw-r--r-- | manifests/init.pp | 16 | ||||
-rw-r--r-- | manifests/params.pp | 3 | ||||
-rw-r--r-- | spec/acceptance/fdio_spec.rb | 6 | ||||
-rw-r--r-- | spec/classes/fdio_spec.rb | 15 |
5 files changed, 66 insertions, 6 deletions
diff --git a/manifests/config.pp b/manifests/config.pp index 2a99ea2..7a2a2b3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -17,17 +17,37 @@ class fdio::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; - 'vhost-user/coalesce-frames': value => $fdio::vpp_vhostuser_coalesce_frames; - 'vhost-user/coalesce-time': value => $fdio::vpp_vhostuser_coalesce_time; } - if $fdio::vpp_vhostuser_dont_dump_memory { + fdio::config::vpp_devices { $fdio::vpp_dpdk_devs: } + } + + vpp_config { + 'vhost-user/coalesce-frames': value => $fdio::vpp_vhostuser_coalesce_frames; + 'vhost-user/coalesce-time': value => $fdio::vpp_vhostuser_coalesce_time; + 'tuntap/mtu': value => $fdio::vpp_tuntap_mtu; + 'tapcli/mtu': value => $fdio::vpp_tapcli_mtu; + } + + if $fdio::vpp_vhostuser_dont_dump_memory { + vpp_config { + 'vhost-user/dont-dump-memory': ensure => present; + } + } + + if $fdio::vpp_tuntap_enable != undef { + if $fdio::vpp_tuntap_enable { vpp_config { - 'vhost-user/dont-dump-memory': ensure => present; + 'tuntap/enable': ensure => present; + 'tuntap/disable': ensure => absent; + } + } + else { + vpp_config { + 'tuntap/enable': ensure => absent; + 'tuntap/disable': ensure => present; } } - - fdio::config::vpp_devices { $fdio::vpp_dpdk_devs: } } vpp_config { diff --git a/manifests/init.pp b/manifests/init.pp index eda67f7..1f031e7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -57,6 +57,19 @@ # shared memory segments to core files. # Defaults to false # +# [*vpp_tuntap_enable*] +# (optional) enable VPP tuntap driver +# Valid values are true or false. +# Defaults to undef +# +# [*vpp_tuntap_mtu*] +# (optional) VPP tuntap interface MTU +# Defaults to undef +# +# [*vpp_tapcli_mtu*] +# (optional) VPP tapcli interface MTU +# Defaults to undef +# # [*copy_kernel_nic_ip*] # (optional) Configures VPP interface with IP settings found on its corresponding kernel NIC. # Defaults to true @@ -73,6 +86,9 @@ class fdio ( $vpp_vhostuser_coalesce_frames = $::fdio::params::vpp_vhostuser_coalesce_frames, $vpp_vhostuser_coalesce_time = $::fdio::params::vpp_vhostuser_coalesce_time, $vpp_vhostuser_dont_dump_memory = $::fdio::params::vpp_vhostuser_dont_dump_memory, + $vpp_tuntap_enable = $::fdio::params::vpp_tuntap_enable, + $vpp_tuntap_mtu = $::fdio::params::vpp_tuntap_mtu, + $vpp_tapcli_mtu = $::fdio::params::vpp_tapcli_mtu, $copy_kernel_nic_ip = $::fdio::params::copy_kernel_nic_ip, ) inherits ::fdio::params { diff --git a/manifests/params.pp b/manifests/params.pp index 8859667..3df8175 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -14,5 +14,8 @@ class fdio::params { $vpp_vhostuser_coalesce_frames = undef $vpp_vhostuser_coalesce_time = undef $vpp_vhostuser_dont_dump_memory = false + $vpp_tuntap_enable = undef + $vpp_tuntap_mtu = undef + $vpp_tapcli_mtu = undef $copy_kernel_nic_ip = true } diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb index 68f2013..4be1865 100644 --- a/spec/acceptance/fdio_spec.rb +++ b/spec/acceptance/fdio_spec.rb @@ -41,6 +41,9 @@ describe 'fdio' do vpp_vhostuser_coalesce_frames => 32, vpp_vhostuser_coalesce_time => 0.05, vpp_vhostuser_dont_dump_memory => true, + vpp_tuntap_enable => true, + vpp_tuntap_mtu => 9000, + vpp_tapcli_mtu => 8000, } EOS @@ -54,6 +57,9 @@ describe 'fdio' do its(:content) { should match /coalesce-frames\s+32/ } its(:content) { should match /coalesce-time\s+0.05/ } its(:content) { should match /dont-dump-memory/ } + its(:content) { should match /enable/ } + its(:content) { should match /mtu 9000/ } + its(:content) { should match /mtu 8000/ } end end end diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb index 4786ac0..3b260ca 100644 --- a/spec/classes/fdio_spec.rb +++ b/spec/classes/fdio_spec.rb @@ -86,6 +86,21 @@ describe 'fdio' do is_expected.to contain_vpp_config('vhost-user/dont-dump-memory').with_ensure('present') end end + + context 'with tuntap/tapcli' do + before :each do + params.merge!( + :vpp_tuntap_enable => true, + :vpp_tuntap_mtu => 9000, + :vpp_tapcli_mtu => 9000 + ) + end + it 'should configure vhost-user options' do + is_expected.to contain_vpp_config('tuntap/enable').with_ensure('present') + is_expected.to contain_vpp_config('tuntap/mtu').with_value('9000') + is_expected.to contain_vpp_config('tapcli/mtu').with_value('9000') + end + end end shared_examples_for 'fdio - service' do |