]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
automation: improve checking for MSI/MSI-X in PCI passthrough tests
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Fri, 6 Oct 2023 02:05:18 +0000 (04:05 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Oct 2023 20:52:52 +0000 (21:52 +0100)
Checking /proc/interrupts is unreliable because different drivers set
different names there. Install pciutils and use lspci instead.
In fact, the /proc/interrupts content was confusing enough that
adl-pci-hvm had it wrong (MSI-X is in use there). Fix this too.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
automation/gitlab-ci/test.yaml
automation/scripts/qubes-x86-64.sh
automation/tests-artifacts/alpine/3.18.dockerfile

index 4b836bf04784ad8f276d91dd4436b9d30b618c5d..61e642cce0cc8795275f42f3a7a8053e53abc341 100644 (file)
@@ -195,8 +195,6 @@ adl-pci-pv-x86-64-gcc-debug:
 
 adl-pci-hvm-x86-64-gcc-debug:
   extends: .adl-x86-64
-  variables:
-    PCIDEV_INTR: "MSI"
   script:
     - ./automation/scripts/qubes-x86-64.sh pci-hvm 2>&1 | tee ${LOGFILE}
   needs:
index cfe9247a26426400f44e3376e1bcd2229f82eea0..4aeb3fc50e24df595511235060970d3a9b7f43ed 100755 (executable)
@@ -92,23 +92,18 @@ on_reboot = "destroy"
 
     domU_check="
 set -x -e
-ip link set eth0 up
-timeout 30s udhcpc -i eth0
+interface=eth0
+ip link set \"\$interface\" up
+timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
 ping -c 10 \"\$pingip\"
 echo domU started
-cat /proc/interrupts
+pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
+lspci -vs \$pcidevice
 "
-    if [ "$PCIDEV_INTR" = "MSI-X" ]; then
+    if [ -n "$PCIDEV_INTR" ]; then
         domU_check="$domU_check
-grep -- '\\(-msi-x\\|PCI-MSI-X\\).*eth0' /proc/interrupts
-"
-    elif [ "$PCIDEV_INTR" = "MSI" ]; then
-        # depending on the kernel version and domain type, the MSI can be
-        # marked as '-msi', 'PCI-MSI', or 'PCI-MSI-<SBDF>'; be careful to not match
-        # -msi-x nor PCI-MSI-X
-        domU_check="$domU_check
-grep -- '\\(-msi \\|PCI-MSI\\( \\|-[^X]\\)\\).*eth0' /proc/interrupts
+lspci -vs \$pcidevice | fgrep '$PCIDEV_INTR: Enable+'
 "
     fi
     domU_check="$domU_check
index 333951d05e841fcc73b9f50f826ae870f4b444c8..5f521572b8fbafe076fe266ebbbf8176bdc2d374 100644 (file)
@@ -33,6 +33,7 @@ RUN \
   apk add pixman && \
   apk add curl && \
   apk add udev && \
+  apk add pciutils && \
   \
   # Xen
   cd / && \