diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-08 10:05:14 +0000 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-11-08 10:05:14 +0000 |
commit | f39ba64f56099def98a1ed4fe2f8cb510629958a (patch) | |
tree | d6903300b328ecc72590d37724eed65650017f81 /scripts | |
parent | c651357018d5807ea6926a58b2432d0b58685ad8 (diff) | |
download | vyatta-cfg-system-f39ba64f56099def98a1ed4fe2f8cb510629958a.tar.gz vyatta-cfg-system-f39ba64f56099def98a1ed4fe2f8cb510629958a.zip |
vyatta-cfg-system: rename ethernet offload option nodes
Updates to the changes committed in connection with Bug #365 to allow
a workaround for Xen based network issues.
https://github.com/vyos/vyatta-cfg-system/commit/7a5a8500091589f0ede3d5a1dbc8b6b4b3fabf1d
Rename the offload configuration node to offload-options, shorten the
child node names, rename offload-settings to offload-option and add a
more descriptive error message if an option fails to apply to the
interface.
Bug #612 http://bugzilla.vyos.net/show_bug.cgi?id=612
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 4003489b..e57e384b 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -62,7 +62,8 @@ Usage: $0 --dev=<interface> --check=<type> $0 --dev=<interface> --check-speed=speed,duplex $0 --dev=<interface> --allowed-speed $0 --dev=<interface> --isup - $0 --dev=<interface> --offload-settings={tcp,udp,segmentation,receive} {value} + $0 --dev=<interface> --offload-option={tcp-segmention,udp-fragmentation} {value} + $0 --dev=<interface> --offload-option={generic-segmentation,generic-receive} {value} $0 --show=<type> EOF exit 1; @@ -83,21 +84,21 @@ GetOptions( "speed-duplex=s{2}" => \@speed_duplex, "check-speed=s{2}" => \@check_speed, "allowed-speed" => \$allowed_speed, - "offload-settings=s{2}" => \@offload_option, + "offload-option=s{2}" => \@offload_option, ) or usage(); -is_valid_addr_commit($dev, @addr_commit) if (@addr_commit); -is_valid_mac($mac, $dev) if ($mac); -update_mac($mac_update, $dev) if ($mac_update); -dhcp($dhcp_command, $dev) if ($dhcp_command); -is_valid_name($check_name, $dev) if ($check_name); -exists_name($dev) if ($warn_name); -show_interfaces($show_names) if ($show_names); -is_up($dev) if ($check_up); -set_speed_duplex($dev, @speed_duplex) if (@speed_duplex); -check_speed_duplex($dev, @check_speed) if (@check_speed); -allowed_speed($dev) if ($allowed_speed); -set_offload_setting($dev, @offload_option) if (@offload_option); +is_valid_addr_commit($dev, @addr_commit) if (@addr_commit); +is_valid_mac($mac, $dev) if ($mac); +update_mac($mac_update, $dev) if ($mac_update); +dhcp($dhcp_command, $dev) if ($dhcp_command); +is_valid_name($check_name, $dev) if ($check_name); +exists_name($dev) if ($warn_name); +show_interfaces($show_names) if ($show_names); +is_up($dev) if ($check_up); +set_speed_duplex($dev, @speed_duplex) if (@speed_duplex); +check_speed_duplex($dev, @check_speed) if (@check_speed); +allowed_speed($dev) if ($allowed_speed); +set_offload_option($dev, @offload_option) if (@offload_option); exit 0; sub is_ip_configured { @@ -576,7 +577,7 @@ sub allowed_speed { print 'auto ', join(' ', sort keys %speeds), "\n"; } -sub get_offload_setting { +sub get_offload_option { my ($dev, $option) = @_; my ($val); @@ -591,17 +592,17 @@ sub get_offload_setting { } -sub set_offload_setting { +sub set_offload_option { my ($intf, $option, $nvalue) = @_; die "Missing --dev argument\n" unless $intf; - my $ovalue = get_offload_setting($intf, $option); + my $ovalue = get_offload_option($intf, $option); my %ethtool_opts = ( - 'generic-receive-offload' => 'gro', - 'generic-segmentation-offload' => 'gso', - 'tcp-segmentation-offload' => 'tso', - 'udp-fragmentation-offload' => 'ufo', + 'generic-receive' => 'gro', + 'generic-segmentation' => 'gso', + 'tcp-segmentation' => 'tso', + 'udp-fragmentation' => 'ufo', ); if (defined($nvalue) && $nvalue ne $ovalue) { @@ -609,7 +610,7 @@ sub set_offload_setting { system($cmd); if ($? >> 8) { - die "exec of $ETHTOOL failed: '$cmd'"; + die "Offload option for $option is not supported on $intf\n"; } } |