diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-03-30 15:04:52 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2011-03-30 15:04:52 -0700 |
commit | 48709740cd726149372b0bfd40322b0eefb2f438 (patch) | |
tree | 22e29251c1b429eb5b5356380326f7f962031c12 | |
parent | 9602f30c34f9cc151bea43dc9a52016f57124cbc (diff) | |
download | vyatta-cfg-quagga-48709740cd726149372b0bfd40322b0eefb2f438.tar.gz vyatta-cfg-quagga-48709740cd726149372b0bfd40322b0eefb2f438.zip |
Reset irq affinity when adding interface to bond group
Bug 6947
When adding device to bond-group, restore smp affinity
-rwxr-xr-x | scripts/vyatta-bonding.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/vyatta-bonding.pl b/scripts/vyatta-bonding.pl index fe07b1a2..6215049f 100755 --- a/scripts/vyatta-bonding.pl +++ b/scripts/vyatta-bonding.pl @@ -129,6 +129,19 @@ sub primary_slave { return $match; } +sub smp_affinity { + my $intf = shift; + my $cfg = new Vyatta::Config; + + my $slaveif = new Vyatta::Interface($intf); + unless ($slaveif) { + warn "$intf: unknown interface type"; + return; + } + $cfg->setLevel($slaveif->path()); + return $cfg->returnValue('smp_affinity'); +} + sub if_down { my $intf = shift; system "ip link set dev $intf down" @@ -139,6 +152,12 @@ sub if_up { my $intf = shift; system "ip link set dev $intf up" and die "Could not set $intf up ($!)\n"; + + my $smp_affinity = get_irq_affinity($intf); + if ($smp_affinity) { + system "irq-affinity.pl $intf $smp_affinity" + and warn "Could not set $intf smp_affinity $smp_affinity\n"; + } } # Can't change mode when bond device is up and slaves are attached |