summaryrefslogtreecommitdiff
path: root/scripts/system/irq-affinity.pl
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-07 14:24:26 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-07 14:24:26 -0600
commitbc3658682531c35a4015c46913acfa95972ba77d (patch)
tree594d7e7d190c3bef54b15a18e90e90b3f2e2b8d4 /scripts/system/irq-affinity.pl
parent9d9813280dca4c6657a5570568bae54360f0afbc (diff)
parentcf21f8a49f22efcb0a0ce0a99ba2755269320a9b (diff)
downloadvyatta-cfg-quagga-bc3658682531c35a4015c46913acfa95972ba77d.tar.gz
vyatta-cfg-quagga-bc3658682531c35a4015c46913acfa95972ba77d.zip
Merge branch 'napa' of git.vyatta.com:/git/vyatta-cfg-system into napa
Diffstat (limited to 'scripts/system/irq-affinity.pl')
-rwxr-xr-xscripts/system/irq-affinity.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl
index ed8063ff..cf68c0d1 100755
--- a/scripts/system/irq-affinity.pl
+++ b/scripts/system/irq-affinity.pl
@@ -157,7 +157,11 @@ sub first_cpu {
unless defined($ifunit);
my $threads = threads_per_core();
- return ( $ifunit * $threads ) % $cpus;
+ # Give the load first to one CPU of each hyperthreaded core, then
+ # if there are enough NICs, give the load to the other CPU of
+ # each core.
+ my $ht_wrap = (($ifunit * $threads) / $cpus) % $threads;
+ return ((($ifunit * $threads) + $ht_wrap) % $cpus);
}
# Assignment for multi-queue NICs
@@ -229,7 +233,7 @@ sub check_mask {
die "$ifname: $name mask $mask has no bits set\n"
if ($m == 0);
- die "$ifname: $name mask $mask to large for number of CPU's: $cpus\n"
+ die "$ifname: $name mask $mask too large for number of CPU's: $cpus\n"
if ($m >= 1 << $cpus);
}