From 48709740cd726149372b0bfd40322b0eefb2f438 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 30 Mar 2011 15:04:52 -0700 Subject: Reset irq affinity when adding interface to bond group Bug 6947 When adding device to bond-group, restore smp affinity --- scripts/vyatta-bonding.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.3