All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/xe_pmu: Do not enable VFs in unrelated subtests
@ 2026-10-05 22:40 Gustavo Sousa
  2026-10-05 23:28 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Gustavo Sousa @ 2026-10-05 22:40 UTC (permalink / raw)
  To: igt-dev; +Cc: Gustavo Sousa

The test xe_pmu has a subtest group that enables SRIOV VFs as part of
its fixture.  Even though the fixture is part of a subtest group, the
enabling/disabling will happen regardless of whether those subests are
selected or not (via --run-subtest).

As most subtests in xe_pmu don't need that, avoid doing that as a
fixture and rather incorporate the enabling/disabling as part of a new
macro called test_each_engine_with_vfs().

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 tests/intel/xe_pmu.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
index d41ebba1faef..79d466093d1d 100644
--- a/tests/intel/xe_pmu.c
+++ b/tests/intel/xe_pmu.c
@@ -124,6 +124,15 @@ static bool has_engine_active_ticks;
 			igt_dynamic_f("engine-%s%d", xe_engine_class_string(hwe->engine_class), \
 				      hwe->engine_instance)
 
+#define test_each_engine_with_vfs(test, fd, hwe, num_vfs) \
+	igt_subtest_with_dynamic(test) \
+		xe_for_each_engine(fd, hwe) \
+			for (num_fns = enable_and_provision_vfs(fd) + 1; \
+			     num_fns; \
+			     unprovision_and_disable_vfs(fd), num_fns = 0) \
+				igt_dynamic_f("engine-%s%d", xe_engine_class_string(hwe->engine_class), \
+					      hwe->engine_instance)
+
 static bool has_event(const char *device, const char *event)
 {
 	char buf[512];
@@ -1192,26 +1201,20 @@ int igt_main()
 	igt_subtest_group() {
 		unsigned int num_fns;
 
-		igt_fixture()
-			num_fns = enable_and_provision_vfs(fd) + 1;
-
 		igt_describe("Validate engine activity on all functions");
-		test_each_engine("all-fn-engine-activity-load", fd, eci)
+		test_each_engine_with_vfs("all-fn-engine-activity-load", fd, eci, num_fns)
 			engine_activity_all_fn(fd, eci, num_fns);
 
 		igt_describe("Validate per-function engine activity");
-		test_each_engine("fn-engine-activity-load", fd, eci)
+		test_each_engine_with_vfs("fn-engine-activity-load", fd, eci, num_fns)
 			for (int fn = 0; fn < num_fns; fn++)
 				engine_activity_fn(fd, eci, fn, XE_SRIOV_SCHED_PRIORITY_LOW);
 
 		igt_describe("Validate per-function engine activity when sched-if-idle is set");
-		test_each_engine("fn-engine-activity-sched-if-idle", fd, eci) {
+		test_each_engine_with_vfs("fn-engine-activity-sched-if-idle", fd, eci, num_fns) {
 			for (int fn = 0; fn < num_fns; fn++)
 				engine_activity_fn(fd, eci, fn, XE_SRIOV_SCHED_PRIORITY_NORMAL);
 		}
-
-		igt_fixture()
-			unprovision_and_disable_vfs(fd);
 	}
 
 	igt_subtest_group() {

---
base-commit: faad2cd0e3e8eb2e18111c2358823a7bdfb56d94
change-id: 20261005-xe_pmu-do-not-enable-vfs-in-unrelated-subtests-e24c1cd95d71

Best regards,
--  
Gustavo Sousa <gustavo.sousa@intel.com>


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

end of thread, other threads:[~2026-10-06 11:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 22:40 [PATCH i-g-t] tests/xe_pmu: Do not enable VFs in unrelated subtests Gustavo Sousa
2026-10-05 23:28 ` ✓ i915.CI.BAT: success for " Patchwork
2026-10-05 23:29 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-06  5:51 ` ✗ i915.CI.Full: failure " Patchwork
2026-10-06  8:46   ` Kamil Konieczny
2026-10-06  8:02 ` ✗ Xe.CI.FULL: " Patchwork
2026-10-06  8:47   ` Kamil Konieczny
2026-10-06  8:45 ` [PATCH i-g-t] " Kamil Konieczny
2026-10-06  8:55 ` Kamil Konieczny
2026-10-06 11:58   ` Gustavo Sousa
2026-10-06 10:29 ` Bernatowicz, Marcin
2026-10-06 11:51   ` Gustavo Sousa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.