diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2019-12-31 09:47:04 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2019-12-31 09:47:04 +0000 |
commit | 4447ae1d002b3369f6e7932f1c4fcfaaf755f6d9 (patch) | |
tree | b0458b5ae8a3b8d4013844a603a5ee6ac94212fc /scripts/system | |
parent | 1ebbf25320e821435002fae6981a9041eefd13fe (diff) | |
download | vyatta-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-x | scripts/system/irq-affinity.pl | 11 |
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); |