Add support for the hw-offload option in dpdk

This change implement support for the hw-offload option in dpdk. This
parameter is already supported in non-dpdk deployment but is also valid
for dpdk deployment.

Change-Id: Ibd285bf73fa10e6e9cd338625662063dc9a1d753
This commit is contained in:
Takashi Kajinami 2021-03-11 00:04:35 +09:00
parent 4887f4ccd6
commit 0d026451bd
3 changed files with 29 additions and 0 deletions

View File

@ -29,6 +29,12 @@
# socket 1 and no allocation for socket 0, the value should be "0,1024"
# Defaults to undef.
#
# [*enable_hw_offload*]
# (optional) Configure OVS to use
# Hardware Offload. This feature is
# supported from ovs 2.8.0.
# Defaults to false.
#
# [*disable_emc*]
# (optional) Configure OVS to disable EMC.
# Defaults to false
@ -56,6 +62,7 @@ class vswitch::dpdk (
$package_ensure = 'present',
$pmd_core_list = undef,
$socket_mem = undef,
$enable_hw_offload = false,
$disable_emc = false,
$vlan_limit = $::os_service_default,
$revalidator_cores = undef,
@ -101,6 +108,16 @@ class vswitch::dpdk (
notify => Vs_config['other_config:dpdk-init'],
}
# lint:ignore:quoted_booleans
if $enable_hw_offload {
vs_config { 'other_config:hw-offload':
value => 'true',
notify => Service['openvswitch'],
wait => true,
}
}
# lint:endignore
if $disable_emc {
vs_config { 'other_config:emc-insert-inv-prob':
value => '0',

View File

@ -0,0 +1,6 @@
---
features:
- |
The new ``vsiwtch::dpdk::enable_hw_offload`` parameter has been added. This
parameter can be used to enable or disable hardware offload when dpdk is
used.

View File

@ -27,6 +27,7 @@ describe 'vswitch::dpdk' do
params.merge!(:socket_mem => '')
params.merge!(:memory_channels => '' )
params.merge!(:pmd_core_list => '')
params.merge!(:enable_hw_offload => false)
params.merge!(:disable_emc => false)
end
it 'configures dpdk options' do
@ -45,6 +46,7 @@ describe 'vswitch::dpdk' do
is_expected.to contain_vs_config('other_config:dpdk-extra').with(
:value => nil, :wait => false,
)
is_expected.to_not contain_vs_config('other_config:hw-offload')
is_expected.to_not contain_vs_config('other_config:emc-insert-inv-prob')
is_expected.to_not contain_vs_config('other_config:vlan-limit')
@ -57,6 +59,7 @@ describe 'vswitch::dpdk' do
params.merge!(:socket_mem => '1024')
params.merge!(:memory_channels => 2)
params.merge!(:pmd_core_list => '22,23,24,25,66,67,68,69')
params.merge!(:enable_hw_offload => true)
params.merge!(:disable_emc => true)
params.merge!(:vlan_limit => 2)
end
@ -76,6 +79,9 @@ describe 'vswitch::dpdk' do
is_expected.to contain_vs_config('other_config:dpdk-extra').with(
:value => '-n 2', :wait => false,
)
is_expected.to contain_vs_config('other_config:hw-offload').with(
:value => 'true', :notify => 'Service[openvswitch]', :wait => true,
)
is_expected.to contain_vs_config('other_config:emc-insert-inv-prob').with(
:value => '0', :notify => 'Service[openvswitch]', :wait => false,
)