[igt-dev] [PATCH i-g-t] tests/intel: Do not error on -ECANCELED in xe_vm tests
Jonathan Cavitt
jonathan.cavitt at intel.com
Thu Nov 16 23:43:12 UTC 2023
In the hammer class of unbind tests in xe_vm, a thread is created that
submits jobs to an exec queue initialized on a VM page that is later
unbound. Because of the unbind, a job is timing out and marking the
exec queue as "banned", which causes all subsequent job submissions to
report as -ECANCELED (-125).
This is expected behavior. The test should not fail when this is the
case, so use __xe_exec instead of the error-sensitive xe_exec in
hammer_thread, ignoring -ECANCELED and catching all other errors
manually.
Suggested-by: Matthew Brost <matthew.brost at intel.com>
Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
---
tests/intel/xe_vm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index f1ccd6c21d..d16bb45892 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -1118,6 +1118,7 @@ static void *hammer_thread(void *tdata)
uint32_t exec_queue = xe_exec_queue_create(t->fd, t->vm, t->eci, 0);
int b;
int i = 0;
+ int err = 0;
sync[0].handle = syncobj_create(t->fd, 0);
pthread_barrier_wait(t->barrier);
@@ -1140,14 +1141,15 @@ static void *hammer_thread(void *tdata)
exec.address = batch_addr;
if (i % 32) {
exec.num_syncs = 0;
- xe_exec(t->fd, &exec);
+ err = __xe_exec(t->fd, &exec);
} else {
exec.num_syncs = 1;
- xe_exec(t->fd, &exec);
+ err = __xe_exec(t->fd, &exec);
igt_assert(syncobj_wait(t->fd, &sync[0].handle, 1,
INT64_MAX, 0, NULL));
syncobj_reset(t->fd, &sync[0].handle, 1);
}
+ igt_assert(!err || err == -ECANCELED);
++i;
}
--
2.25.1
More information about the igt-dev
mailing list