diff options
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 14 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/offload-options/scatter-gather/node.def | 14 |
2 files changed, 25 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) { diff --git a/templates/interfaces/ethernet/node.tag/offload-options/scatter-gather/node.def b/templates/interfaces/ethernet/node.tag/offload-options/scatter-gather/node.def new file mode 100644 index 00000000..71ee1142 --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/offload-options/scatter-gather/node.def @@ -0,0 +1,14 @@ +# +# Configuration template for offload options +# + +priority: 319 # Failure barrier only - no ordering constraints + +type: txt +help: Configure scatter-gather option +val_help: on; Enable scatter-gather +val_help: off; Disable scatter-gather + +syntax:expression: $VAR(@) == "on" || $VAR(@) == "off" ; "Must be either 'on' or 'off'" + +update: sudo /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../../@) --offload-option scatter-gather $VAR(@) |