Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests
  2023-11-09 16:07   ` Kamil Konieczny
@ 2023-11-09  9:18     ` Matthew Brost
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Brost @ 2023-11-09  9:18 UTC (permalink / raw)
  To: Kamil Konieczny; +Cc: igt-dev

On Thu, Nov 09, 2023 at 05:07:10PM +0100, Kamil Konieczny wrote:
> Hi Priyanka,
> 
> On 2023-11-09 at 20:43:46 +0530, priyanka.dandamudi@intel.com wrote:
> > From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> > 
> > Added tests to check engine set properties.

s/engine/exec_queue

> > It tests basic positive and invalid values for priority and persistence.
> > 
> > Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> > Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> > ---
> >  tests/intel/xe_engine_property.c | 102 +++++++++++++++++++++++++++++++

s/xe_engine_property/xe_exec_queue_property/

Matt

> >  tests/meson.build                |   1 +
> >  2 files changed, 103 insertions(+)
> >  create mode 100644 tests/intel/xe_engine_property.c
> > 
> > diff --git a/tests/intel/xe_engine_property.c b/tests/intel/xe_engine_property.c
> > new file mode 100644
> > index 000000000..18e050f96
> > --- /dev/null
> > +++ b/tests/intel/xe_engine_property.c
> > @@ -0,0 +1,102 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +/**
> > + * TEST: Basic tests to check engine set property functionality
> > + * Category: Software building block
> > + * Run type: FULL
> ----- ^^^^^^^^^^^^^^
> No need for specifing this anymore.
> 
> > + * Sub-category: engine property
> > + * Functionality: engine set property
> > + * Test category: functionality test
> > + * SUBTEST: priority-set-property
> > + * Description: tests basic priority property by setting invalid values and positive values.
> > + * SUBTEST: persistence-set-property
> > + * Description: tests basic persistence property by setting positive values
> > + */
> > +
> > +#include <dirent.h>
> > +#include <fcntl.h>
> > +#include <string.h>
> > +#include <sys/stat.h>
> > +#include <sys/types.h>
> > +
> > +#include "igt.h"
> > +#include "xe_drm.h"
> ------------ ^^^^
> Move this after "lib/..."
> 
> Regards,
> Kamil
> 
> > +#include "lib/igt_syncobj.h"
> > +#include "lib/intel_reg.h"
> > +#include "xe/xe_ioctl.h"
> > +#include "xe/xe_query.h"
> > +
> > +#define DRM_SCHED_PRIORITY_HIGH  2
> > +#define DRM_SCHED_PRIORITY_NORMAL 1
> > +
> > +static void test_set_property(int xe, int property_name,
> > +			      int property_value, int err_val)
> > +{
> > +	struct drm_xe_engine_class_instance instance = {
> > +			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND_SYNC,
> > +	};
> > +	struct drm_xe_ext_set_property ext = {
> > +		.base.next_extension = 0,
> > +		.base.name = XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY,
> > +		.property = property_name,
> > +		.value = property_value,
> > +	};
> > +
> > +	struct drm_xe_exec_queue_create create = {
> > +		.extensions = to_user_pointer(&ext),
> > +		.width = 1,
> > +		.num_placements = 1,
> > +		.instances = to_user_pointer(&instance),
> > +		.vm_id = xe_vm_create(xe, 0, 0),
> > +	};
> > +	int ret = 0;
> > +
> > +	if (igt_ioctl(xe, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &create)) {
> > +		ret = -errno;
> > +		errno = 0;
> > +	}
> > +	igt_assert_eq(ret, err_val);
> > +}
> > +
> > +igt_main
> > +{
> > +	int xe;
> > +
> > +	igt_fixture {
> > +		xe = drm_open_driver(DRIVER_XE);
> > +	}
> > +
> > +	igt_subtest("priority-set-property") {
> > +		/* Tests priority property by setting positive values. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +				  DRM_SCHED_PRIORITY_NORMAL, 0);
> > +
> > +		/* Tests priority property by setting invalid value. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +				  DRM_SCHED_PRIORITY_HIGH + 1, -EINVAL);
> > +		igt_fork(child, 1) {
> > +			igt_drop_root();
> > +
> > +			/* Tests priority property by dropping root permissions. */
> > +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +					  DRM_SCHED_PRIORITY_HIGH, -EPERM);
> > +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +					  DRM_SCHED_PRIORITY_NORMAL, 0);
> > +		}
> > +		igt_waitchildren();
> > +	}
> > +
> > +	igt_subtest("persistence-set-property") {
> > +		/* Tests persistence property by setting positive values. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE, 1, 0);
> > +
> > +	}
> > +
> > +	igt_fixture {
> > +		xe_device_put(xe);
> > +		drm_close_driver(xe);
> > +	}
> > +}
> > diff --git a/tests/meson.build b/tests/meson.build
> > index 62721157d..1b7cd6544 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -281,6 +281,7 @@ intel_xe_progs = [
> >  	'xe_dma_buf_sync',
> >  	'xe_debugfs',
> >  	'xe_drm_fdinfo',
> > +	'xe_engine_property',
> >  	'xe_evict',
> >  	'xe_evict_ccs',
> >  	'xe_exec_balancer',
> > -- 
> > 2.25.1
> > 

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

* [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property
@ 2023-11-09 15:13 priyanka.dandamudi
  2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: priyanka.dandamudi @ 2023-11-09 15:13 UTC (permalink / raw)
  To: priyanka.dandamudi, janga.rahul.kumar, igt-dev

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Added tests to check engine set property ioctl.

v2: Modified code to work for all platforms.(Rahul)

Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Priyanka Dandamudi (2):
  tests/intel/xe_engine_property: Add engine set property tests
  tests/intel/xe_engine_property: Add scheduler engine set property

 tests/intel/xe_engine_property.c | 185 +++++++++++++++++++++++++++++++
 tests/meson.build                |   1 +
 2 files changed, 186 insertions(+)
 create mode 100644 tests/intel/xe_engine_property.c

-- 
2.25.1

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

* [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests
  2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
@ 2023-11-09 15:13 ` priyanka.dandamudi
  2023-11-09 16:07   ` Kamil Konieczny
  2023-11-09 15:13 ` [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property priyanka.dandamudi
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: priyanka.dandamudi @ 2023-11-09 15:13 UTC (permalink / raw)
  To: priyanka.dandamudi, janga.rahul.kumar, igt-dev

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Added tests to check engine set properties.
It tests basic positive and invalid values for priority and persistence.

Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
---
 tests/intel/xe_engine_property.c | 102 +++++++++++++++++++++++++++++++
 tests/meson.build                |   1 +
 2 files changed, 103 insertions(+)
 create mode 100644 tests/intel/xe_engine_property.c

diff --git a/tests/intel/xe_engine_property.c b/tests/intel/xe_engine_property.c
new file mode 100644
index 000000000..18e050f96
--- /dev/null
+++ b/tests/intel/xe_engine_property.c
@@ -0,0 +1,102 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+/**
+ * TEST: Basic tests to check engine set property functionality
+ * Category: Software building block
+ * Run type: FULL
+ * Sub-category: engine property
+ * Functionality: engine set property
+ * Test category: functionality test
+ * SUBTEST: priority-set-property
+ * Description: tests basic priority property by setting invalid values and positive values.
+ * SUBTEST: persistence-set-property
+ * Description: tests basic persistence property by setting positive values
+ */
+
+#include <dirent.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "igt.h"
+#include "xe_drm.h"
+#include "lib/igt_syncobj.h"
+#include "lib/intel_reg.h"
+#include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
+
+#define DRM_SCHED_PRIORITY_HIGH  2
+#define DRM_SCHED_PRIORITY_NORMAL 1
+
+static void test_set_property(int xe, int property_name,
+			      int property_value, int err_val)
+{
+	struct drm_xe_engine_class_instance instance = {
+			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND_SYNC,
+	};
+	struct drm_xe_ext_set_property ext = {
+		.base.next_extension = 0,
+		.base.name = XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY,
+		.property = property_name,
+		.value = property_value,
+	};
+
+	struct drm_xe_exec_queue_create create = {
+		.extensions = to_user_pointer(&ext),
+		.width = 1,
+		.num_placements = 1,
+		.instances = to_user_pointer(&instance),
+		.vm_id = xe_vm_create(xe, 0, 0),
+	};
+	int ret = 0;
+
+	if (igt_ioctl(xe, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &create)) {
+		ret = -errno;
+		errno = 0;
+	}
+	igt_assert_eq(ret, err_val);
+}
+
+igt_main
+{
+	int xe;
+
+	igt_fixture {
+		xe = drm_open_driver(DRIVER_XE);
+	}
+
+	igt_subtest("priority-set-property") {
+		/* Tests priority property by setting positive values. */
+		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
+				  DRM_SCHED_PRIORITY_NORMAL, 0);
+
+		/* Tests priority property by setting invalid value. */
+		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
+				  DRM_SCHED_PRIORITY_HIGH + 1, -EINVAL);
+		igt_fork(child, 1) {
+			igt_drop_root();
+
+			/* Tests priority property by dropping root permissions. */
+			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
+					  DRM_SCHED_PRIORITY_HIGH, -EPERM);
+			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
+					  DRM_SCHED_PRIORITY_NORMAL, 0);
+		}
+		igt_waitchildren();
+	}
+
+	igt_subtest("persistence-set-property") {
+		/* Tests persistence property by setting positive values. */
+		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE, 1, 0);
+
+	}
+
+	igt_fixture {
+		xe_device_put(xe);
+		drm_close_driver(xe);
+	}
+}
diff --git a/tests/meson.build b/tests/meson.build
index 62721157d..1b7cd6544 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -281,6 +281,7 @@ intel_xe_progs = [
 	'xe_dma_buf_sync',
 	'xe_debugfs',
 	'xe_drm_fdinfo',
+	'xe_engine_property',
 	'xe_evict',
 	'xe_evict_ccs',
 	'xe_exec_balancer',
-- 
2.25.1

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

* [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property
  2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
  2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
@ 2023-11-09 15:13 ` priyanka.dandamudi
  2023-11-09 20:25   ` Kumar, Janga Rahul
  2023-11-09 18:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for Tests for " Patchwork
  2023-11-09 19:09 ` [igt-dev] ✗ CI.xeBAT: " Patchwork
  3 siblings, 1 reply; 8+ messages in thread
From: priyanka.dandamudi @ 2023-11-09 15:13 UTC (permalink / raw)
  To: priyanka.dandamudi, janga.rahul.kumar, igt-dev

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Added tests to check scheduler engine set properties.
Schedulers inclcude job timeout, preempt timeout and timeslice.

Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
---
 tests/intel/xe_engine_property.c | 83 ++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/tests/intel/xe_engine_property.c b/tests/intel/xe_engine_property.c
index 18e050f96..226945994 100644
--- a/tests/intel/xe_engine_property.c
+++ b/tests/intel/xe_engine_property.c
@@ -14,6 +14,14 @@
  * Description: tests basic priority property by setting invalid values and positive values.
  * SUBTEST: persistence-set-property
  * Description: tests basic persistence property by setting positive values
+ * SUBTEST: %s-property-min-max
+ * Description: Test to check if %s arg[1] schedule parameter checks for min max values.
+ *
+ * arg[1]:
+ *
+ * @preempt_timeout_us:		preempt timeout us
+ * @timeslice_duration_us:	timeslice duration us
+ * @job_timeout_ms:		job timeout ms
  */
 
 #include <dirent.h>
@@ -23,6 +31,7 @@
 #include <sys/types.h>
 
 #include "igt.h"
+#include "igt_sysfs.h"
 #include "xe_drm.h"
 #include "lib/igt_syncobj.h"
 #include "lib/intel_reg.h"
@@ -32,6 +41,18 @@
 #define DRM_SCHED_PRIORITY_HIGH  2
 #define DRM_SCHED_PRIORITY_NORMAL 1
 
+static int get_property_name(const char *property)
+{
+	if (strstr(property, "preempt"))
+		return XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT;
+	else if (strstr(property, "job_timeout"))
+		return XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT;
+	else if (strstr(property, "timeslice"))
+		return XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE;
+	else
+		return -1;
+}
+
 static void test_set_property(int xe, int property_name,
 			      int property_value, int err_val)
 {
@@ -61,12 +82,54 @@ static void test_set_property(int xe, int property_name,
 	igt_assert_eq(ret, err_val);
 }
 
+static void test_property_min_max(int xe, int engine, const char **property)
+{
+	unsigned int max;
+	unsigned int min;
+	unsigned int set;
+	int property_name;
+	int defaults;
+
+	defaults = openat(engine, ".defaults", O_DIRECTORY);
+	igt_require(defaults != -1);
+
+	igt_sysfs_scanf(defaults, property[2], "%u", &max);
+	igt_sysfs_scanf(defaults, property[1], "%u", &min);
+	igt_sysfs_scanf(engine, property[0], "%u", &set);
+
+	property_name = get_property_name(property[0]);
+	igt_assert_neq(property_name, -1);
+
+	/* Tests scheduler properties by setting positive values */
+	test_set_property(xe, property_name, max, 0);
+	test_set_property(xe, property_name, min, 0);
+
+	/* Tests scheduler properties by setting invalid values */
+	test_set_property(xe, property_name, max + 1, -EINVAL);
+	test_set_property(xe, property_name, min - 1, -EINVAL);
+}
+
 igt_main
 {
+	static const struct {
+		const char *name;
+		void (*fn)(int, int, const char **);
+	} tests[] = {{"property-min-max", test_property_min_max}, {} };
+
+	const char *property[][3] = { {"preempt_timeout_us", "preempt_timeout_min", "preempt_timeout_max"},
+				      {"timeslice_duration_us", "timeslice_duration_min", "timeslice_duration_max"},
+				      {"job_timeout_ms", "job_timeout_min", "job_timeout_max"},
+	};
+	int count = sizeof(property) / sizeof(property[0]);
+	int sys_fd;
 	int xe;
+	int gt;
 
 	igt_fixture {
 		xe = drm_open_driver(DRIVER_XE);
+		sys_fd = igt_sysfs_open(xe);
+		igt_require(sys_fd != -1);
+		close(sys_fd);
 	}
 
 	igt_subtest("priority-set-property") {
@@ -95,6 +158,26 @@ igt_main
 
 	}
 
+	for (int i = 0; i < count; i++) {
+		for (typeof(*tests) *t = tests; t->name; t++) {
+			igt_subtest_with_dynamic_f("%s-%s", property[i][0], t->name) {
+				xe_for_each_gt(xe, gt) {
+					int engines_fd = -1;
+					int gt_fd = -1;
+
+					gt_fd = xe_sysfs_gt_open(xe, gt);
+					igt_require(gt_fd != -1);
+					engines_fd = openat(gt_fd, "engines", O_RDONLY);
+					igt_require(engines_fd != -1);
+
+					igt_sysfs_engines(xe, engines_fd, property[i], t->fn);
+					close(engines_fd);
+					close(gt_fd);
+				}
+			}
+		}
+	}
+
 	igt_fixture {
 		xe_device_put(xe);
 		drm_close_driver(xe);
-- 
2.25.1

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

* Re: [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests
  2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
@ 2023-11-09 16:07   ` Kamil Konieczny
  2023-11-09  9:18     ` Matthew Brost
  0 siblings, 1 reply; 8+ messages in thread
From: Kamil Konieczny @ 2023-11-09 16:07 UTC (permalink / raw)
  To: igt-dev

Hi Priyanka,

On 2023-11-09 at 20:43:46 +0530, priyanka.dandamudi@intel.com wrote:
> From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> 
> Added tests to check engine set properties.
> It tests basic positive and invalid values for priority and persistence.
> 
> Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> ---
>  tests/intel/xe_engine_property.c | 102 +++++++++++++++++++++++++++++++
>  tests/meson.build                |   1 +
>  2 files changed, 103 insertions(+)
>  create mode 100644 tests/intel/xe_engine_property.c
> 
> diff --git a/tests/intel/xe_engine_property.c b/tests/intel/xe_engine_property.c
> new file mode 100644
> index 000000000..18e050f96
> --- /dev/null
> +++ b/tests/intel/xe_engine_property.c
> @@ -0,0 +1,102 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2023 Intel Corporation
> + */
> +
> +/**
> + * TEST: Basic tests to check engine set property functionality
> + * Category: Software building block
> + * Run type: FULL
----- ^^^^^^^^^^^^^^
No need for specifing this anymore.

> + * Sub-category: engine property
> + * Functionality: engine set property
> + * Test category: functionality test
> + * SUBTEST: priority-set-property
> + * Description: tests basic priority property by setting invalid values and positive values.
> + * SUBTEST: persistence-set-property
> + * Description: tests basic persistence property by setting positive values
> + */
> +
> +#include <dirent.h>
> +#include <fcntl.h>
> +#include <string.h>
> +#include <sys/stat.h>
> +#include <sys/types.h>
> +
> +#include "igt.h"
> +#include "xe_drm.h"
------------ ^^^^
Move this after "lib/..."

Regards,
Kamil

> +#include "lib/igt_syncobj.h"
> +#include "lib/intel_reg.h"
> +#include "xe/xe_ioctl.h"
> +#include "xe/xe_query.h"
> +
> +#define DRM_SCHED_PRIORITY_HIGH  2
> +#define DRM_SCHED_PRIORITY_NORMAL 1
> +
> +static void test_set_property(int xe, int property_name,
> +			      int property_value, int err_val)
> +{
> +	struct drm_xe_engine_class_instance instance = {
> +			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND_SYNC,
> +	};
> +	struct drm_xe_ext_set_property ext = {
> +		.base.next_extension = 0,
> +		.base.name = XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY,
> +		.property = property_name,
> +		.value = property_value,
> +	};
> +
> +	struct drm_xe_exec_queue_create create = {
> +		.extensions = to_user_pointer(&ext),
> +		.width = 1,
> +		.num_placements = 1,
> +		.instances = to_user_pointer(&instance),
> +		.vm_id = xe_vm_create(xe, 0, 0),
> +	};
> +	int ret = 0;
> +
> +	if (igt_ioctl(xe, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &create)) {
> +		ret = -errno;
> +		errno = 0;
> +	}
> +	igt_assert_eq(ret, err_val);
> +}
> +
> +igt_main
> +{
> +	int xe;
> +
> +	igt_fixture {
> +		xe = drm_open_driver(DRIVER_XE);
> +	}
> +
> +	igt_subtest("priority-set-property") {
> +		/* Tests priority property by setting positive values. */
> +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> +				  DRM_SCHED_PRIORITY_NORMAL, 0);
> +
> +		/* Tests priority property by setting invalid value. */
> +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> +				  DRM_SCHED_PRIORITY_HIGH + 1, -EINVAL);
> +		igt_fork(child, 1) {
> +			igt_drop_root();
> +
> +			/* Tests priority property by dropping root permissions. */
> +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> +					  DRM_SCHED_PRIORITY_HIGH, -EPERM);
> +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> +					  DRM_SCHED_PRIORITY_NORMAL, 0);
> +		}
> +		igt_waitchildren();
> +	}
> +
> +	igt_subtest("persistence-set-property") {
> +		/* Tests persistence property by setting positive values. */
> +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE, 1, 0);
> +
> +	}
> +
> +	igt_fixture {
> +		xe_device_put(xe);
> +		drm_close_driver(xe);
> +	}
> +}
> diff --git a/tests/meson.build b/tests/meson.build
> index 62721157d..1b7cd6544 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -281,6 +281,7 @@ intel_xe_progs = [
>  	'xe_dma_buf_sync',
>  	'xe_debugfs',
>  	'xe_drm_fdinfo',
> +	'xe_engine_property',
>  	'xe_evict',
>  	'xe_evict_ccs',
>  	'xe_exec_balancer',
> -- 
> 2.25.1
> 

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

* [igt-dev] ✗ Fi.CI.BAT: failure for Tests for engine set property
  2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
  2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
  2023-11-09 15:13 ` [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property priyanka.dandamudi
@ 2023-11-09 18:04 ` Patchwork
  2023-11-09 19:09 ` [igt-dev] ✗ CI.xeBAT: " Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2023-11-09 18:04 UTC (permalink / raw)
  To: priyanka.dandamudi; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 6920 bytes --]

== Series Details ==

Series: Tests for engine set property
URL   : https://patchwork.freedesktop.org/series/126201/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13856 -> IGTPW_10152
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_10152 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_10152, please notify your bug team (lgci.bug.filing@intel.com) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/index.html

Participating hosts (34 -> 35)
------------------------------

  Additional (2): fi-kbl-soraka fi-hsw-4770 
  Missing    (1): bat-dg2-8 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_10152:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_exec_suspend@basic-s0@smem:
    - bat-rpls-1:         [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/bat-rpls-1/igt@gem_exec_suspend@basic-s0@smem.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/bat-rpls-1/igt@gem_exec_suspend@basic-s0@smem.html

  
Known issues
------------

  Here are the changes found in IGTPW_10152 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_huc_copy@huc-copy:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#2190])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@basic:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#4613]) +3 other tests skip
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html

  * igt@i915_selftest@live@gt_pm:
    - fi-kbl-soraka:      NOTRUN -> [DMESG-FAIL][5] ([i915#1886])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
    - fi-hsw-4770:        NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#5190])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-hsw-4770/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html

  * igt@kms_dsc@dsc-basic:
    - fi-kbl-soraka:      NOTRUN -> [SKIP][7] ([fdo#109271]) +9 other tests skip
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-kbl-soraka/igt@kms_dsc@dsc-basic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-a-vga-1:
    - fi-hsw-4770:        NOTRUN -> [SKIP][8] ([fdo#109271]) +12 other tests skip
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-hsw-4770/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-a-vga-1.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1:
    - fi-hsw-4770:        NOTRUN -> [DMESG-WARN][9] ([i915#8841]) +6 other tests dmesg-warn
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-hsw-4770/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-c-vga-1.html

  * igt@kms_psr@sprite_plane_onoff:
    - fi-hsw-4770:        NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#1072]) +3 other tests skip
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-hsw-4770/igt@kms_psr@sprite_plane_onoff.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0@lmem0:
    - bat-dg2-9:          [INCOMPLETE][11] ([i915#9275]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/bat-dg2-9/igt@gem_exec_suspend@basic-s0@lmem0.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/bat-dg2-9/igt@gem_exec_suspend@basic-s0@lmem0.html

  * igt@i915_module_load@reload:
    - fi-skl-6600u:       [DMESG-WARN][13] ([i915#1982]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/fi-skl-6600u/igt@i915_module_load@reload.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-skl-6600u/igt@i915_module_load@reload.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-bsw-nick:        [FAIL][15] ([i915#9276]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/fi-bsw-nick/igt@kms_frontbuffer_tracking@basic.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/fi-bsw-nick/igt@kms_frontbuffer_tracking@basic.html

  * igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
    - bat-rplp-1:         [ABORT][17] ([i915#8668]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html

  * igt@kms_psr@sprite_plane_onoff:
    - bat-jsl-3:          [SKIP][19] -> [PASS][20] +3 other tests pass
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13856/bat-jsl-3/igt@kms_psr@sprite_plane_onoff.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/bat-jsl-3/igt@kms_psr@sprite_plane_onoff.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
  [i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
  [i915#8841]: https://gitlab.freedesktop.org/drm/intel/issues/8841
  [i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275
  [i915#9276]: https://gitlab.freedesktop.org/drm/intel/issues/9276


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7580 -> IGTPW_10152

  CI-20190529: 20190529
  CI_DRM_13856: b81818fa6745cf79a86da57dc3a379bd80c7ea5f @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_10152: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/index.html
  IGT_7580: 847ee1e7d365e2fb08bf4198d3bf5ee8a852649f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

+igt@xe_engine_property@job_timeout_ms-property-min-max
+igt@xe_engine_property@persistence-set-property
+igt@xe_engine_property@preempt_timeout_us-property-min-max
+igt@xe_engine_property@priority-set-property
+igt@xe_engine_property@timeslice_duration_us-property-min-max

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/index.html

[-- Attachment #2: Type: text/html, Size: 8242 bytes --]

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

* [igt-dev] ✗ CI.xeBAT: failure for Tests for engine set property
  2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
                   ` (2 preceding siblings ...)
  2023-11-09 18:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for Tests for " Patchwork
@ 2023-11-09 19:09 ` Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2023-11-09 19:09 UTC (permalink / raw)
  To: priyanka.dandamudi; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

== Series Details ==

Series: Tests for engine set property
URL   : https://patchwork.freedesktop.org/series/126201/
State : failure

== Summary ==

CI Bug Log - changes from XEIGT_7580_BAT -> XEIGTPW_10152_BAT
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with XEIGTPW_10152_BAT absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in XEIGTPW_10152_BAT, please notify your bug team (lgci.bug.filing@intel.com) to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (2 -> 0)
------------------------------

  ERROR: It appears as if the changes made in XEIGTPW_10152_BAT prevented too many machines from booting.

  Missing    (2): bat-pvc-2 bat-atsm-2 


Changes
-------

  No changes found


Build changes
-------------

  * IGT: IGT_7580 -> IGTPW_10152
  * Linux: xe-481-7a0da606f1fcf4b59d7164419f1ccd1c48d366af -> xe-483-2096aea11094f62fea27af97d949423bea156686

  IGTPW_10152: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10152/index.html
  IGT_7580: 847ee1e7d365e2fb08bf4198d3bf5ee8a852649f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  xe-481-7a0da606f1fcf4b59d7164419f1ccd1c48d366af: 7a0da606f1fcf4b59d7164419f1ccd1c48d366af
  xe-483-2096aea11094f62fea27af97d949423bea156686: 2096aea11094f62fea27af97d949423bea156686

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10152/index.html

[-- Attachment #2: Type: text/html, Size: 2134 bytes --]

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

* Re: [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property
  2023-11-09 15:13 ` [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property priyanka.dandamudi
@ 2023-11-09 20:25   ` Kumar, Janga Rahul
  0 siblings, 0 replies; 8+ messages in thread
From: Kumar, Janga Rahul @ 2023-11-09 20:25 UTC (permalink / raw)
  To: Dandamudi, Priyanka, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: Dandamudi, Priyanka <priyanka.dandamudi@intel.com>
> Sent: Thursday, November 9, 2023 8:44 PM
> To: Dandamudi, Priyanka <priyanka.dandamudi@intel.com>; Kumar, Janga
> Rahul <janga.rahul.kumar@intel.com>; igt-dev@lists.freedesktop.org
> Subject: [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler
> engine set property
> 
> From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> 
> Added tests to check scheduler engine set properties.
> Schedulers inclcude job timeout, preempt timeout and timeslice.
\ inclcude\include
> 
> Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> ---
>  tests/intel/xe_engine_property.c | 83 ++++++++++++++++++++++++++++++++
>  1 file changed, 83 insertions(+)
> 
> diff --git a/tests/intel/xe_engine_property.c
> b/tests/intel/xe_engine_property.c
> index 18e050f96..226945994 100644
> --- a/tests/intel/xe_engine_property.c
> +++ b/tests/intel/xe_engine_property.c
> @@ -14,6 +14,14 @@
>   * Description: tests basic priority property by setting invalid values and
> positive values.
>   * SUBTEST: persistence-set-property
>   * Description: tests basic persistence property by setting positive values
> + * SUBTEST: %s-property-min-max
> + * Description: Test to check if %s arg[1] schedule parameter checks for min
> max values.
> + *
> + * arg[1]:
> + *
> + * @preempt_timeout_us:		preempt timeout us
> + * @timeslice_duration_us:	timeslice duration us
> + * @job_timeout_ms:		job timeout ms
>   */
> 
>  #include <dirent.h>
> @@ -23,6 +31,7 @@
>  #include <sys/types.h>
> 
>  #include "igt.h"
> +#include "igt_sysfs.h"
>  #include "xe_drm.h"
>  #include "lib/igt_syncobj.h"
>  #include "lib/intel_reg.h"
> @@ -32,6 +41,18 @@
>  #define DRM_SCHED_PRIORITY_HIGH  2
>  #define DRM_SCHED_PRIORITY_NORMAL 1
> 
> +static int get_property_name(const char *property) {
> +	if (strstr(property, "preempt"))
> +		return
> XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT;
> +	else if (strstr(property, "job_timeout"))
> +		return XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT;
> +	else if (strstr(property, "timeslice"))
> +		return XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE;
> +	else
> +		return -1;
> +}
> +
>  static void test_set_property(int xe, int property_name,
>  			      int property_value, int err_val)  { @@ -61,12
> +82,54 @@ static void test_set_property(int xe, int property_name,
>  	igt_assert_eq(ret, err_val);
>  }
> 
> +static void test_property_min_max(int xe, int engine, const char
> +**property) {
> +	unsigned int max;
> +	unsigned int min;
> +	unsigned int set;
> +	int property_name;
> +	int defaults;
> +
> +	defaults = openat(engine, ".defaults", O_DIRECTORY);
> +	igt_require(defaults != -1);
> +
> +	igt_sysfs_scanf(defaults, property[2], "%u", &max);
> +	igt_sysfs_scanf(defaults, property[1], "%u", &min);
> +	igt_sysfs_scanf(engine, property[0], "%u", &set);
> +
> +	property_name = get_property_name(property[0]);
> +	igt_assert_neq(property_name, -1);
> +
> +	/* Tests scheduler properties by setting positive values */
> +	test_set_property(xe, property_name, max, 0);
> +	test_set_property(xe, property_name, min, 0);
> +
> +	/* Tests scheduler properties by setting invalid values */
> +	test_set_property(xe, property_name, max + 1, -EINVAL);
> +	test_set_property(xe, property_name, min - 1, -EINVAL); }
> +
>  igt_main
>  {
> +	static const struct {
> +		const char *name;
> +		void (*fn)(int, int, const char **);
> +	} tests[] = {{"property-min-max", test_property_min_max}, {} };
> +
> +	const char *property[][3] = { {"preempt_timeout_us",
> "preempt_timeout_min", "preempt_timeout_max"},
> +				      {"timeslice_duration_us",
> "timeslice_duration_min", "timeslice_duration_max"},
> +				      {"job_timeout_ms", "job_timeout_min",
> "job_timeout_max"},
> +	};
> +	int count = sizeof(property) / sizeof(property[0]);
> +	int sys_fd;
>  	int xe;
> +	int gt;
> 
>  	igt_fixture {
>  		xe = drm_open_driver(DRIVER_XE);
> +		sys_fd = igt_sysfs_open(xe);
> +		igt_require(sys_fd != -1);
As this is not a requirement for all the subtests. Pls include this check inside subtests wherever applicable.

-Rahul
> +		close(sys_fd);
>  	}
> 
>  	igt_subtest("priority-set-property") { @@ -95,6 +158,26 @@ igt_main
> 
>  	}
> 
> +	for (int i = 0; i < count; i++) {
> +		for (typeof(*tests) *t = tests; t->name; t++) {
> +			igt_subtest_with_dynamic_f("%s-%s", property[i][0],
> t->name) {
> +				xe_for_each_gt(xe, gt) {
> +					int engines_fd = -1;
> +					int gt_fd = -1;
> +
> +					gt_fd = xe_sysfs_gt_open(xe, gt);
> +					igt_require(gt_fd != -1);
> +					engines_fd = openat(gt_fd, "engines",
> O_RDONLY);
> +					igt_require(engines_fd != -1);
> +
> +					igt_sysfs_engines(xe, engines_fd,
> property[i], t->fn);
> +					close(engines_fd);
> +					close(gt_fd);
> +				}
> +			}
> +		}
> +	}
> +
>  	igt_fixture {
>  		xe_device_put(xe);
>  		drm_close_driver(xe);
> --
> 2.25.1

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

end of thread, other threads:[~2023-11-09 20:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
2023-11-09 16:07   ` Kamil Konieczny
2023-11-09  9:18     ` Matthew Brost
2023-11-09 15:13 ` [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property priyanka.dandamudi
2023-11-09 20:25   ` Kumar, Janga Rahul
2023-11-09 18:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for Tests for " Patchwork
2023-11-09 19:09 ` [igt-dev] ✗ CI.xeBAT: " Patchwork

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