From 20febc37c67534c536713485000c2da9ec976801 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 8 Aug 2014 16:14:38 +0200 Subject: [PATCH] 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 --- manifests/compute/hypervisor.pp | 21 ++++++++++ spec/classes/cloud_compute_hypervisor_spec.rb | 39 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/manifests/compute/hypervisor.pp b/manifests/compute/hypervisor.pp index 781868e8..7f87832b 100644 --- a/manifests/compute/hypervisor.pp +++ b/manifests/compute/hypervisor.pp @@ -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' { diff --git a/spec/classes/cloud_compute_hypervisor_spec.rb b/spec/classes/cloud_compute_hypervisor_spec.rb index c346ae8b..f579f089 100644 --- a/spec/classes/cloud_compute_hypervisor_spec.rb +++ b/spec/classes/cloud_compute_hypervisor_spec.rb @@ -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' )