summaryrefslogtreecommitdiff
path: root/scripts/system
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-05-02 15:28:56 -0700
committerStephen Hemminger <shemminger@vyatta.com>2011-05-02 16:39:54 -0700
commit9aa70813c98ae360d4320dfdb6112b7a1e3b593b (patch)
treea0cf32c855d2e5c1ba17a07974af57899d161c46 /scripts/system
parentedf3dfc9cc6d2d46ef696491476010cd7e73f399 (diff)
downloadvyatta-cfg-system-9aa70813c98ae360d4320dfdb6112b7a1e3b593b.tar.gz
vyatta-cfg-system-9aa70813c98ae360d4320dfdb6112b7a1e3b593b.zip
Fix irq-affinity mapping for multiqueue NIC's
Bug 7032 Fix matchinging of irq's named 'eth0-TxRx-0'. And change the code to handle any form of IRQ naming of multiqueue that is eth0-xxx-0.
Diffstat (limited to 'scripts/system')
-rwxr-xr-xscripts/system/irq-affinity.pl29
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl
index 9b2e6b79..fa8e770a 100755
--- a/scripts/system/irq-affinity.pl
+++ b/scripts/system/irq-affinity.pl
@@ -280,7 +280,8 @@ sub affinity_auto {
assign_single( $ifname, $irq) if $irq;
} elsif ($numirq > 1) {
- my $nrx= grep { /^$ifname-rx-/ } @irqnames;
+ # Match seperate irq for Rx and Tx
+ my $nrx = grep { /^$ifname-rx-/ } @irqnames;
if ( $nrx > 0 ) {
my $ntx = grep { /^$ifname-tx-/ } @irqnames;
die "$ifname: rx queues $nrx != tx queues $ntx"
@@ -290,21 +291,23 @@ sub affinity_auto {
[ '%s-rx-%d', '%s-tx-%d' ] );
}
- # There seems to be no absolute convention for multiqueue irq naming
- # Known values:
- # intel: eth0-TxRx-1
- # vmxnet3: eth0-rxtx-1
- # bnx2x: eth0-fp-1
- # other: eth0-1
- my @seperator = qw/- -TxRx- -rxtx- -fp-/;
- foreach my $sep (@seperator) {
- my $regex = '/^' . $ifname . $sep . '\d$/';
- my $nq = grep { $regex } @irqnames;
+ # Match eth0-N form
+ my $nq = grep { /^$ifname-\d+$/ } @irqnames;
+ if ( $nq > 0 ) {
+ return assign_multiqueue( $ifname, $nq, $irqmap, [ '%s-%d' ] );
+ }
+
+ # Match eth-sometext-N
+ if ($irqnames[0] =~ /^$ifname(.*-)\d+$/) {
+ my $sep = $1;
+ my $regex = '^' . $ifname . $sep . '\d+$';
+ $nq = grep { $regex } @irqnames;
if ( $nq > 0 ) {
- return assign_multiqueue( $ifname, $nq, $irqmap,
- [ "%s$sep%d" ]);
+ return assign_multiqueue( $ifname, $nq, $irqmap,
+ [ "%s$sep%d" ] );
}
}
+
syslog(LOG_ERR, "%s: Unknown multiqueue irq naming: %s\n", $ifname,
join(' ', @irqnames));
}