From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: <adam.miszczak@linux.intel.com>, <jakub1.kolakowski@intel.com>
Subject: Re: [PATCH i-g-t 5/6] tests/xe: Arm SR-IOV exit cleanup with callback
Date: Tue, 9 Jun 2026 10:11:05 +0200 [thread overview]
Message-ID: <02a2c68a-3c0f-471f-ad89-66ca85652587@intel.com> (raw)
In-Reply-To: <20260602141609.3941750-6-marcin.bernatowicz@linux.intel.com>
On 6/2/2026 16:16, Marcin Bernatowicz wrote:
> Install SR-IOV exit handler in xe_pmu, xe_sriov_admin, and
> xe_sriov_scheduling.
>
> Use xe_sriov_admin_exit_cleanup_restore_defaults() as exit callback to
> restore Xe SR-IOV admin scheduling defaults. Clear handler after explicit
> teardown succeeds.
>
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> Cc: Adam Miszczak <adam.miszczak@linux.intel.com>
> Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
> Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
> ---
> tests/intel/xe_pmu.c | 4 ++++
> tests/intel/xe_sriov_admin.c | 4 ++++
> tests/intel/xe_sriov_scheduling.c | 4 ++++
> 3 files changed, 12 insertions(+)
>
> diff --git a/tests/intel/xe_pmu.c b/tests/intel/xe_pmu.c
> index fb4b871e7..ec0266577 100644
> --- a/tests/intel/xe_pmu.c
> +++ b/tests/intel/xe_pmu.c
> @@ -994,6 +994,9 @@ static unsigned int enable_and_provision_vfs(int fd)
> igt_require(xe_sriov_admin_is_present(fd));
> igt_require(igt_sriov_get_enabled_vfs(fd) == 0);
> xe_sriov_require_default_scheduling_attributes(fd);
> + igt_sriov_install_exit_handler(fd, true,
> + xe_sriov_admin_exit_cleanup_restore_defaults,
> + NULL);
> autoprobe = igt_sriov_is_driver_autoprobe_enabled(fd);
>
> /* Enable VF's */
> @@ -1035,6 +1038,7 @@ static void unprovision_and_disable_vfs(int fd)
>
> igt_abort_on_f(autoprobe != igt_sriov_is_driver_autoprobe_enabled(fd),
> "Failed to restore sriov_drivers_autoprobe value\n");
> + igt_sriov_clear_exit_handler();
> }
>
> static void stash_gt_freq(int fd, uint32_t **stash_min, uint32_t **stash_max)
> diff --git a/tests/intel/xe_sriov_admin.c b/tests/intel/xe_sriov_admin.c
> index 5c7f5d621..344a141b7 100644
> --- a/tests/intel/xe_sriov_admin.c
> +++ b/tests/intel/xe_sriov_admin.c
> @@ -346,6 +346,9 @@ int igt_main()
> igt_require(igt_sriov_is_pf(pf_fd));
> igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
> igt_require(xe_sriov_admin_is_present(pf_fd));
> + igt_sriov_install_exit_handler(pf_fd, false,
> + xe_sriov_admin_exit_cleanup_restore_defaults,
> + NULL);
> total_vfs = igt_sriov_get_total_vfs(pf_fd);
> }
>
> @@ -429,6 +432,7 @@ int igt_main()
> igt_abort_on_f(igt_sriov_get_enabled_vfs(pf_fd) > 0,
> "Failed to disable VF(s)");
> igt_abort_on_f(ret, "Failed to restore default profile values\n");
> + igt_sriov_clear_exit_handler();
> drm_close_driver(pf_fd);
> }
> }
> diff --git a/tests/intel/xe_sriov_scheduling.c b/tests/intel/xe_sriov_scheduling.c
> index 4228eea2d..bd0ae95fa 100644
> --- a/tests/intel/xe_sriov_scheduling.c
> +++ b/tests/intel/xe_sriov_scheduling.c
> @@ -908,6 +908,9 @@ int igt_main_args("", long_opts, help_str, subm_opts_handler, NULL)
> igt_require(igt_sriov_is_pf(pf_fd));
> igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
> igt_require(xe_sriov_admin_is_present(pf_fd));
> + igt_sriov_install_exit_handler(pf_fd, true,
> + xe_sriov_admin_exit_cleanup_restore_defaults,
> + NULL);
> autoprobe = igt_sriov_is_driver_autoprobe_enabled(pf_fd);
> xe_sriov_require_default_scheduling_attributes(pf_fd);
> }
> @@ -952,6 +955,7 @@ int igt_main_args("", long_opts, help_str, subm_opts_handler, NULL)
> "Failed to restore sriov_drivers_autoprobe value\n");
> igt_abort_on_f(ret,
> "Failed to restore scheduling params\n");
> + igt_sriov_clear_exit_handler();
> drm_close_driver(pf_fd);
> }
> }
next prev parent reply other threads:[~2026-06-09 8:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 14:16 [PATCH i-g-t 0/6] Add SR-IOV exit-handler-based cleanup Marcin Bernatowicz
2026-06-02 14:16 ` [PATCH i-g-t 1/6] lib/igt_device_sriov: Add generic SR-IOV exit cleanup helper Marcin Bernatowicz
2026-06-08 13:41 ` Laguna, Lukasz
2026-06-02 14:16 ` [PATCH i-g-t 2/6] lib/xe/xe_sriov_admin: Add SR-IOV admin exit cleanup restore helper Marcin Bernatowicz
2026-06-09 8:10 ` Laguna, Lukasz
2026-06-02 14:16 ` [PATCH i-g-t 3/6] tests/sriov_basic: Arm SR-IOV exit cleanup Marcin Bernatowicz
2026-06-09 8:10 ` Laguna, Lukasz
2026-06-02 14:16 ` [PATCH i-g-t 4/6] tests/xe: " Marcin Bernatowicz
2026-06-09 8:10 ` Laguna, Lukasz
2026-06-02 14:16 ` [PATCH i-g-t 5/6] tests/xe: Arm SR-IOV exit cleanup with callback Marcin Bernatowicz
2026-06-09 8:11 ` Laguna, Lukasz [this message]
2026-06-02 14:16 ` [PATCH i-g-t 6/6] tests/intel/xe_sriov_flr: Arm SR-IOV exit cleanup Marcin Bernatowicz
2026-06-09 8:11 ` Laguna, Lukasz
2026-06-03 3:37 ` ✓ Xe.CI.BAT: success for Add SR-IOV exit-handler-based cleanup Patchwork
2026-06-03 3:49 ` ✓ i915.CI.BAT: " Patchwork
2026-06-03 14:00 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-03 22:29 ` ✓ i915.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=02a2c68a-3c0f-471f-ad89-66ca85652587@intel.com \
--to=lukasz.laguna@intel.com \
--cc=adam.miszczak@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=marcin.bernatowicz@linux.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