This is a fix for an issue we hit on specific NIC tracked in
https://bugzilla.redhat.com/show_bug.cgi?id=1484059
In this case the mlx4_core driver lists all available MSI interrupts
under /sys/class/$dev/device/msi_irqs, this covers interrupts for both
mlx4_en (network part) and mlx4_ib (storage part) even if any of these is
not loaded yet. The IRQs are propagated to /proc/irq/ directory once
they're loaded.
To fix this the availability of the interrupt id is first checked in
/proc/irq/ directory and modified only if present.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/IRQ.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lnst/RecipeCommon/IRQ.py b/lnst/RecipeCommon/IRQ.py
index 88d673b..6b3a2e0 100644
--- a/lnst/RecipeCommon/IRQ.py
+++ b/lnst/RecipeCommon/IRQ.py
@@ -38,4 +38,13 @@ def pin_dev_irqs(machine, device, cpu):
int(intr)
except:
continue
- machine.config("/proc/irq/%s/smp_affinity_list" % intr.strip(), cpu)
+
+ # some drivers list all _available_ MSI interrupts under msi_irqs
+ # even for driver parts that are not loaded (in case of converged
+ # network adapters) and these interrupts are not visible under
+ # /proc/irq and make LNST report failure so we need to check if the
+ # interrupt is available first
+ list_intr = machine.run("ls -d /proc/irq/%s 2>/dev/null || true" %
intr.strip())
+ res = list_intr.get_result()
+ if res["res_data"]["stdout"]:
+ machine.config("/proc/irq/%s/smp_affinity_list" % intr.strip(),
cpu)
--
2.14.4