[PATCH v2 5/9] tests/intel/xe_exec_reset: add gt-stress-reset-rapid-cycle subtest

[email protected]
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
From: Nishit Sharma <[email protected]>

This extends concurrent reset and submission stress coverage to a
high-frequency reset scenario while keeping the existing stress harness
unchanged for other subtests.

Signed-off-by: Nishit Sharma <[email protected]>
---
 tests/intel/xe_exec_reset.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index 2a822b29b..a9c3b593d 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c
@@ -136,6 +136,7 @@ static void test_spin(int fd, struct drm_xe_engine_class_instance *eci,
 #define RESET_SYNC_MODE			(0x1 << 16)
 #define MEM_PRESSURE_STRESS		(0x1 << 17)
 #define INVALIDATE_BO_STRESS		(0x1 << 18)
+#define RAPID_RESET_STRESS		(0x1 << 19)
 
 /**
  * SUBTEST: %s-cat-error
@@ -717,8 +718,10 @@ static void pressure_bo_destroy(int fd, uint32_t *bos, int count)
 
 static void do_resets(struct gt_thread_data *t)
 {
+	int interval_us = (t->flags & RAPID_RESET_STRESS) ? 1000 : 250000;
+
 	while (!*(t->exit)) {
-		usleep(250000);	/* 250 ms */
+		usleep(interval_us);
 		(*t->num_reset)++;
 		if (t->flags & RESET_SYNC_MODE)
 			xe_force_gt_reset_sync(t->fd, t->gt);
@@ -840,6 +843,10 @@ static void *gt_reset_thread(void *data)
  * Description: Stress concurrent GT resets and job submissions while invalidating BO CPU mappings
  * Test category: stress test
  *
+ * SUBTEST: gt-stress-reset-rapid-cycle
+ * Description: Stress concurrent GT resets and job submissions with rapid-cycle resets
+ * Test category: stress test
+ *
  */
 static void
 gt_reset(int fd, int gt, int n_threads, int n_sec, unsigned int flags)
@@ -1061,6 +1068,7 @@ int igt_main()
 		{ "reset-concurrent-submit-sync", RESET_SYNC_MODE },
 		{ "reset-memory-pressure", MEM_PRESSURE_STRESS },
 		{ "reset-bo-invalidation", INVALIDATE_BO_STRESS },
+		{ "reset-rapid-cycle", RAPID_RESET_STRESS },
 		{ NULL },
 	};
 	int gt;
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.