diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-02-07 14:24:26 -0600 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-02-07 14:24:26 -0600 |
commit | bc3658682531c35a4015c46913acfa95972ba77d (patch) | |
tree | 594d7e7d190c3bef54b15a18e90e90b3f2e2b8d4 /scripts/system/irq-affinity.pl | |
parent | 9d9813280dca4c6657a5570568bae54360f0afbc (diff) | |
parent | cf21f8a49f22efcb0a0ce0a99ba2755269320a9b (diff) | |
download | vyatta-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-x | scripts/system/irq-affinity.pl | 8 |
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); } |