From patchwork Fri Oct 6 02:05:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13410925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24E0EE92FD8 for ; Fri, 6 Oct 2023 02:06:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.613210.953621 (Exim 4.92) (envelope-from ) id 1qoaDp-0007TL-VF; Fri, 06 Oct 2023 02:05:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 613210.953621; Fri, 06 Oct 2023 02:05:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qoaDp-0007RP-Nr; Fri, 06 Oct 2023 02:05:45 +0000 Received: by outflank-mailman (input) for mailman id 613210; Fri, 06 Oct 2023 02:05:44 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qoaDn-0006iR-Tp for xen-devel@lists.xenproject.org; Fri, 06 Oct 2023 02:05:43 +0000 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d9464c7e-63ec-11ee-98d3-6d05b1d4d9a1; Fri, 06 Oct 2023 04:05:41 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3D8F25C0308; Thu, 5 Oct 2023 22:05:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 05 Oct 2023 22:05:40 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Oct 2023 22:05:38 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d9464c7e-63ec-11ee-98d3-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1696557940; x=1696644340; bh=/g Ul0Y4cOMR9LD5olCpH8YTdnvy+vSoAh/p2y/HuRgc=; b=Ut4sTEgCJe/T5EI9YH 8vXs7bXEl7oicPQXlw+Yzif3J6/O/j6JhQoF3fRa2+WkL/ESjjYgATQfhHh4FWcb uIJSm0AQ17DJu/JZyDOSE3yMxYJz+o2jWBUhnCyfYspk0U7v2tc5zCIbS1qeeEEn X7t+iH4u1o/AQdUKMXqlEe0UyYnPMrFDKHpLrufBLgIh8Y3owfwRqGi1wJfs9iMZ clhPt6FmEdzJWstRtm4uKnD9bvLy+oMM9AaM57fLqRZSZS0aHx1CgBfo7nt2eMee qwsPz09YYKJS84VnG/fcIBn0fc9ta3dLhQPzTr0LrcIeABaW50KHpNuUMdAyOa3o LRlw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696557940; x=1696644340; bh=/gUl0Y4cOMR9LD5olCpH8YTdnvy+vSoAh/p 2y/HuRgc=; b=IzE/swSNreJkRnOHr//0+PEw71dhsW+yv/DA35+YM+fBzPgfazl Ddx79/cS7q6DBiJiUEDbIT8qYVhtu1E3zpffben/e22C5lxiWMPMfnCB48K4uBld Iqy3u6Dk0dvQlX1GnLWqwdNT00m2XZurdbJhyXCB0cHfyZGkt8kTdZBRZ5cXP9Hf qX3lL/UOd9R7ZbeImvsx9uQ2kpF1xTtytPp1c624AitQ+qWCh2kt65hyeNAESDGc lbEEHasuXNB8O4iiRXQNH+iU0gKidgWWwVg8BSsfitVEgZbneXeY4PxVuWyHDvY6 BRIIyH/bFK3qY5uPO+f81yCnVfD5Fkj5mxQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrgeehgdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepofgrrhgv khcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomhgrrhhmrghrvghksehinh hvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggftrfgrthhtvghrnhepgfeu udehgfdvfeehhedujeehfeduveeugefhkefhheelgeevudetueeiudfggfffnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghk sehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: Henry Wang , =?utf-8?q?Marek_Marczykowski-G=C3=B3rec?= =?utf-8?q?ki?= , Doug Goldstein , Stefano Stabellini Subject: [PATCH 4/5] automation: improve checking for MSI/MSI-X in PCI passthrough tests Date: Fri, 6 Oct 2023 04:05:18 +0200 Message-ID: <18b10f667f2df986691ed299f7640724618ec95a.1696557834.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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 --- automation/gitlab-ci/test.yaml | 2 +-- automation/scripts/qubes-x86-64.sh | 19 +++++----------- automation/tests-artifacts/alpine/3.18.dockerfile | 1 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 4b836bf04784..61e642cce0cc 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -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: diff --git a/automation/scripts/qubes-x86-64.sh b/automation/scripts/qubes-x86-64.sh index 5464d10fc343..842e6fae7204 100755 --- a/automation/scripts/qubes-x86-64.sh +++ b/automation/scripts/qubes-x86-64.sh @@ -90,23 +90,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-'; 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 diff --git a/automation/tests-artifacts/alpine/3.18.dockerfile b/automation/tests-artifacts/alpine/3.18.dockerfile index 333951d05e84..5f521572b8fb 100644 --- a/automation/tests-artifacts/alpine/3.18.dockerfile +++ b/automation/tests-artifacts/alpine/3.18.dockerfile @@ -33,6 +33,7 @@ RUN \ apk add pixman && \ apk add curl && \ apk add udev && \ + apk add pciutils && \ \ # Xen cd / && \