public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: matthew.d.roper@intel.com
Subject: [PATCH i-g-t] xe_exec_balancer: Report skip when test is unable to run
Date: Tue, 24 Feb 2026 13:16:13 -0800	[thread overview]
Message-ID: <20260224211612.2944788-2-matthew.d.roper@intel.com> (raw)

The xe_exec_balancer tests require two engines of the same class to be
able to execute.  Many Intel platforms today do not have two engines of
any class so the test bails out and does not do anything, however it
returns a 'pass' result in this case which is misleading since the test
was unable to exercise the relevant kernel/hardware functionality.
Adjust the subtests to track whether they found engines capable of
performing the testing; if not, return a 'skip' result that more
accurately reflects that nothing was tested.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 tests/intel/xe_exec_balancer.c | 178 +++++++++++++++++++++++----------
 1 file changed, 124 insertions(+), 54 deletions(-)

diff --git a/tests/intel/xe_exec_balancer.c b/tests/intel/xe_exec_balancer.c
index 98e09961e..9cd641b4e 100644
--- a/tests/intel/xe_exec_balancer.c
+++ b/tests/intel/xe_exec_balancer.c
@@ -32,7 +32,7 @@
  *	of a class simultaneously
  * Test category: functionality test
  */
-static void test_all_active(int fd, int gt, int class)
+static bool test_all_active(int fd, int gt, int class)
 {
 	uint32_t vm;
 	uint64_t addr = 0x1a0000;
@@ -58,7 +58,7 @@ static void test_all_active(int fd, int gt, int class)
 
 	num_placements = xe_gt_fill_engines_by_class(fd, gt, class, eci);
 	if (num_placements < 2)
-		return;
+		return false;
 
 	vm = xe_vm_create(fd, 0, 0);
 	bo_size = sizeof(*data) * num_placements;
@@ -110,6 +110,8 @@ static void test_all_active(int fd, int gt, int class)
 	munmap(data, bo_size);
 	gem_close(fd, bo);
 	xe_vm_destroy(fd, vm);
+
+	return true;
 }
 
 #define MAX_N_EXEC_QUEUES	16
@@ -156,7 +158,7 @@ static void test_all_active(int fd, int gt, int class)
  * @parallel-userptr-invalidate:	parallel userptr invalidate
  * @parallel-userptr-invalidate-race:	parallel userptr invalidate racy
  */
