Browse Source

Add support for vlan_limit option

This change introduces support for the vlan_limit option.
This parameter is currently set to 1 by default, but we should set
it to 2 to enable vlan_transparent, which requires nested vlans.

Related-Bug: #1918418
Change-Id: Id9aaab2a1e3ad2d2d43cd5cddf389d20abaf4461
(cherry picked from commit 4887f4ccd6)
(cherry picked from commit 14011d69c1)
(cherry picked from commit 03d1cc9088)
changes/59/783859/3
Takashi Kajinami 2 months ago
parent
commit
d8acf3cd85
5 changed files with 57 additions and 8 deletions
  1. +13
    -0
      manifests/dpdk.pp
  2. +15
    -2
      manifests/ovs.pp
  3. +7
    -0
      releasenotes/notes/vlan-limit-b40bd9ca223b76ca.yaml
  4. +5
    -0
      spec/classes/vswitch_dpdk_spec.rb
  5. +17
    -6
      spec/classes/vswitch_ovs_spec.rb

+ 13
- 0
manifests/dpdk.pp View File

@ -31,6 +31,11 @@
#
# [*disable_emc*]
# (optional) Configure OVS to disable EMC.
# Defaults to false
#
# [*vlan_limit*]
# (optional) Number of vlan layers allowed.
# Default to $::os_service_default
#
# [*revalidator_cores*]
# (Optional) Number of cores to be used for OVS Revalidator threads.
@ -52,6 +57,7 @@ class vswitch::dpdk (
$pmd_core_list = undef,
$socket_mem = undef,
$disable_emc = false,
$vlan_limit = $::os_service_default,
$revalidator_cores = undef,
$handler_cores = undef,
# DEPRECATED PARAMETERS
@ -103,6 +109,13 @@ class vswitch::dpdk (
}
}
if ! is_service_default($vlan_limit) {
vs_config { 'other_config:vlan-limit':
value => "${vlan_limit}",
wait => true,
}
}
# lint:ignore:quoted_booleans
vs_config { 'other_config:dpdk-init':
value => 'true',


+ 15
- 2
manifests/ovs.pp View File

@ -23,16 +23,22 @@
# (optional) Configure OVS to use
# Hardware Offload. This feature is
# supported from ovs 2.8.0.
# Defaults to False.
# Defaults to false.
#
# [*disable_emc*]
# (optional) Configure OVS to disable EMC.
# Defaults to false.
#
# [*vlan_limit*]
# (optional) Number of vlan layers allowed.
# Default to $::os_service_default
#
class vswitch::ovs(
$package_ensure = 'present',
$dkms_ensure = false,
$enable_hw_offload = false,
$disable_emc = false,
$vlan_limit = $::os_service_default,
) {
include ::vswitch::params
@ -96,6 +102,13 @@ class vswitch::ovs(
}
}
if ! is_service_default($vlan_limit) {
vs_config { 'other_config:vlan-limit':
value => "${vlan_limit}",
wait => true,
}
}
service { 'openvswitch':
ensure => true,
enable => true,


+ 7
- 0
releasenotes/notes/vlan-limit-b40bd9ca223b76ca.yaml View File

@ -0,0 +1,7 @@
---
features:
- |
The following two parameters have been added.
- ``vswitch::ovs::vlan_limit``
- ``vswitch::dpdk::vlan_limit``

+ 5
- 0
spec/classes/vswitch_dpdk_spec.rb View File

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


+ 17
- 6
spec/classes/vswitch_ovs_spec.rb View File

@ -3,10 +3,10 @@ require 'spec_helper'
describe 'vswitch::ovs' do
let :default_params do {
:package_ensure => 'present',
:dkms_ensure => false,
:package_ensure => 'present',
:dkms_ensure => false,
:enable_hw_offload => false,
:disable_emc => false,
:disable_emc => false,
}
end
@ -54,6 +54,10 @@ describe 'vswitch::ovs' do
is_expected.to_not contain_vs_config('other_config:emc-insert-inv-prob')
end
it 'does not set vlan-limit option' do
is_expected.to_not contain_vs_config('other_config:vlan-limit')
end
it 'configures service' do
is_expected.to contain_service('openvswitch').with(
:ensure => true,
@ -76,10 +80,11 @@ describe 'vswitch::ovs' do
context 'custom parameters' do
let :params do
{
:package_ensure => 'latest',
:dkms_ensure => false,
:package_ensure => 'latest',
:dkms_ensure => false,
:enable_hw_offload => true,
:disable_emc => true,
:disable_emc => true,
:vlan_limit => 2,
}
end
it 'installs correct package' do
@ -99,6 +104,12 @@ describe 'vswitch::ovs' do
:value => '0', :notify => 'Service[openvswitch]', :wait => false,
)
end
it 'configures vlan-limit option' do
is_expected.to contain_vs_config('other_config:vlan-limit').with(
:value => '2', :wait => true,
)
end
end
end


Loading…
Cancel
Save