compute: ability to disable TSO/GSO/GRO on Debian systems

As an option (enabled by default), allow the possibility to disable
TSO/GSO/GRO on Neutron network interfaces to improve network
performances over GRE tunnels.

- Enable tso script at boot
- Ensure the service is running

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2014-08-08 16:14:38 +02:00
parent bcdc407228
commit 20febc37c6
2 changed files with 60 additions and 0 deletions

View File

@ -29,6 +29,11 @@
# cinder volumes backend by ceph on nova instances.
# Default to false.
#
# [*manage_tso]
# (optional) Enable or not TSO/GSO/GRO/UFO on neutron interfaces.
# Should be at True when running linux kernel 3.14.
# Default to true.
#
class cloud::compute::hypervisor(
$server_proxyclient_address = '127.0.0.1',
@ -43,6 +48,7 @@ class cloud::compute::hypervisor(
$nova_rbd_secret_uuid = undef,
$vm_rbd = false,
$volume_rbd = false,
$manage_tso = true,
# set to false to keep backward compatibility
$ks_spice_public_proto = false,
$ks_spice_public_host = false,
@ -137,6 +143,21 @@ Host *
if $has_ceph or $vm_rbd {
fail('Red Hat does not support RBD backend for VMs.')
}
} else {
# Disabling or not TSO/GSO/GRO on Debian systems
if $manage_tso {
ensure_resource ('exec','enable-tso-script', {
'command' => '/usr/sbin/update-rc.d disable-tso defaults',
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
'onlyif' => 'test -f /etc/init.d/disable-tso'
})
ensure_resource ('exec','start-tso-script', {
'command' => '/etc/init.d/disable-tso start',
'unless' => 'test -f /tmp/disable-tso-lock',
'onlyif' => 'test -f /etc/init.d/disable-tso'
})
}
}
if $::operatingsystem == 'Ubuntu' {

View File

@ -83,6 +83,7 @@ describe 'cloud::compute::hypervisor' do
:ks_spice_public_host => '10.0.0.2',
:vm_rbd => false,
:volume_rbd => false,
:manage_tso => true,
:ks_nova_public_host => '10.0.0.1' }
end
@ -269,6 +270,44 @@ describe 'cloud::compute::hypervisor' do
end
end
context 'without TSO/GSO/GRO on Debian systems' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it 'ensure TSO script is enabled at boot' do
should contain_exec('enable-tso-script').with(
:command => '/usr/sbin/update-rc.d disable-tso defaults',
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
:onlyif => 'test -f /etc/init.d/disable-tso'
)
end
it 'start TSO script' do
should contain_exec('start-tso-script').with(
:command => '/etc/init.d/disable-tso start',
:unless => 'test -f /tmp/disable-tso-lock',
:onlyif => 'test -f /etc/init.d/disable-tso'
)
end
end
context 'with TSO/GSO/GRO on Debian systems' do
before :each do
facts.merge!( :osfamily => 'Debian' )
params.merge!( :manage_tso => false )
end
it 'ensure TSO script is not enabled at boot' do
should_not contain_exec('enable-tso-script')
end
it 'do no tstart TSO script' do
should_not contain_exec('start-tso-script')
end
end
context 'with RBD backend for instances and volumes on Debian plaforms' do
before :each do
facts.merge!( :osfamily => 'Debian' )