From 6938b8bce001cca2d98d6b277d134c9e8e405271 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 28 Feb 2011 17:55:59 -0800 Subject: Warn if attempting to force mask on multiqueue NIC Bug 6845 Warn (and ignore) attempt to assign IRQ directly on multiqueuej NIC. --- scripts/system/irq-affinity.pl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl index 23da4635..b15c1168 100755 --- a/scripts/system/irq-affinity.pl +++ b/scripts/system/irq-affinity.pl @@ -267,12 +267,21 @@ sub affinity_mask { return unless is_up($ifname); - my $irq = get_irq($ifname); - die "$ifname: attempt to assign affinity to device without irq\n" - unless (defined($irq)); + my $nirq = grep { /$ifname/ } keys %{irqinfo()}; + if ( $nirq > 1 ) { + syslog( LOG_NOTICE, "%s: device is multiqueue, ignoring affinity mask", + $ifname); + warn "$ifname: interface has multiple irq, ignoring affinity mask\n"; + } else { + my $irq = get_irq($ifname); + die "$ifname: attempt to assign affinity to device without irq\n" + unless (defined($irq)); + + syslog( LOG_INFO, "%s: assign irq %d mask %s", $ifname, $irq, $irqmsk); - set_affinity($ifname, $irq, hex($irqmsk)); - set_rps($ifname, 0, hex($rpsmsk)) if $rpsmsk; + set_affinity($ifname, $irq, hex($irqmsk)); + set_rps($ifname, 0, hex($rpsmsk)) if $rpsmsk; + } } # The auto strategy involves trying to achieve the following goals: -- cgit v1.2.3