From: "Manszewski, Christoph" <christoph.manszewski@intel.com>
To: "Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
igt-dev@lists.freedesktop.org
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
"Dominik Grzegorzek" <dominik.grzegorzek@intel.com>,
"Pawel Sikora" <pawel.sikora@intel.com>,
"Jonathan Cavitt" <jonathan.cavitt@intel.com>
Subject: Re: [PATCH v2 i-g-t 2/3] tests/intel/xe_eudebug: Add basic-vm-bind-ufence-reconnect test
Date: Wed, 11 Dec 2024 20:29:23 +0100 [thread overview]
Message-ID: <4b3050a4-f4d4-4236-8e43-13cce9c15dd1@intel.com> (raw)
In-Reply-To: <20241211135039.5853-3-dominik.karol.piatkowski@intel.com>
Hi Dominik,
On 11.12.2024 14:50, Dominik Karol Piątkowski wrote:
> Add a test that gives user fence in application, holds it, drops the
> debugger connection and checks if anything breaks. It is expected that
> held acks are released when connection is dropped.
>
> Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>
> Reviewed-by: Christoph Manszewski <christoph.manszewski@intel.com>
> ---
> v2:
> - Rename basic-vm-bind-drop-debugger-before-ufence-ack to
> basic-vm-bind-ufence-reconnect and merge it into test_basic_ufence
> ---
> tests/intel/xe_eudebug.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
> index 1853dee40..77ce905f0 100644
> --- a/tests/intel/xe_eudebug.c
> +++ b/tests/intel/xe_eudebug.c
> @@ -64,6 +64,7 @@ static void test_sysfs_toggle(int fd)
> #define VM_BIND_OP_MAP_USERPTR (1 << 7)
> #define EXEC_QUEUES_PLACEMENTS (1 << 8)
> #define VM_BIND_DELAY_UFENCE_ACK (1 << 9)
> +#define VM_BIND_UFENCE_RECONNECT (1 << 10)
> #define TEST_DISCOVERY (1 << 31)
>
> #define PAGE_SIZE SZ_4K
> @@ -2129,6 +2130,11 @@ static int wait_for_ufence_events(struct ufence_priv *priv, int timeout_ms)
> * SUBTEST: basic-vm-bind-ufence-delay-ack
> * Description:
> * Give user fence in application and check if delayed ufence ack works
> + *
> + * SUBTEST: basic-vm-bind-ufence-reconnect
> + * Description:
> + * Give user fence in application, hold it, drop the debugger connection and check if anything
> + * breaks. Expect that held acks are released when connection is dropped.
> */
> static void test_basic_ufence(int fd, unsigned int flags)
> {
> @@ -2136,6 +2142,7 @@ static void test_basic_ufence(int fd, unsigned int flags)
> struct xe_eudebug_session *s;
> struct xe_eudebug_client *c;
> struct ufence_priv *priv;
> + uint32_t filter = XE_EUDEBUG_FILTER_EVENT_VM_BIND_UFENCE;
>
> priv = ufence_priv_create();
> s = xe_eudebug_session_create(fd, basic_ufence_client, flags, priv);
> @@ -2157,7 +2164,14 @@ static void test_basic_ufence(int fd, unsigned int flags)
> if (flags & VM_BIND_DELAY_UFENCE_ACK)
> sleep(XE_EUDEBUG_DEFAULT_TIMEOUT_SEC * 4 / 5);
>
> - ack_fences(d);
> + if (flags & VM_BIND_UFENCE_RECONNECT) {
> + filter = XE_EUDEBUG_FILTER_EVENT_VM_BIND | XE_EUDEBUG_FILTER_EVENT_VM |
> + XE_EUDEBUG_FILTER_EVENT_OPEN;
> + xe_eudebug_debugger_detach(d);
> + sleep(1);
Sorry for missing that in the first round but what do we wait for here
exactly? To me it looks a little like we try to wait for the client to
finish, so we don't get a replay in the event log and don't call our
trigger again. That is properly handled in interrupt-reconnect I think.
It requires the client wait for a stage, cleaning the debugger log and
removing the trigger.
But I don't think it is worth the hassle and your approach works fine.
Just please use 'xe_eudebug_client_wait_done' instead of a timeout if
this what you are actually trying to achieve here (unless you don't,
then please just add some short comment/explanation in the code).
> + igt_assert_eq(xe_eudebug_debugger_attach(d, c), 0);
> + } else
> + ack_fences(d);
Nit: missing braces.
Thanks,
Christoph
>
> xe_eudebug_client_wait_done(c);
> xe_eudebug_debugger_stop_worker(d, 1);
> @@ -2165,7 +2179,7 @@ static void test_basic_ufence(int fd, unsigned int flags)
> xe_eudebug_event_log_print(d->log, true);
> xe_eudebug_event_log_print(c->log, true);
>
> - xe_eudebug_session_check(s, true, XE_EUDEBUG_FILTER_EVENT_VM_BIND_UFENCE);
> + xe_eudebug_session_check(s, true, filter);
>
> xe_eudebug_session_destroy(s);
> ufence_priv_destroy(priv);
> @@ -2825,6 +2839,9 @@ igt_main
> igt_subtest("basic-vm-bind-ufence-delay-ack")
> test_basic_ufence(fd, VM_BIND_DELAY_UFENCE_ACK);
>
> + igt_subtest("basic-vm-bind-ufence-reconnect")
> + test_basic_ufence(fd, VM_BIND_UFENCE_RECONNECT);
> +
> igt_subtest("vma-ufence")
> test_vma_ufence(fd, 0);
>
next prev parent reply other threads:[~2024-12-11 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 13:50 [PATCH v2 i-g-t 0/3] tests/intel/xe_eudebug: Introduce additional ufence testcases Dominik Karol Piątkowski
2024-12-11 13:50 ` [PATCH v2 i-g-t 1/3] tests/intel/xe_eudebug: Add basic-vm-bind-ufence-delay-ack test Dominik Karol Piątkowski
2024-12-11 13:50 ` [PATCH v2 i-g-t 2/3] tests/intel/xe_eudebug: Add basic-vm-bind-ufence-reconnect test Dominik Karol Piątkowski
2024-12-11 19:29 ` Manszewski, Christoph [this message]
2024-12-11 13:50 ` [PATCH v2 i-g-t 3/3] tests/intel/xe_eudebug: Add basic-vm-bind-ufence-sigint-client test Dominik Karol Piątkowski
2024-12-11 21:26 ` Manszewski, Christoph
2024-12-11 17:38 ` ✓ i915.CI.BAT: success for tests/intel/xe_eudebug: Introduce additional ufence testcases (rev2) Patchwork
2024-12-11 18:25 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-11 19:26 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-11 20:58 ` ✗ 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=4b3050a4-f4d4-4236-8e43-13cce9c15dd1@intel.com \
--to=christoph.manszewski@intel.com \
--cc=dominik.grzegorzek@intel.com \
--cc=dominik.karol.piatkowski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=pawel.sikora@intel.com \
--cc=zbigniew.kempczynski@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