-static void
+static bool
 test_exec(int fd, int gt, int class, int n_exec_queues, int n_execs,
 	  unsigned int flags)
 {
@@ -186,7 +188,7 @@ test_exec(int fd, int gt, int class, int n_exec_queues, int n_execs,
 
 	num_placements = xe_gt_fill_engines_by_class(fd, gt, class, eci);
 	if (num_placements < 2)
-		return;
+		return false;
 
 	vm = xe_vm_create(fd, 0, 0);
 	bo_size = sizeof(*data) * n_execs;
@@ -326,6 +328,8 @@ test_exec(int fd, int gt, int class, int n_exec_queues, int n_execs,
 		free(data);
 	}
 	xe_vm_destroy(fd, vm);
+
+	return true;
 }
 
 /**
@@ -365,7 +369,7 @@ test_exec(int fd, int gt, int class, int n_exec_queues, int n_execs,
  * @parallel-userptr-invalidate-race:	parallel userptr invalidate racy
  */
 
-static void
+static bool
 test_cm(int fd, int gt, int class, int n_exec_queues, int n_execs,
 	unsigned int flags)
 {
@@ -399,7 +403,7 @@ test_cm(int fd, int gt, int class, int n_exec_queues, int n_execs,
 
 	num_placements = xe_gt_fill_engines_by_class(fd, gt, class, eci);
 	if (num_placements < 2)
-		return;
+		return false;
 
 	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
 	bo_size = sizeof(*data) * n_execs;
@@ -557,6 +561,8 @@ test_cm(int fd, int gt, int class, int n_exec_queues, int n_execs,
 		free(data);
 	}
 	xe_vm_destroy(fd, vm);
+
+	return true;
 }
 
 
@@ -591,76 +597,140 @@ int igt_main()
 	igt_fixture()
 		fd = drm_open_driver(DRIVER_XE);
 
-	igt_subtest("virtual-all-active")
-		xe_for_each_gt(fd, gt)
+	igt_subtest("virtual-all-active") {
+		bool has_necessary_engines = false;
+
+		xe_for_each_gt(fd, gt) {
 			xe_for_each_engine_class(class)
-				test_all_active(fd, gt, class);
+				has_necessary_engines |=
+					test_all_active(fd, gt, class);
+		}
+		igt_require(has_necessary_engines);
+	}
 
 	for (const struct section *s = sections; s->name; s++) {
-		igt_subtest_f("once-%s", s->name)
-			xe_for_each_gt(fd, gt)
+		igt_subtest_f("once-%s", s->name) {
+			bool has_necessary_engines = false;
+
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_exec(fd, gt, class, 1, 1,
-						  s->flags);
+					has_necessary_engines |=
+						test_exec(fd, gt, class, 1, 1, s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("twice-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("twice-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_exec(fd, gt, class, 1, 2,
-						  s->flags);
+					has_necessary_engines |=
+						test_exec(fd, gt, class, 1, 2, s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("many-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("many-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_exec(fd, gt, class, 1,
-						  s->flags & (REBIND | INVALIDATE) ?
-						  64 : 1024,
-						  s->flags);
+					has_necessary_engines |=
+						test_exec(fd, gt, class, 1,
+							  s->flags & (REBIND | INVALIDATE) ?
+							  64 : 1024,
+							  s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
 
-		igt_subtest_f("many-execqueues-%s", s->name)
-			xe_for_each_gt(fd, gt)
+		igt_subtest_f("many-execqueues-%s", s->name) {
+			bool has_necessary_engines = false;
+
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_exec(fd, gt, class, 16,
-						  s->flags & (REBIND | INVALIDATE) ?
-						  64 : 1024,
-						  s->flags);
+					has_necessary_engines |=
+						test_exec(fd, gt, class, 16,
+							  s->flags & (REBIND | INVALIDATE) ?
+							  64 : 1024,
+							  s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("no-exec-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("no-exec-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_exec(fd, gt, class, 1, 0,
-						  s->flags);
+					has_necessary_engines |=
+						test_exec(fd, gt, class, 1, 0,
+							  s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
 
-		igt_subtest_f("once-cm-%s", s->name)
-			xe_for_each_gt(fd, gt)
+		igt_subtest_f("once-cm-%s", s->name) {
+			bool has_necessary_engines = false;
+
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_cm(fd, gt, class, 1, 1, s->flags);
+					has_necessary_engines |=
+						test_cm(fd, gt, class, 1, 1, s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("twice-cm-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("twice-cm-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_cm(fd, gt, class, 1, 2, s->flags);
+					has_necessary_engines |=
+						test_cm(fd, gt, class, 1, 2, s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("many-cm-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("many-cm-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_cm(fd, gt, class, 1,
-						s->flags & (REBIND | INVALIDATE) ?
-						64 : 1024,
-						s->flags);
+					has_necessary_engines |=
+						test_cm(fd, gt, class, 1,
+							s->flags & (REBIND | INVALIDATE) ?
+							64 : 1024,
+							s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
 
-		igt_subtest_f("many-execqueues-cm-%s", s->name)
-			xe_for_each_gt(fd, gt)
+		igt_subtest_f("many-execqueues-cm-%s", s->name) {
+			bool has_necessary_engines = false;
+
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_cm(fd, gt, class, 16,
-						s->flags & (REBIND | INVALIDATE) ?
-						64 : 1024,
-						s->flags);
+					has_necessary_engines |=
+						test_cm(fd, gt, class, 16,
+							s->flags & (REBIND | INVALIDATE) ?
+							64 : 1024,
+							s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
+
+		igt_subtest_f("no-exec-cm-%s", s->name) {
+			bool has_necessary_engines = false;
 
-		igt_subtest_f("no-exec-cm-%s", s->name)
-			xe_for_each_gt(fd, gt)
+			xe_for_each_gt(fd, gt) {
 				xe_for_each_engine_class(class)
-					test_cm(fd, gt, class, 1, 0, s->flags);
+					has_necessary_engines |=
+						test_cm(fd, gt, class, 1, 0, s->flags);
+			}
+			igt_require(has_necessary_engines);
+		}
 	}
 
 	igt_fixture()
-- 
2.53.0


             reply	other threads:[~2026-02-24 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24 21:16 Matt Roper [this message]
2026-02-25  1:00 ` ✗ Xe.CI.BAT: failure for xe_exec_balancer: Report skip when test is unable to run Patchwork
2026-02-25 17:47   ` Matt Roper
2026-02-25  1:30 ` ✗ i915.CI.BAT: " Patchwork
2026-02-25 17:57   ` Matt Roper
2026-02-25  8:53 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-25 18:00   ` Matt Roper
2026-02-25 11:48 ` [PATCH i-g-t] " Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260224211612.2944788-2-matthew.d.roper@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox