diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-08 12:01:39 +0000 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-08 12:01:39 +0000 |
commit | 48933108172072328a142e5bcc5800ac82374581 (patch) | |
tree | 855243dd0cb7488ea0190d8cabc3c83636ef2ab2 /scripts | |
parent | 76d1c11778338f455f313f2f8e3efc6dfe1f9ffb (diff) | |
download | vyatta-cfg-system-48933108172072328a142e5bcc5800ac82374581.tar.gz vyatta-cfg-system-48933108172072328a142e5bcc5800ac82374581.zip |
vyatta-cfg-system: add option to modify interface scatter-gather option
Allow the setting of the interfaces scatter-gather offload setting.
This is useful for working around hardware related NIC problems and
enables it to be set directly in the configuration.
Bug #526 http://bugzilla.vyos.net/show_bug.cgi?id=526
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 367105c3..d04ad395 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -64,6 +64,7 @@ Usage: $0 --dev=<interface> --check=<type> $0 --dev=<interface> --isup $0 --dev=<interface> --offload-option={tcp-segmention,udp-fragmentation} {value} $0 --dev=<interface> --offload-option={generic-segmentation,generic-receive} {value} + $0 --dev=<interface> --offload-option={scatter-gather} {value} $0 --show=<type> EOF exit 1; @@ -579,8 +580,14 @@ sub allowed_speed { sub get_offload_option { my ($dev, $option) = @_; - my ($val); - my $ethtool_option = "$option-offload"; + my $val; + my $ethtool_option; + + if ($option ne 'scatter-gather') { + $ethtool_option = "$option-offload"; + } else { + $ethtool_option = $option; + } open(my $ethtool, '-|', "$ETHTOOL -k $dev 2>&1") or die "ethtool failed: $!\n"; while (<$ethtool>) { @@ -589,7 +596,7 @@ sub get_offload_option { $val = (split(/: /, $_))[1]; } close $ethtool; - return ($val); + return $val; } @@ -604,6 +611,7 @@ sub set_offload_option { 'generic-segmentation' => 'gso', 'tcp-segmentation' => 'tso', 'udp-fragmentation' => 'ufo', + 'scatter-gather' => 'sg', ); if (defined($nvalue) && $nvalue ne $ovalue) { |