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.
v2: I moved the /proc/irq listing out of the loop so that the command is run just once and reused when checking the presence of specific IRQ number
Signed-off-by: Jan Tluka jtluka@redhat.com --- lnst/RecipeCommon/IRQ.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/lnst/RecipeCommon/IRQ.py b/lnst/RecipeCommon/IRQ.py index 88d673b..f61f23c 100644 --- a/lnst/RecipeCommon/IRQ.py +++ b/lnst/RecipeCommon/IRQ.py @@ -11,6 +11,7 @@ __author__ = """ jtluka@redhat.com (Jan Tluka) """
+import re
''' Pins all device IRQs to specified cpu on machine. @@ -33,9 +34,22 @@ def pin_dev_irqs(machine, device, cpu): res = pi.get_result() intrs = res["res_data"]["stdout"]
+ # save all /proc/irq/ entries + cmd = machine.run("ls -1 /proc/irq/ 2>/dev/null || true") + res = cmd.get_result() + proc_irq = res["res_data"]["stdout"] + for intr in intrs.split('\n'): try: 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 + + if re.search("^%s$" % intr.strip(), proc_irq, re.MULTILINE) is not None: + machine.config("/proc/irq/%s/smp_affinity_list" % intr.strip(), cpu)
Mon, Oct 08, 2018 at 02:34:31PM CEST, jtluka@redhat.com wrote:
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.
v2: I moved the /proc/irq listing out of the loop so that the command is run just once and reused when checking the presence of specific IRQ number
Signed-off-by: Jan Tluka jtluka@redhat.com
I pushed this one.
-Jan
lnst-developers@lists.fedorahosted.org