1
0
Fork 0

Merge pull request #70 from olysonek/replace_ethtool_in_scripts

Replace ethtool invocation in scripts by built-in functionality
This commit is contained in:
Jaroslav Škarvada 2017-09-19 16:50:54 +02:00 committed by GitHub
commit 182d3f4abd
6 changed files with 18 additions and 26 deletions

View file

@ -137,6 +137,8 @@ install: install-dirs
$(DESTDIR)/etc/tuned/realtime-virtual-host-variables.conf
mv $(DESTDIR)$(TUNED_PROFILESDIR)/cpu-partitioning/cpu-partitioning-variables.conf \
$(DESTDIR)/etc/tuned/cpu-partitioning-variables.conf
mv $(DESTDIR)$(TUNED_PROFILESDIR)/sap-hana-vmware/sap-hana-vmware-variables.conf \
$(DESTDIR)/etc/tuned/sap-hana-vmware-variables.conf
install -pm 0644 recommend.conf $(DESTDIR)$(TUNED_RECOMMEND_DIR)/50-tuned.conf
# bash completion

View file

@ -0,0 +1,3 @@
# Set this to the network interfaces which should have
# large receive offload disabled
sap_hana_vmware_nic=!*

View file

@ -1,22 +0,0 @@
#!/bin/bash
# SAP ktune script
#
# TODO: drop this script and implement native support
# into plugins
. /usr/lib/tuned/functions
start() {
ethtool -K eth0 lro off
return 0
}
stop() {
ethtool -K eth0 lro on
return 0
}
process $@

View file

@ -6,6 +6,11 @@
summary=Optimize for SAP HANA running inside a VMware guest
include=throughput-performance
[variables]
# User is responsible for setting sap_hana_vmware_nic
# in sap-hana-vmware-variables.conf
include=/etc/tuned/sap-hana-vmware-variables.conf
[cpu]
force_latency=1
@ -17,5 +22,6 @@ vm.swappiness = 30
kernel.sem = 1250 256000 100 8192
kernel.numa_balancing = 0
[script]
script=${i:PROFILE_DIR}/script.sh
[net]
devices=${sap_hana_vmware_nic}
features=lro off

View file

@ -267,6 +267,7 @@ fi
%exclude %{_sysconfdir}/tuned/realtime-virtual-guest-variables.conf
%exclude %{_sysconfdir}/tuned/realtime-virtual-host-variables.conf
%exclude %{_sysconfdir}/tuned/cpu-partitioning-variables.conf
%exclude %{_sysconfdir}/tuned/sap-hana-vmware-variables.conf
%exclude %{_prefix}/lib/tuned/default
%exclude %{_prefix}/lib/tuned/desktop-powersave
%exclude %{_prefix}/lib/tuned/laptop-ac-powersave
@ -341,6 +342,7 @@ fi
%files profiles-sap-hana
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/tuned/sap-hana-vmware-variables.conf
%{_prefix}/lib/tuned/sap-hana
%{_prefix}/lib/tuned/sap-hana-vmware
%{_mandir}/man7/tuned-profiles-sap-hana.7*

View file

@ -197,7 +197,8 @@ class NetTuningPlugin(base.Plugin):
"rx-frame-low:": "rx-frames-low:", \
"rx-frame-high:": "rx-frames-high:", \
"tx-frame-low:": "tx-frames-low:", \
"tx-frame-high:": "tx-frames-high:"}, value)
"tx-frame-high:": "tx-frames-high:",
"large-receive-offload:": "lro:"}, value)
# remove empty lines, remove fixed parameters (those with "[fixed]")
vl = filter(lambda v: len(str(v)) > 0 and not re.search("\[fixed\]$", str(v)), value.split('\n'))
if len(vl) < 2:
@ -319,9 +320,9 @@ class NetTuningPlugin(base.Plugin):
return None
if not sim:
log.debug("setting %s: %s" % (context, str(d)))
# ignore ethtool return code 80, it means parameter is already set
context2opt = { "coalesce": "-C", "features": "-K", "pause": "-A", "ring": "-G" }
opt = context2opt[context]
# ignore ethtool return code 80, it means parameter is already set
self._cmd.execute(["ethtool", opt, device] + self._cmd.dict2list(d), no_errors = [80])
return d