diff options
author | Wojciech Dec <wdec@cisco.com> | 2017-11-14 14:29:51 +0100 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2017-11-15 13:29:12 -0500 |
commit | 55c9ca2f20c501209d883d288797d7b25b3ceb4f (patch) | |
tree | a07bfe250847f9489c866ce9c0ede5867c24cab3 | |
parent | 649f2727b4c7621e541957d79d92259b637bdbf6 (diff) |
Remove default setting of uio_driver
Change-Id: Iabf7a4e33e88a2127e1746fa9a585a6ddd46eef9
Signed-off-by: Wojciech Dec <wdec@cisco.com>
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | manifests/config.pp | 12 | ||||
-rw-r--r-- | manifests/init.pp | 2 | ||||
-rw-r--r-- | manifests/params.pp | 2 | ||||
-rw-r--r-- | spec/acceptance/fdio_spec.rb | 1 | ||||
-rw-r--r-- | spec/classes/fdio_spec.rb | 20 |
6 files changed, 23 insertions, 16 deletions
@@ -88,7 +88,7 @@ Valid options: list of PCI devices in the form of "DDDD:BB:SS.F" Sets the uio-driver for VPP -Default: `uio_pci_generic` +Default: `undef` Valid options: `vfio-pci`, `uio_pci_generic` and `igb_uio`. Note that `igb_uio` must be already loaded in the kernel before this module is invoked. diff --git a/manifests/config.pp b/manifests/config.pp index 9f5fc58..12f1cd4 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -6,11 +6,13 @@ class fdio::config { if $fdio::vpp_dpdk_support { # ensure that dpdk module is loaded - $dpdk_pmd_real = regsubst($fdio::vpp_dpdk_uio_driver, '-', '_', 'G') - exec { 'insert_dpdk_kmod': - command => "modprobe ${fdio::vpp_dpdk_uio_driver}", - unless => "lsmod | grep ${dpdk_pmd_real}", - path => '/bin:/sbin', + if !empty($fdio::vpp_dpdk_uio_driver) { + $dpdk_pmd_real = regsubst($fdio::vpp_dpdk_uio_driver, '-', '_', 'G') + exec { 'insert_dpdk_kmod': + command => "modprobe ${fdio::vpp_dpdk_uio_driver}", + unless => "lsmod | grep ${dpdk_pmd_real}", + path => '/bin:/sbin', + } } vpp_config { diff --git a/manifests/init.pp b/manifests/init.pp index cdd9499..704a526 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -27,7 +27,7 @@ # # [*vpp_dpdk_uio_driver*] # (optional) VPP DPDK UIO driver type. -# Defaults to 'uio_pci_generic' +# Defaults to undef # # [*vpp_dpdk_dev_default_options*] # (optional) VPP interface default options configuration. diff --git a/manifests/params.pp b/manifests/params.pp index 4528e6a..c312d88 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,7 +8,7 @@ class fdio::params { $vpp_exec_file = '/etc/vpp/vpp-exec' $vpp_dpdk_support = true $vpp_dpdk_devs = [] - $vpp_dpdk_uio_driver = 'uio_pci_generic' + $vpp_dpdk_uio_driver = undef $vpp_dpdk_dev_default_options = undef $vpp_dpdk_socket_mem = undef $vpp_cpu_main_core = undef diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb index 293707f..400641b 100644 --- a/spec/acceptance/fdio_spec.rb +++ b/spec/acceptance/fdio_spec.rb @@ -21,7 +21,6 @@ describe 'fdio' do describe file('/etc/vpp/startup.conf') do it { is_expected.to exist } - its(:content) { should match /uio-driver\s+uio_pci_generic/ } end describe service('vpp') do diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb index b543246..c14fe87 100644 --- a/spec/classes/fdio_spec.rb +++ b/spec/classes/fdio_spec.rb @@ -51,17 +51,23 @@ describe 'fdio' do shared_examples_for 'fdio - config' do it { - should contain_vpp_config('dpdk/uio-driver').with_value('uio_pci_generic') should contain_vpp_config('dpdk/dev/default') should contain_vpp_config('cpu/main-core') should contain_vpp_config('cpu/corelist-workers') } - it { - should contain_exec('insert_dpdk_kmod').with( - 'command' => 'modprobe uio_pci_generic', - 'unless' => 'lsmod | grep uio_pci_generic', - ) - } + + context 'with uio_driver' do + before :each do + params.merge!(:vpp_dpdk_uio_driver => 'uio_pci_generic') + end + it 'should configure uio_driver setting' do + is_expected.to contain_vpp_config('dpdk/uio-driver').with_value('uio_pci_generic') + is_expected.to contain_exec('insert_dpdk_kmod').with( + 'command' => 'modprobe uio_pci_generic', + 'unless' => 'lsmod | grep uio_pci_generic', + ) + end + end context 'with socket_mem' do before :each do |