Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/sriov_basic: verify VF disabling when its fd remains open
@ 2025-02-26 14:42 Lukasz Laguna
  2025-02-27 18:32 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lukasz Laguna @ 2025-02-26 14:42 UTC (permalink / raw)
  To: igt-dev
  Cc: marcin.bernatowicz, michal.wajdeczko, adam.miszczak,
	jakub1.kolakowski, lukasz.laguna

Introduce a subtest that verifies the VF disabling when its file
descriptor remains open. The expected behaviour is forceful VF driver
unbind and VF disabling.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
 tests/sriov_basic.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/sriov_basic.c b/tests/sriov_basic.c
index 36bca4149..986566dc2 100644
--- a/tests/sriov_basic.c
+++ b/tests/sriov_basic.c
@@ -118,6 +118,21 @@ static void bind_unbind_vf(int pf_fd, unsigned int vf_num)
 	igt_sriov_disable_vfs(pf_fd);
 }
 
+/**
+ * SUBTEST: disable-vf-with-open-fd
+ * Description:
+ *   Verify the VF disabling when its file descriptor remains open
+ */
+static void disable_vf_with_open_fd(int pf_fd)
+{
+	igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+
+	igt_sriov_enable_driver_autoprobe(pf_fd);
+	igt_sriov_enable_vfs(pf_fd, 1);
+	igt_assert_fd(igt_sriov_open_vf_drm_device(pf_fd, 1));
+	igt_sriov_disable_vfs(pf_fd);
+}
+
 igt_main
 {
 	int pf_fd;
@@ -209,6 +224,10 @@ igt_main
 		}
 	}
 
+	igt_describe("Verify the VF disabling when its file descriptor remains open");
+	igt_subtest("disable-vf-with-open-fd")
+		disable_vf_with_open_fd(pf_fd);
+
 	igt_fixture {
 		igt_sriov_disable_vfs(pf_fd);
 		/* abort to avoid execution of next tests with enabled VFs */
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-28  4:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 14:42 [PATCH i-g-t] tests/sriov_basic: verify VF disabling when its fd remains open Lukasz Laguna
2025-02-27 18:32 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-02-27 18:46 ` ✓ i915.CI.BAT: " Patchwork
2025-02-27 22:26 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-28  4:08 ` ✗ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox