From: Shekhar Chauhan <shekhar.chauhan@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: <harish.chegondi@intel.com>
Subject: Re: [PATCH v2 7/8] tests/intel/xe_oa: Add an exec queue variant to the unbind/rebind test
Date: Thu, 26 Nov 2026 12:41:24 +0530 [thread overview]
Message-ID: <c46e1253-b037-4353-98d0-89be36f04f5e@intel.com> (raw)
In-Reply-To: <20261104005505.3232485-17-umesh.nerlige.ramappa@intel.com>
On 11/4/2026 6:25, Umesh Nerlige Ramappa wrote:
> Open the stream on an exec queue with preemption disabled. Unbind then
> also restores the OA context state with an LRI batch on the exec queue
> and restores preemption and timeslicing.
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
LGTM,
Reviewed-by: Shekhar Chauhan <shekhar.chauhan@intel.com>
> ---
> tests/intel/xe_oa.c | 28 +++++++++++++++++++++++++---
> 1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/tests/intel/xe_oa.c b/tests/intel/xe_oa.c
> index f1fe5f44c408..ffc1971cb361 100644
> --- a/tests/intel/xe_oa.c
> +++ b/tests/intel/xe_oa.c
> @@ -2866,6 +2866,7 @@ static bool mem_is_zero(const void *vaddr, size_t len)
>
> #define UNBIND_CLOSE_BEFORE_REBIND (1 << 0)
> #define UNBIND_STREAM_DISABLED (1 << 1)
> +#define UNBIND_EXEC_QUEUE (1 << 2)
>
> #define UNBIND_MAX_STREAMS 16
>
> @@ -2898,7 +2899,8 @@ static bool unbind_waiters_started;
> static volatile bool unbind_waiters_stop;
>
> static void unbind_stream_open(struct unbind_stream *s, const struct drm_xe_oa_unit *oau,
> - unsigned int flags)
> + unsigned int flags, uint32_t exec_q,
> + const struct drm_xe_engine_class_instance *hwe)
> {
> struct intel_xe_perf_metric_set *test_set = oa_unit_metric_set(oau);
> uint64_t fmt = test_set->perf_oa_format;
> @@ -2923,6 +2925,14 @@ static void unbind_stream_open(struct unbind_stream *s, const struct drm_xe_oa_u
> s->properties[n++] = DRM_XE_OA_PROPERTY_OA_DISABLED;
> s->properties[n++] = true;
> }
> + if (exec_q) {
> + s->properties[n++] = DRM_XE_OA_PROPERTY_EXEC_QUEUE_ID;
> + s->properties[n++] = exec_q;
> + s->properties[n++] = DRM_XE_OA_PROPERTY_OA_ENGINE_INSTANCE;
> + s->properties[n++] = hwe->engine_instance;
> + s->properties[n++] = DRM_XE_OA_PROPERTY_NO_PREEMPT;
> + s->properties[n++] = true;
> + }
> igt_assert_lte(n, ARRAY_SIZE(s->properties));
>
> s->param.num_properties = n / 2;
> @@ -3140,14 +3150,22 @@ static void test_unbind_rebind(const struct drm_xe_oa_unit *oau0, unsigned int f
> {
> struct unbind_stream *streams = unbind_streams;
> struct unbind_stream *primary = &streams[0];
> + const struct drm_xe_engine_class_instance *hwe = NULL;
> bool disabled = flags & UNBIND_STREAM_DISABLED;
> + uint32_t vm, exec_q = 0;
> int ret, i;
>
> igt_device_get_pci_slot_name(drm_fd, unbind_pci_slot);
> igt_debug("Device %s\n", unbind_pci_slot);
>
> + if (flags & UNBIND_EXEC_QUEUE) {
> + hwe = oa_unit_engine(oau0);
> + vm = xe_vm_create(drm_fd, 0, 0);
> + exec_q = xe_exec_queue_create_deconst(drm_fd, vm, hwe, 0);
> + }
> +
> unbind_num_streams = 0;
> - unbind_stream_open(&streams[unbind_num_streams++], oau0, flags);
> + unbind_stream_open(&streams[unbind_num_streams++], oau0, flags, exec_q, hwe);
> igt_debug("Opened %d OA stream(s)\n", unbind_num_streams);
>
> /*
> @@ -3185,7 +3203,10 @@ static void test_unbind_rebind(const struct drm_xe_oa_unit *oau0, unsigned int f
> igt_reset_timeout();
> }
>
> - /* Drop all state of the removed device, the drm fd also refers to it */
> + /*
> + * Drop all state of the removed device, the drm fd also refers to it. The exec
> + * queue and vm can't be destroyed on a removed device, they go with the drm fd.
> + */
> oa_device_fini();
>
> igt_set_timeout(60, "xe bind timed out (wedged?)");
> @@ -5691,6 +5712,7 @@ int igt_main_args("b:td", long_options, help_str, opt_handler, NULL)
> { "close", UNBIND_CLOSE_BEFORE_REBIND },
> { "open", 0 },
> { "disabled", UNBIND_STREAM_DISABLED },
> + { "exec-queue", UNBIND_EXEC_QUEUE },
> };
>
> for (int i = 0; i < ARRAY_SIZE(unbind_variants); i++) {
--
Shekhar Chauhan
Linux Graphics Software Engineer
Linux Platform Enabling
Intel Corporation
next prev parent reply other threads:[~2026-11-26 7:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 0:55 [PATCH v2 0/8] Test unbinding PCI device while OA stream is open Umesh Nerlige Ramappa
2026-11-04 0:55 ` [PATCH v2 1/8] tests/intel/xe_oa: Move device setup and teardown into helpers Umesh Nerlige Ramappa
2026-11-04 0:55 ` [PATCH v2 2/8] tests/intel/xe_oa: Add unbind/rebind test with an open OA stream Umesh Nerlige Ramappa
2026-11-26 7:09 ` Shekhar Chauhan
2026-11-04 0:55 ` [PATCH v2 3/8] tests/intel/xe_oa: Check that a removed device can't open OA streams Umesh Nerlige Ramappa
2026-11-26 7:10 ` Shekhar Chauhan
2026-11-04 0:55 ` [PATCH v2 4/8] tests/intel/xe_oa: Check OA buffer mmaps across unbind Umesh Nerlige Ramappa
2026-11-26 7:10 ` Shekhar Chauhan
2026-11-04 0:55 ` [PATCH v2 5/8] tests/intel/xe_oa: Check vm_ops->access on " Umesh Nerlige Ramappa
2026-11-26 5:55 ` Shekhar Chauhan
2026-11-04 0:55 ` [PATCH v2 6/8] tests/intel/xe_oa: Check that blocked OA stream waiters are woken up on unbind Umesh Nerlige Ramappa
2026-11-26 6:42 ` Shekhar Chauhan
2026-11-04 0:55 ` [PATCH v2 7/8] tests/intel/xe_oa: Add an exec queue variant to the unbind/rebind test Umesh Nerlige Ramappa
2026-11-26 7:11 ` Shekhar Chauhan [this message]
2026-11-04 0:55 ` [PATCH v2 8/8] tests/intel/xe_oa: Add an all OA units " Umesh Nerlige Ramappa
2026-11-26 7:06 ` Shekhar Chauhan
2026-11-04 2:19 ` ✓ Xe.CI.BAT: success for Test unbinding PCI device while OA stream is open (rev2) Patchwork
2026-11-04 2:39 ` ✗ i915.CI.BAT: failure " Patchwork
2026-11-04 17:42 ` ✗ Xe.CI.FULL: " Patchwork
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=c46e1253-b037-4353-98d0-89be36f04f5e@intel.com \
--to=shekhar.chauhan@intel.com \
--cc=harish.chegondi@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@intel.com \
/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