Adjusting tap interface settings

Jun 8, 2016
344
74
93
48
Johannesburg, South Africa
We have certain guests which perform badly until we disable certain offloading features such as TSO. We already disable GRO on physical uplink ports by calling 'ethtool -K ethX gro off' in /etc/rc.local but want to stop applying per VM customisations by disabling offload capabilities on the TAP interfaces.

Proxmox apparently already has hooks for this, could someone detail how we can get a script run with TAP interface names present either as environment variables or command line arguments?

This was we could structure a central script which does something similar to:
Code:
[ `echo $tap | grep -c 'tap295i0'` -gt 0 ] && ethtool -K $tap tso off;
 
We have certain guests which perform badly until we disable certain offloading features such as TSO. We already disable GRO on physical uplink ports by calling 'ethtool -K ethX gro off' in /etc/rc.local but want to stop applying per VM customisations by disabling offload capabilities on the TAP interfaces.

Proxmox apparently already has hooks for this, could someone detail how we can get a script run with TAP interface names present either as environment variables or command line arguments?

This was we could structure a central script which does something similar to:
Code:
[ `echo $tap | grep -c 'tap295i0'` -gt 0 ] && ethtool -K $tap tso off;

there are no hook points for this (or at least, none which are for external consumption/part of any API). but - the creation of a network device is easily observable (e.g. via netlink or udev), and reacting to it by running an arbitrary script should not be a problem (either by running your own custom daemon monitoring and reacting, or by writting udev rules and letting udevd do the rest for you ;)).
 
I've been using FreePBX as a GUI to manage Asterisk for a long time and really value the flexibility the developers provide by having hooks available pretty much everywhere.

Where would I log an official feature request, to have Proxmox fire scripts when booting or shutting down VMs where various environment variables would be set within the shell environment calling a custom trigger script, should it exist?
 
I'm not sure this would actually stay effective. If I disable TSO early when a VM boots, the moment the guest itself turns it on it also switches on the host.
If that's not a concern for you, you could try to use a systemd.link file such as:
Code:
# /etc/systemd/network/50-tap-offloading.link
[Match]
Driver=tun
OriginalName=tap[0-9]*i[0-9]*

[Link]
TCPSegmentationOffload=false
(Note that the name is a glob, not a regex, the [0-9] is just to have a slightly stricter match but it'll also match tap3fooi3bar...)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!