[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] automation: xilinx: Add GEM passthrough test


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 27 Apr 2023 14:05:53 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zv9ymspoEyaD/gOFLfw2UKsgnsHva99GtVEfBw58y0Q=; b=UxcIYBM1hKQuE5u9iD4T4zDtaDGjVCiAr0UM0+B3OPwpth0bVA6e0OroQIReTYoPMzw4OGeBdMEzOg7OqIRu7ArOPMTXolEoR1HP3v475/yQ24bjQBBbgvjJvNkDb3K3ld6I2yu/gaK35cctpB6D0bPzDYDmLB3UtMvDUXhE5guRtOvBRE/n0LtBzfFbCcihtEj3tTQ7WbO9XYwv+sOJ7vtrcs5w2NXct0CsL+2b0c0psitGiGdZvWiE/PwNts5FUo6UESkXOqEPrmE0Ysqq+KQO/tnWCk6ph8BH7gfz4o4OFuP+0BaMVCg2PyiJ/A/hRGYHnxldK2XpbuIq+xqdWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTpC3oWXlPXFsYSFr7V9QcFH2uDaTRRKlA/m2cHl08B3p3m1Aoa3BenqjEf4BuKrtnN5n3J8zCjyQSOcyYgTUUHFzhjBSgC85SFITKHdpnnUrH7iEPE+22DxvBV7zOT/VTXhvIul3h1o8Jy8kokc5lSdXT/F5mSaidl0L2xVQ8Ovr3/BcbrhbG9MinRcYj1eNMmzBew/pCJqphQMXYUoX5+TTaumWxgPsQmthQhqfhtgQueQQijHF9RAu9jl85v1FJ6doL1W1zECM5TpaoiWrrWTDLCpyTVj4xC0Yo/XIQy7pfPIuhMMGMuqeQrMMEjXaFhFJGgxA2+xsiGq9vMtHA==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 27 Apr 2023 12:06:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Being able to access a real board with real resources gives a great
opportunity to finally test passthroughing devices to guests. Therefore,
create a new Xilinx job to test GEM (Gigabit Ethernet MAC) controller
passthrough to a dom0less domU.

By passing "gem-passthrough" as a test variant, the test will instruct
the ImageBuilder to use "eth0.dtb" (passthrough dtb stored under tftp
server root) as a guest dtb and to add "xen,passthrough" dtb property to
"/amba/ethernet@ff0e0000" node. The guest itself will try to bringup
the network interface, obtain dynamically IP address and ping the default
gateway.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Example job:
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/4189922473
---
 automation/gitlab-ci/test.yaml                |  8 ++++++
 .../scripts/xilinx-smoke-dom0less-arm64.sh    | 25 +++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index d68c584269dd..3409d704a7eb 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -131,6 +131,14 @@ xilinx-smoke-dom0less-arm64-gcc:
     - *arm64-test-needs
     - alpine-3.12-gcc-arm64
 
+xilinx-smoke-dom0less-arm64-gcc-gem-passthrough:
+  extends: .xilinx-arm64
+  script:
+    - ./automation/scripts/xilinx-smoke-dom0less-arm64.sh gem-passthrough 2>&1 
| tee ${LOGFILE}
+  needs:
+    - *arm64-test-needs
+    - alpine-3.12-gcc-arm64
+
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
   script:
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh 
b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 73ba251f4cc1..075305241c8d 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -22,6 +22,22 @@ echo \"${passed}\"
 "
 fi
 
+if [[ "${test_variant}" == "gem-passthrough" ]]; then
+    passed="${test_variant} test passed"
+
+    # For a passthroughed GEM:
+    # - bring up the network interface
+    # - dynamically assign IP
+    # - ping the default gateway
+    domU_check="
+set -ex
+ifconfig eth0 up
+udhcpc -i eth0 -n
+ping -c 10 \$(ip route | awk '/^default/ {print \$3}')
+echo \"${passed}\"
+"
+fi
+
 # DomU
 mkdir -p rootfs
 cd rootfs
@@ -96,6 +112,15 @@ cp -f binaries/domU-rootfs.cpio.gz $TFTP/
 # export dtb to artifacts
 cp $TFTP/mpsoc_smmu.dtb .
 
+if [[ "${test_variant}" == "gem-passthrough" ]]; then
+    echo "
+    DOMU_PASSTHROUGH_DTB[0]=\"eth0.dtb\"
+    DOMU_PASSTHROUGH_PATHS[0]=\"/amba/ethernet@ff0e0000\"" >> $TFTP/config
+
+    # export passthrough dtb to artifacts
+    cp $TFTP/eth0.dtb .
+fi
+
 rm -rf imagebuilder
 git clone https://gitlab.com/ViryaOS/imagebuilder
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d $TFTP/ -c $TFTP/config
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.