diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-06 15:57:04 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-06 15:57:04 -0700 |
commit | bdba1ac96e48e5d3b4cfa0b31ebafa1f8255787f (patch) | |
tree | 8c5674fdeb49e7af052eea50783cb193747e8239 /scripts | |
parent | 29848f4c36e96fb9965485a81086fb10cf72d3ae (diff) | |
download | vyatta-cfg-system-bdba1ac96e48e5d3b4cfa0b31ebafa1f8255787f.tar.gz vyatta-cfg-system-bdba1ac96e48e5d3b4cfa0b31ebafa1f8255787f.zip |
Support netxen NIC irq naming convention
Bug 7062
The irq's on Netxen NIC are named:
eth0[0] eth0[1] eth0[2] ...
This confuses the auto IRQ affinity script.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/system/irq-affinity.pl | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl index a1c0793c..ff98d590 100755 --- a/scripts/system/irq-affinity.pl +++ b/scripts/system/irq-affinity.pl @@ -146,15 +146,9 @@ sub next_cpu { return $cpu; } -# First cpu to assign for the queues -sub first_cpu { - my ($ifname, $numq) = @_; - - # For multi-queue nic's always starts with 0 - # This is less than ideal when there are more core's available - # than number of queues (probably should barber pole); - # but the Intel IXGBE needs CPU 0 <-> queue 0 because of flow director - return 0 if ($numq > 1); +# Get cpu to assign for the queues for single queue nic +sub choose_cpu { + my $ifname = shift; # For single-queue nic choose IRQ based on name # Ideally should make decision on least loaded CPU @@ -175,7 +169,13 @@ sub assign_multiqueue { my $ifname = shift; my $irqmap = shift; my $numq = $#_; - my $cpu = first_cpu($ifname, $numq); + + # For multi-queue nic's always starts with 0 + # This is less than ideal when there are more core's available + # than number of queues (probably should barber pole); + # but the Intel IXGBE needs CPU 0 <-> queue 0 + # because of flow director bug. + my $cpu = 0; foreach my $name (sort @_) { my $irq = $irqmap->{$name}; @@ -200,7 +200,7 @@ sub assign_multiqueue { # number into a CPU number. sub assign_single { my ( $ifname, $irq ) = @_; - my $cpu = first_cpu($ifname, 1); + my $cpu = choose_cpu($ifname); syslog( LOG_INFO, "%s: assign irq %d to cpu %d", $ifname, $irq, $cpu ); @@ -294,6 +294,13 @@ sub affinity_auto { return; } + # Netxen thought up yet another convention + @mirq = grep { /^$ifname\[/ } @irqnames; + if ( $#mirq > 0 ) { + assign_multiqueue( $ifname, $irqmap, @mirq ); + return; + } + syslog(LOG_ERR, "%s: Unknown multiqueue irq naming: %s\n", $ifname, join(' ', @irqnames)); } |