public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] xe_exec_balancer: Report skip when test is unable to run
@ 2026-02-24 21:16 Matt Roper
  2026-02-25  1:00 ` ✗ Xe.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Matt Roper @ 2026-02-24 21:16 UTC (permalink / raw)
  To: igt-dev; +Cc: matthew.d.roper

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-25 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 21:16 [PATCH i-g-t] xe_exec_balancer: Report skip when test is unable to run Matt Roper
2026-02-25  1:00 ` ✗ Xe.CI.BAT: failure for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox