From c751135c680b91680480835b5f1225c833f9e633 Mon Sep 17 00:00:00 2001 From: Karthik S Date: Fri, 14 Jul 2017 04:25:35 -0400 Subject: [PATCH] Enable dpdk after setting all other dpdk parameters In OvS 2.7, setting dpdk-init=true enables DPDK and reconfigures the vswitch with the dpdk parameters earlier configured in ovsdb. In order to avoid restarting openvswitch after enabling DPDK and to use this feature, all the dpdk parameters shall be configured in ovsdb before enabling DPDK. Change-Id: I3a33f8287bbabe2bcaf7f4556dd78d5b9d6914b6 Signed-off-by: Karthik S --- manifests/dpdk.pp | 9 ++++++++- spec/classes/vswitch_dpdk_spec.rb | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/manifests/dpdk.pp b/manifests/dpdk.pp index 543078ae..40cb4ceb 100644 --- a/manifests/dpdk.pp +++ b/manifests/dpdk.pp @@ -99,7 +99,6 @@ class vswitch::dpdk ( $dpdk_configs = { 'other_config:dpdk-extra' => { value => $memory_channels_conf, skip_if_version => '2.5'}, - 'other_config:dpdk-init' => { value => 'true', skip_if_version => '2.5'}, 'other_config:dpdk-socket-mem' => { value => $socket_mem, skip_if_version => '2.5'}, 'other_config:dpdk-lcore-mask' => { value => $dpdk_lcore_mask, skip_if_version => '2.5'}, 'other_config:pmd-cpu-mask' => { value => $pmd_core_mask}, @@ -108,6 +107,14 @@ class vswitch::dpdk ( $dpdk_dependencies = { wait => false, require => Service['openvswitch'], + notify => Vs_config['other_config:dpdk-init'], + } + + vs_config { 'other_config:dpdk-init': + value => 'true', + skip_if_version => '2.5', + require => Service['openvswitch'], + wait => true, } service { 'openvswitch': diff --git a/spec/classes/vswitch_dpdk_spec.rb b/spec/classes/vswitch_dpdk_spec.rb index d08a6d68..71a8ed1f 100644 --- a/spec/classes/vswitch_dpdk_spec.rb +++ b/spec/classes/vswitch_dpdk_spec.rb @@ -52,7 +52,7 @@ describe 'vswitch::dpdk' do is_expected.to contain_file_line('/etc/sysconfig/openvswitch') is_expected.to contain_vs_config('other_config:dpdk-init').with( - :value => 'true', :wait => false, :skip_if_version => "2.5", + :value => 'true', :wait => true, :skip_if_version => "2.5", ) is_expected.to contain_vs_config('other_config:pmd-cpu-mask').with( :value => nil, :wait => false, @@ -83,7 +83,7 @@ describe 'vswitch::dpdk' do :before => 'Service[openvswitch]', ) is_expected.to contain_vs_config('other_config:dpdk-init').with( - :value => 'true', :wait => false, :skip_if_version => "2.5", + :value => 'true', :wait => true, :skip_if_version => "2.5", ) is_expected.to contain_vs_config('other_config:pmd-cpu-mask').with( :value => nil, :wait => false, @@ -116,7 +116,7 @@ describe 'vswitch::dpdk' do :before => 'Service[openvswitch]', ) is_expected.to contain_vs_config('other_config:dpdk-init').with( - :value => 'true', :wait => false, :skip_if_version => "2.5", + :value => 'true', :wait => true, :skip_if_version => "2.5", ) is_expected.to contain_vs_config('other_config:pmd-cpu-mask').with( :value => '3c0000000003c00000', :wait => false, @@ -163,7 +163,7 @@ describe 'vswitch::dpdk' do :before => 'Service[openvswitch]', ) is_expected.to contain_vs_config('other_config:dpdk-init').with( - :value => 'true', :wait => false, :skip_if_version => "2.5", + :value => 'true', :wait => true, :skip_if_version => "2.5", ) is_expected.to contain_vs_config('other_config:pmd-cpu-mask').with( :value => nil, :wait => false,