diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-27 10:26:39 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-27 10:26:39 -0700 |
commit | ab75c62a0c22d95512cf7792370f5552ac5da39e (patch) | |
tree | e03aeeebe7eafa73d639198c2f313d702345c6af /templates/interfaces | |
parent | 6794fb6c22fc79f5f31040a00723508b888950a3 (diff) | |
download | vyatta-cfg-quagga-ab75c62a0c22d95512cf7792370f5552ac5da39e.tar.gz vyatta-cfg-quagga-ab75c62a0c22d95512cf7792370f5552ac5da39e.zip |
IRQ affinity update
1. Move scripts to vyatta-cfg-system
2. Use syntax to check for legal values
3. Don't fail on UP
Diffstat (limited to 'templates/interfaces')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/smp_affinity/node.def | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/templates/interfaces/ethernet/node.tag/smp_affinity/node.def b/templates/interfaces/ethernet/node.tag/smp_affinity/node.def index a6498f88..671a28f0 100644 --- a/templates/interfaces/ethernet/node.tag/smp_affinity/node.def +++ b/templates/interfaces/ethernet/node.tag/smp_affinity/node.def @@ -20,31 +20,19 @@ val_help: auto; Automatic CPU affinity (default) default: "auto" -syntax:expression: exec " \ - if [ $VAR(@) = auto ]; then \ - exit 0; - else \ - /opt/vyatta/sbin/vyatta-irqaffin check $VAR(../@) $VAR(@); \ - fi" - -update: - if [ $(cat /sys/devices/system/cpu/present) = 0 ]; then - exit 0 - fi - if [ "$VAR(@)" = "auto" ]; then - echo "Setting SMP affinity for $VAR(../@) automatically." +syntax:expression: $VAR(@) == "auto" || pattern $VAR(@) "^[0-9a-f]+$" ; + "IRQ affinity mask must be hex value or auto" + +commit:expression: exec "\ + [ \"$VAR(@)\" == \"auto\" ] || \ + /opt/vyatta/sbin/vyatta-irqaffin check $VAR(../@) $VAR(@)" + +update: if [ "$VAR(@)" = "auto" ]; then sudo /opt/vyatta/sbin/vyatta-auto-irqaffin.pl --setup $VAR(../@) - exit 0 else sudo /opt/vyatta/sbin/vyatta-irqaffin set $VAR(../@) $VAR(@) - if [ $? -ne 0 ]; then - echo "Error setting CPU affinity mask $VAR(@) on interface $VAR(../@)" - exit 1 - fi fi delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0 - if ! sudo /opt/vyatta/sbin/vyatta-irqaffin reset $VAR(../@); then - echo "Warning: Can't reset CPU affinity mask on interface $VAR(../@)" - exit 0 - fi + sudo /opt/vyatta/sbin/vyatta-irqaffin reset $VAR(../@) + |