summaryrefslogtreecommitdiff
path: root/scripts/system
diff options
context:
space:
mode:
authorDmitriyEshenko <dmitriy.eshenko@vyos.io>2019-12-31 09:47:04 +0000
committerDmitriyEshenko <dmitriy.eshenko@vyos.io>2019-12-31 09:47:04 +0000
commit4447ae1d002b3369f6e7932f1c4fcfaaf755f6d9 (patch)
treeb0458b5ae8a3b8d4013844a603a5ee6ac94212fc /scripts/system
parent1ebbf25320e821435002fae6981a9041eefd13fe (diff)
downloadvyatta-cfg-system-4447ae1d002b3369f6e7932f1c4fcfaaf755f6d9.tar.gz
vyatta-cfg-system-4447ae1d002b3369f6e7932f1c4fcfaaf755f6d9.zip
smp-affinity: T1924: Add support for XEN interfaces
Diffstat (limited to 'scripts/system')
-rwxr-xr-xscripts/system/irq-affinity.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/system/irq-affinity.pl b/scripts/system/irq-affinity.pl
index de0c3099..20181578 100755
--- a/scripts/system/irq-affinity.pl
+++ b/scripts/system/irq-affinity.pl
@@ -30,6 +30,17 @@ my ($ifname, $mask, $debug) = @ARGV;
die "Error: Interface $ifname does not exist\n"
unless -d "/sys/class/net/$ifname";
+# Detect xen and use special (vifX-) interface irq
+if ( -d "/proc/xen" ){
+ open( my $f, '<', "/sys/class/net/$ifname/device/nodename" )
+ or die "Can't read /sys/class/net/$ifname/device/nodename ";
+ my $xen_ifname = <$f>;
+ $xen_ifname =~ s/device\/vif\///;
+ $ifname = "vif".$xen_ifname;
+ chomp($ifname);
+ close $f;
+}
+
my $logopt = defined($debug) ? "perror" : "";
openlog("irq-affinity", $logopt, LOG_LOCAL0);