* [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-06 19:59 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
@ 2023-11-06 19:59 ` Lukasz Laguna
2023-11-06 22:07 ` Michal Wajdeczko
0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-06 19:59 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 20 +++++
lib/meson.build | 1 +
3 files changed, 195 insertions(+)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
new file mode 100644
index 000000000..7d53c2045
--- /dev/null
+++ b/lib/igt_sriov_device.c
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+#include "igt_sysfs.h"
+
+/**
+ * igt_sriov_is_pf:
+ * @device: device file descriptor
+ *
+ * Check if device is PF by checking existence of sriov_totalvfs file
+ * and non-zero value read from that file.
+ *
+ * Returns:
+ * True if device is PF, false otherwise.
+ */
+bool igt_sriov_is_pf(int device)
+{
+ int sysfs;
+ bool ret;
+ uint32_t totalvfs;
+
+ sysfs = igt_sysfs_open(device);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
+ close(sysfs);
+
+ if (!ret)
+ return false;
+
+ return totalvfs > 0;
+}
+
+static uint32_t __pf_attr_get_u32(int pf, const char *attr)
+{
+ int sysfs;
+ uint32_t value;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ value = igt_sysfs_get_u32(sysfs, attr);
+ close(sysfs);
+
+ return value;
+}
+
+static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_set_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+/**
+ * igt_sriov_get_totalvfs:
+ * @pf: PF device file descriptor
+ *
+ * Get maximum number of VFs that can be enabled.
+ *
+ * Returns:
+ * Maximum number of VFs that could be associated with given PF.
+ */
+unsigned int igt_sriov_get_total_vfs(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
+}
+
+/**
+ * igt_sriov_get_numvfs:
+ * @pf: PF device file descriptor
+ *
+ * Get number of enabled VFs.
+ *
+ * Returns:
+ * Number of VFs enabled by given PF.
+ */
+unsigned int igt_sriov_get_enabled_vfs(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_numvfs");
+}
+
+/**
+ * igt_sriov_enable_vfs:
+ * @pf: PF device file descriptor
+ * @num_vfs: Number of virtual functions to be enabled
+ *
+ * Helper for VFs enabling.
+ *
+ * Returns:
+ * True on success and false on failure.
+ */
+bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
+{
+ igt_assert(num_vfs > 0);
+ igt_debug("Enabling %u VFs\n", num_vfs);
+ return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
+}
+
+/**
+ * igt_sriov_disable_vfs:
+ * @pf: PF device file descriptor
+ *
+ * Set 0 in sriov_numvfs file to disable VFs.
+ *
+ * Returns:
+ * True on success and false on failure.
+ */
+bool igt_sriov_disable_vfs(int pf)
+{
+ igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
+ return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
+}
+
+/**
+ * igt_sriov_is_driver_autoprobe_enabled:
+ * @pf: PF device file descriptor
+ *
+ * Get current driver autoprobe setting.
+ *
+ * Returns:
+ * True if autoprobe is enabled, false otherwise.
+ */
+bool igt_sriov_is_driver_autoprobe_enabled(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
+}
+
+/**
+ * igt_sriov_enable_driver_autoprobe:
+ * @pf: PF device file descriptor
+ *
+ * Set driver autoprobe to true.
+ *
+ * During VFs enabling driver will be bound to VFs.
+ *
+ * Return:
+ * True if setting driver autoprobe succeed, otherwise false.
+ */
+bool igt_sriov_enable_driver_autoprobe(int pf)
+{
+ return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
+}
+
+/**
+ * igt_sriov_disable_driver_autoprobe:
+ * @pf: PF device file descriptor
+ *
+ * Set driver autoprobe to false.
+ *
+ * During VFs enabling driver won't be bound to VFs.
+ *
+ * Return:
+ * True if setting driver autoprobe succeed, otherwise false.
+ */
+bool igt_sriov_disable_driver_autoprobe(int pf)
+{
+ return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
new file mode 100644
index 000000000..f2c5c44fa
--- /dev/null
+++ b/lib/igt_sriov_device.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __IGT_SRIOV_DEVICE_H__
+#define __IGT_SRIOV_DEVICE_H__
+
+#include <stdint.h>
+
+bool igt_sriov_is_pf(int device);
+unsigned int igt_sriov_get_total_vfs(int pf);
+unsigned int igt_sriov_get_enabled_vfs(int pf);
+bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
+bool igt_sriov_disable_vfs(int pf);
+bool igt_sriov_is_driver_autoprobe_enabled(int pf);
+bool igt_sriov_enable_driver_autoprobe(int pf);
+bool igt_sriov_disable_driver_autoprobe(int pf);
+
+#endif /* __IGT_SRIOV_DEVICE_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index a7bccafc3..083baa68a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -38,6 +38,7 @@ lib_sources = [
'igt_primes.c',
'igt_pci.c',
'igt_rand.c',
+ 'igt_sriov_device.c',
'igt_stats.c',
'igt_syncobj.c',
'igt_sysfs.c',
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-06 19:59 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
@ 2023-11-06 22:07 ` Michal Wajdeczko
2023-11-09 6:55 ` Laguna, Lukasz
0 siblings, 1 reply; 24+ messages in thread
From: Michal Wajdeczko @ 2023-11-06 22:07 UTC (permalink / raw)
To: Lukasz Laguna, igt-dev
On 06.11.2023 20:59, Lukasz Laguna wrote:
> From: Katarzyna Dec <katarzyna.dec@intel.com>
>
> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
>
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> ---
> lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
> lib/igt_sriov_device.h | 20 +++++
> lib/meson.build | 1 +
> 3 files changed, 195 insertions(+)
> create mode 100644 lib/igt_sriov_device.c
> create mode 100644 lib/igt_sriov_device.h
>
> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
> new file mode 100644
> index 000000000..7d53c2045
> --- /dev/null
> +++ b/lib/igt_sriov_device.c
> @@ -0,0 +1,174 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#include "igt_core.h"
> +#include "igt_sriov_device.h"
> +#include "igt_sysfs.h"
> +
> +/**
> + * igt_sriov_is_pf:
nit: short function description missing, not required anymore?
> + * @device: device file descriptor
> + *
> + * Check if device is PF by checking existence of sriov_totalvfs file
> + * and non-zero value read from that file.
just to clarify/be precise, do you want to check here "device"
capability or "driver" capability ?
IIRC the PCI subsystem will set these attributes on the "PF device" even
if attached "PF driver" does not provide required hook to enable VFs
(and this is main purpose of being a "PF", no?)
> + *
> + * Returns:
> + * True if device is PF, false otherwise.
> + */
> +bool igt_sriov_is_pf(int device)
> +{
> + int sysfs;
> + bool ret;
> + uint32_t totalvfs;
nit: we shouldn't specify width if not needed, maybe plain unsigned int
will just work ? shame that there are no __igt_sysfs_get_uint()
> +
> + sysfs = igt_sysfs_open(device);
> + igt_assert_fd(sysfs);
> +
> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
> + close(sysfs);
> +
> + if (!ret)
> + return false;
> +
> + return totalvfs > 0;
> +}
> +
> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
> +{
> + int sysfs;
> + uint32_t value;
> +
> + igt_assert(igt_sriov_is_pf(pf));
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + value = igt_sysfs_get_u32(sysfs, attr);
> + close(sysfs);
> +
> + return value;
> +}
> +
> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
> +{
> + int sysfs;
> + bool ret;
> +
> + igt_assert(igt_sriov_is_pf(pf));
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
> + close(sysfs);
> +
> + return ret;
> +}
> +
> +/**
> + * igt_sriov_get_totalvfs:
> + * @pf: PF device file descriptor
> + *
> + * Get maximum number of VFs that can be enabled.
> + *
> + * Returns:
> + * Maximum number of VFs that could be associated with given PF.
> + */
> +unsigned int igt_sriov_get_total_vfs(int pf)
> +{
> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
> +}
> +
> +/**
> + * igt_sriov_get_numvfs:
> + * @pf: PF device file descriptor
> + *
> + * Get number of enabled VFs.
> + *
> + * Returns:
> + * Number of VFs enabled by given PF.
> + */
> +unsigned int igt_sriov_get_enabled_vfs(int pf)
> +{
> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
> +}
> +
> +/**
> + * igt_sriov_enable_vfs:
Helper for VFs enabling
> + * @pf: PF device file descriptor
> + * @num_vfs: Number of virtual functions to be enabled
> + *
> + * Helper for VFs enabling.
"This will try to enable VFs by writing @num_vfs to ...
> + *
> + * Returns:
> + * True on success and false on failure.
> + */
> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
> +{
> + igt_assert(num_vfs > 0);
> + igt_debug("Enabling %u VFs\n", num_vfs);
> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
> +}
> +
> +/**
> + * igt_sriov_disable_vfs:
Helper for VFs disabling
> + * @pf: PF device file descriptor
> + *
> + * Set 0 in sriov_numvfs file to disable VFs.
"This will try to disable already enabled VFs by writing 0 to ...
> + *
> + * Returns:
> + * True on success and false on failure.
> + */
> +bool igt_sriov_disable_vfs(int pf)
> +{
> + igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
this will trigger unnecessary "read" operation just for debug purposes,
while in log you should already see "Enabling N VFs", so we know the N.
> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
> +}
> +
> +/**
> + * igt_sriov_is_driver_autoprobe_enabled:
> + * @pf: PF device file descriptor
> + *
> + * Get current driver autoprobe setting.
hmm, this is SRIOV driver autoprobe (or VF driver autoprobe for
short/clarity)
> + *
> + * Returns:
> + * True if autoprobe is enabled, false otherwise.
> + */
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
> +{
> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
> +}
> +
> +/**
> + * igt_sriov_enable_driver_autoprobe:
> + * @pf: PF device file descriptor
> + *
> + * Set driver autoprobe to true.
> + *
> + * During VFs enabling driver will be bound to VFs.
"If successful, then kernel will automatically bind VFs to a compatible
driver immediately after they are enabled.
> + *
> + * Return:
> + * True if setting driver autoprobe succeed, otherwise false.
> + */
> +bool igt_sriov_enable_driver_autoprobe(int pf)
> +{
> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
> +}
> +
> +/**
> + * igt_sriov_disable_driver_autoprobe:
> + * @pf: PF device file descriptor
> + *
> + * Set driver autoprobe to false.
> + *
> + * During VFs enabling driver won't be bound to VFs.
> + *
> + * Return:
> + * True if setting driver autoprobe succeed, otherwise false.
> + */
> +bool igt_sriov_disable_driver_autoprobe(int pf)
> +{
> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
> +}
> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
> new file mode 100644
> index 000000000..f2c5c44fa
> --- /dev/null
> +++ b/lib/igt_sriov_device.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#ifndef __IGT_SRIOV_DEVICE_H__
> +#define __IGT_SRIOV_DEVICE_H__
> +
> +#include <stdint.h>
> +
> +bool igt_sriov_is_pf(int device);
> +unsigned int igt_sriov_get_total_vfs(int pf);
> +unsigned int igt_sriov_get_enabled_vfs(int pf);
> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
> +bool igt_sriov_disable_vfs(int pf);
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
> +bool igt_sriov_enable_driver_autoprobe(int pf);
> +bool igt_sriov_disable_driver_autoprobe(int pf);
nit: I'm wondering if there is any pattern to have:
a) void function that has igt_assert() inside
b) bool function that has no igt_assert() inside
then for writing scenario you just use a) without need to check
and use b) only when doing lower level testing and use dedicated checks
> +
> +#endif /* __IGT_SRIOV_DEVICE_H__ */
> diff --git a/lib/meson.build b/lib/meson.build
> index a7bccafc3..083baa68a 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -38,6 +38,7 @@ lib_sources = [
> 'igt_primes.c',
> 'igt_pci.c',
> 'igt_rand.c',
> + 'igt_sriov_device.c',
> 'igt_stats.c',
> 'igt_syncobj.c',
> 'igt_sysfs.c',
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-09 6:51 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
@ 2023-11-09 6:51 ` Lukasz Laguna
2023-11-09 11:57 ` Kamil Konieczny
0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-09 6:51 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
lib/igt_sriov_device.c | 176 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 20 +++++
lib/meson.build | 1 +
3 files changed, 197 insertions(+)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
new file mode 100644
index 000000000..c7338d13a
--- /dev/null
+++ b/lib/igt_sriov_device.c
@@ -0,0 +1,176 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+#include "igt_sysfs.h"
+
+/**
+ * igt_sriov_is_pf:
+ * @device: device file descriptor
+ *
+ * Check if device is PF by checking existence of sriov_totalvfs file
+ * and non-zero value read from that file.
+ *
+ * Returns:
+ * True if device is PF, false otherwise.
+ */
+bool igt_sriov_is_pf(int device)
+{
+ int sysfs;
+ bool ret;
+ uint32_t totalvfs;
+
+ sysfs = igt_sysfs_open(device);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
+ close(sysfs);
+
+ if (!ret)
+ return false;
+
+ return totalvfs > 0;
+}
+
+static uint32_t __pf_attr_get_u32(int pf, const char *attr)
+{
+ int sysfs;
+ uint32_t value;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ value = igt_sysfs_get_u32(sysfs, attr);
+ close(sysfs);
+
+ return value;
+}
+
+static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_set_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+/**
+ * igt_sriov_get_totalvfs:
+ * @pf: PF device file descriptor
+ *
+ * Get maximum number of VFs that can be enabled.
+ *
+ * Returns:
+ * Maximum number of VFs that could be associated with given PF.
+ */
+unsigned int igt_sriov_get_total_vfs(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
+}
+
+/**
+ * igt_sriov_get_numvfs:
+ * @pf: PF device file descriptor
+ *
+ * Get number of enabled VFs.
+ *
+ * Returns:
+ * Number of VFs enabled by given PF.
+ */
+unsigned int igt_sriov_get_enabled_vfs(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_numvfs");
+}
+
+/**
+ * igt_sriov_enable_vfs:
+ * @pf: PF device file descriptor
+ * @num_vfs: Number of virtual functions to be enabled
+ *
+ * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
+ * @pf device.
+ *
+ * Returns:
+ * True on success and false on failure.
+ */
+bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
+{
+ igt_assert(num_vfs > 0);
+ igt_debug("Enabling %u VFs\n", num_vfs);
+ return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
+}
+
+/**
+ * igt_sriov_disable_vfs:
+ * @pf: PF device file descriptor
+ *
+ * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
+ * device.
+ *
+ * Returns:
+ * True on success and false on failure.
+ */
+bool igt_sriov_disable_vfs(int pf)
+{
+ return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
+}
+
+/**
+ * igt_sriov_is_driver_autoprobe_enabled:
+ * @pf: PF device file descriptor
+ *
+ * Get current VF driver autoprobe setting.
+ *
+ * Returns:
+ * True if autoprobe is enabled, false otherwise.
+ */
+bool igt_sriov_is_driver_autoprobe_enabled(int pf)
+{
+ return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
+}
+
+/**
+ * igt_sriov_enable_driver_autoprobe:
+ * @pf: PF device file descriptor
+ *
+ * Set VF driver autoprobe to true.
+ *
+ * If successful, kernel will automatically bind VFs to a compatible driver
+ * immediately after they are enabled.
+ *
+ * Return:
+ * True if setting driver autoprobe succeed, otherwise false.
+ */
+bool igt_sriov_enable_driver_autoprobe(int pf)
+{
+ return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
+}
+
+/**
+ * igt_sriov_disable_driver_autoprobe:
+ * @pf: PF device file descriptor
+ *
+ * Set VF driver autoprobe to false.
+ *
+ * During VFs enabling driver won't be bound to VFs.
+ *
+ * Return:
+ * True if setting driver autoprobe succeed, otherwise false.
+ */
+bool igt_sriov_disable_driver_autoprobe(int pf)
+{
+ return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
new file mode 100644
index 000000000..f2c5c44fa
--- /dev/null
+++ b/lib/igt_sriov_device.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __IGT_SRIOV_DEVICE_H__
+#define __IGT_SRIOV_DEVICE_H__
+
+#include <stdint.h>
+
+bool igt_sriov_is_pf(int device);
+unsigned int igt_sriov_get_total_vfs(int pf);
+unsigned int igt_sriov_get_enabled_vfs(int pf);
+bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
+bool igt_sriov_disable_vfs(int pf);
+bool igt_sriov_is_driver_autoprobe_enabled(int pf);
+bool igt_sriov_enable_driver_autoprobe(int pf);
+bool igt_sriov_disable_driver_autoprobe(int pf);
+
+#endif /* __IGT_SRIOV_DEVICE_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index a7bccafc3..083baa68a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -38,6 +38,7 @@ lib_sources = [
'igt_primes.c',
'igt_pci.c',
'igt_rand.c',
+ 'igt_sriov_device.c',
'igt_stats.c',
'igt_syncobj.c',
'igt_sysfs.c',
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-06 22:07 ` Michal Wajdeczko
@ 2023-11-09 6:55 ` Laguna, Lukasz
2023-11-10 19:22 ` Michal Wajdeczko
0 siblings, 1 reply; 24+ messages in thread
From: Laguna, Lukasz @ 2023-11-09 6:55 UTC (permalink / raw)
To: Michal Wajdeczko, igt-dev
On 11/6/2023 23:07, Michal Wajdeczko wrote:
>
> On 06.11.2023 20:59, Lukasz Laguna wrote:
>> From: Katarzyna Dec <katarzyna.dec@intel.com>
>>
>> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
>>
>> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
>> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>> ---
>> lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
>> lib/igt_sriov_device.h | 20 +++++
>> lib/meson.build | 1 +
>> 3 files changed, 195 insertions(+)
>> create mode 100644 lib/igt_sriov_device.c
>> create mode 100644 lib/igt_sriov_device.h
>>
>> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
>> new file mode 100644
>> index 000000000..7d53c2045
>> --- /dev/null
>> +++ b/lib/igt_sriov_device.c
>> @@ -0,0 +1,174 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>> + */
>> +
>> +#include "igt_core.h"
>> +#include "igt_sriov_device.h"
>> +#include "igt_sysfs.h"
>> +
>> +/**
>> + * igt_sriov_is_pf:
> nit: short function description missing, not required anymore?
Most of the IGT helpers don't have it and from what I see it's not added
for new helpers.
>
>> + * @device: device file descriptor
>> + *
>> + * Check if device is PF by checking existence of sriov_totalvfs file
>> + * and non-zero value read from that file.
> just to clarify/be precise, do you want to check here "device"
> capability or "driver" capability ?
>
> IIRC the PCI subsystem will set these attributes on the "PF device" even
> if attached "PF driver" does not provide required hook to enable VFs
> (and this is main purpose of being a "PF", no?)
Helper is for checking device capability. If device is not PF test will
skip, if driver doesn't provide required hook to enable VFstest will fail.
>
>> + *
>> + * Returns:
>> + * True if device is PF, false otherwise.
>> + */
>> +bool igt_sriov_is_pf(int device)
>> +{
>> + int sysfs;
>> + bool ret;
>> + uint32_t totalvfs;
> nit: we shouldn't specify width if not needed, maybe plain unsigned int
> will just work ? shame that there are no __igt_sysfs_get_uint()
>
>> +
>> + sysfs = igt_sysfs_open(device);
>> + igt_assert_fd(sysfs);
>> +
>> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
>> + close(sysfs);
>> +
>> + if (!ret)
>> + return false;
>> +
>> + return totalvfs > 0;
>> +}
>> +
>> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
>> +{
>> + int sysfs;
>> + uint32_t value;
>> +
>> + igt_assert(igt_sriov_is_pf(pf));
>> +
>> + sysfs = igt_sysfs_open(pf);
>> + igt_assert_fd(sysfs);
>> +
>> + value = igt_sysfs_get_u32(sysfs, attr);
>> + close(sysfs);
>> +
>> + return value;
>> +}
>> +
>> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
>> +{
>> + int sysfs;
>> + bool ret;
>> +
>> + igt_assert(igt_sriov_is_pf(pf));
>> +
>> + sysfs = igt_sysfs_open(pf);
>> + igt_assert_fd(sysfs);
>> +
>> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
>> + close(sysfs);
>> +
>> + return ret;
>> +}
>> +
>> +/**
>> + * igt_sriov_get_totalvfs:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get maximum number of VFs that can be enabled.
>> + *
>> + * Returns:
>> + * Maximum number of VFs that could be associated with given PF.
>> + */
>> +unsigned int igt_sriov_get_total_vfs(int pf)
>> +{
>> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
>> +}
>> +
>> +/**
>> + * igt_sriov_get_numvfs:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get number of enabled VFs.
>> + *
>> + * Returns:
>> + * Number of VFs enabled by given PF.
>> + */
>> +unsigned int igt_sriov_get_enabled_vfs(int pf)
>> +{
>> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
>> +}
>> +
>> +/**
>> + * igt_sriov_enable_vfs:
> Helper for VFs enabling
>
>> + * @pf: PF device file descriptor
>> + * @num_vfs: Number of virtual functions to be enabled
>> + *
>> + * Helper for VFs enabling.
> "This will try to enable VFs by writing @num_vfs to ...
Done
>
>> + *
>> + * Returns:
>> + * True on success and false on failure.
>> + */
>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
>> +{
>> + igt_assert(num_vfs > 0);
>> + igt_debug("Enabling %u VFs\n", num_vfs);
>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
>> +}
>> +
>> +/**
>> + * igt_sriov_disable_vfs:
> Helper for VFs disabling
>
>> + * @pf: PF device file descriptor
>> + *
>> + * Set 0 in sriov_numvfs file to disable VFs.
> "This will try to disable already enabled VFs by writing 0 to ...
Done
>
>> + *
>> + * Returns:
>> + * True on success and false on failure.
>> + */
>> +bool igt_sriov_disable_vfs(int pf)
>> +{
>> + igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
> this will trigger unnecessary "read" operation just for debug purposes,
> while in log you should already see "Enabling N VFs", so we know the N.
Done
>
>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
>> +}
>> +
>> +/**
>> + * igt_sriov_is_driver_autoprobe_enabled:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get current driver autoprobe setting.
> hmm, this is SRIOV driver autoprobe (or VF driver autoprobe for
> short/clarity)
Done
>
>> + *
>> + * Returns:
>> + * True if autoprobe is enabled, false otherwise.
>> + */
>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
>> +{
>> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
>> +}
>> +
>> +/**
>> + * igt_sriov_enable_driver_autoprobe:
>> + * @pf: PF device file descriptor
>> + *
>> + * Set driver autoprobe to true.
>> + *
>> + * During VFs enabling driver will be bound to VFs.
> "If successful, then kernel will automatically bind VFs to a compatible
> driver immediately after they are enabled.
Done
>
>> + *
>> + * Return:
>> + * True if setting driver autoprobe succeed, otherwise false.
>> + */
>> +bool igt_sriov_enable_driver_autoprobe(int pf)
>> +{
>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
>> +}
>> +
>> +/**
>> + * igt_sriov_disable_driver_autoprobe:
>> + * @pf: PF device file descriptor
>> + *
>> + * Set driver autoprobe to false.
>> + *
>> + * During VFs enabling driver won't be bound to VFs.
>> + *
>> + * Return:
>> + * True if setting driver autoprobe succeed, otherwise false.
>> + */
>> +bool igt_sriov_disable_driver_autoprobe(int pf)
>> +{
>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
>> +}
>> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
>> new file mode 100644
>> index 000000000..f2c5c44fa
>> --- /dev/null
>> +++ b/lib/igt_sriov_device.h
>> @@ -0,0 +1,20 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>> + */
>> +
>> +#ifndef __IGT_SRIOV_DEVICE_H__
>> +#define __IGT_SRIOV_DEVICE_H__
>> +
>> +#include <stdint.h>
>> +
>> +bool igt_sriov_is_pf(int device);
>> +unsigned int igt_sriov_get_total_vfs(int pf);
>> +unsigned int igt_sriov_get_enabled_vfs(int pf);
>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
>> +bool igt_sriov_disable_vfs(int pf);
>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
>> +bool igt_sriov_enable_driver_autoprobe(int pf);
>> +bool igt_sriov_disable_driver_autoprobe(int pf);
> nit: I'm wondering if there is any pattern to have:
>
> a) void function that has igt_assert() inside
> b) bool function that has no igt_assert() inside
>
> then for writing scenario you just use a) without need to check
> and use b) only when doing lower level testing and use dedicated checks
Maybe we could use __ prefix for b), but I don't see a need for such
split TBH.
>
>> +
>> +#endif /* __IGT_SRIOV_DEVICE_H__ */
>> diff --git a/lib/meson.build b/lib/meson.build
>> index a7bccafc3..083baa68a 100644
>> --- a/lib/meson.build
>> +++ b/lib/meson.build
>> @@ -38,6 +38,7 @@ lib_sources = [
>> 'igt_primes.c',
>> 'igt_pci.c',
>> 'igt_rand.c',
>> + 'igt_sriov_device.c',
>> 'igt_stats.c',
>> 'igt_syncobj.c',
>> 'igt_sysfs.c',
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-09 6:51 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
@ 2023-11-09 11:57 ` Kamil Konieczny
2023-11-20 14:21 ` Laguna, Lukasz
0 siblings, 1 reply; 24+ messages in thread
From: Kamil Konieczny @ 2023-11-09 11:57 UTC (permalink / raw)
To: igt-dev
Hi Lukasz,
On 2023-11-09 at 07:51:40 +0100, Lukasz Laguna wrote:
> From: Katarzyna Dec <katarzyna.dec@intel.com>
>
> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
--------------------- ^^^^^^
Please decipher here what that shortcut means. It can help
also to add same comment in header.
>
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You should remove r-b and add some (or all) to Cc.
The same goes for all other patches in patchseries.
> ---
> lib/igt_sriov_device.c | 176 +++++++++++++++++++++++++++++++++++++++++
> lib/igt_sriov_device.h | 20 +++++
> lib/meson.build | 1 +
> 3 files changed, 197 insertions(+)
> create mode 100644 lib/igt_sriov_device.c
> create mode 100644 lib/igt_sriov_device.h
>
> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
> new file mode 100644
> index 000000000..c7338d13a
> --- /dev/null
> +++ b/lib/igt_sriov_device.c
> @@ -0,0 +1,176 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#include "igt_core.h"
> +#include "igt_sriov_device.h"
> +#include "igt_sysfs.h"
> +
> +/**
> + * igt_sriov_is_pf:
> + * @device: device file descriptor
> + *
> + * Check if device is PF by checking existence of sriov_totalvfs file
> + * and non-zero value read from that file.
> + *
> + * Returns:
> + * True if device is PF, false otherwise.
> + */
> +bool igt_sriov_is_pf(int device)
> +{
> + int sysfs;
> + bool ret;
> + uint32_t totalvfs;
> +
> + sysfs = igt_sysfs_open(device);
> + igt_assert_fd(sysfs);
This one assert makes sense even in __function
> +
> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
> + close(sysfs);
> +
> + if (!ret)
Add igt_debug here.
> + return false;
> +
> + return totalvfs > 0;
> +}
> +
> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
> +{
> + int sysfs;
> + uint32_t value;
> +
> + igt_assert(igt_sriov_is_pf(pf));
--- ^^^^^^^^^^^
The convention in igt is that __function useally do not assert,
so what about:
static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *val)
and return false on any error?
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + value = igt_sysfs_get_u32(sysfs, attr);
Better use
err = __igt_sysfs_get_u32(sysfs, attr, &value);
and in case of error print it with igt_debug
> + close(sysfs);
> +
> + return value;
> +}
> +
> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
> +{
> + int sysfs;
> + bool ret;
> +
> + igt_assert(igt_sriov_is_pf(pf));
In __function you should print error with igt_debug and return
false.
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
> + close(sysfs);
You can print igt_debug on error here.
> +
> + return ret;
> +}
> +
> +/**
> + * igt_sriov_get_totalvfs:
> + * @pf: PF device file descriptor
> + *
> + * Get maximum number of VFs that can be enabled.
> + *
> + * Returns:
> + * Maximum number of VFs that could be associated with given PF.
> + */
> +unsigned int igt_sriov_get_total_vfs(int pf)
> +{
Here you can assert on errors.
> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
> +}
> +
> +/**
> + * igt_sriov_get_numvfs:
> + * @pf: PF device file descriptor
> + *
> + * Get number of enabled VFs.
> + *
> + * Returns:
> + * Number of VFs enabled by given PF.
> + */
> +unsigned int igt_sriov_get_enabled_vfs(int pf)
> +{
> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
> +}
> +
> +/**
> + * igt_sriov_enable_vfs:
> + * @pf: PF device file descriptor
> + * @num_vfs: Number of virtual functions to be enabled
> + *
> + * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
> + * @pf device.
> + *
> + * Returns:
> + * True on success and false on failure.
> + */
> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
> +{
> + igt_assert(num_vfs > 0);
> + igt_debug("Enabling %u VFs\n", num_vfs);
Add newline before return.
> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
> +}
> +
> +/**
> + * igt_sriov_disable_vfs:
> + * @pf: PF device file descriptor
> + *
> + * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
> + * device.
> + *
> + * Returns:
> + * True on success and false on failure.
> + */
> +bool igt_sriov_disable_vfs(int pf)
> +{
> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
> +}
> +
> +/**
> + * igt_sriov_is_driver_autoprobe_enabled:
> + * @pf: PF device file descriptor
> + *
> + * Get current VF driver autoprobe setting.
> + *
> + * Returns:
> + * True if autoprobe is enabled, false otherwise.
> + */
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
> +{
> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
> +}
> +
> +/**
> + * igt_sriov_enable_driver_autoprobe:
> + * @pf: PF device file descriptor
> + *
> + * Set VF driver autoprobe to true.
> + *
> + * If successful, kernel will automatically bind VFs to a compatible driver
> + * immediately after they are enabled.
> + *
> + * Return:
> + * True if setting driver autoprobe succeed, otherwise false.
> + */
> +bool igt_sriov_enable_driver_autoprobe(int pf)
> +{
> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
> +}
> +
> +/**
> + * igt_sriov_disable_driver_autoprobe:
> + * @pf: PF device file descriptor
> + *
> + * Set VF driver autoprobe to false.
> + *
> + * During VFs enabling driver won't be bound to VFs.
> + *
> + * Return:
> + * True if setting driver autoprobe succeed, otherwise false.
> + */
> +bool igt_sriov_disable_driver_autoprobe(int pf)
> +{
> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
> +}
> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
> new file mode 100644
> index 000000000..f2c5c44fa
> --- /dev/null
> +++ b/lib/igt_sriov_device.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#ifndef __IGT_SRIOV_DEVICE_H__
> +#define __IGT_SRIOV_DEVICE_H__
> +
Put here comment what is SRIOV.
Regards,
Kamil
> +#include <stdint.h>
> +
> +bool igt_sriov_is_pf(int device);
> +unsigned int igt_sriov_get_total_vfs(int pf);
> +unsigned int igt_sriov_get_enabled_vfs(int pf);
> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
> +bool igt_sriov_disable_vfs(int pf);
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
> +bool igt_sriov_enable_driver_autoprobe(int pf);
> +bool igt_sriov_disable_driver_autoprobe(int pf);
> +
> +#endif /* __IGT_SRIOV_DEVICE_H__ */
> diff --git a/lib/meson.build b/lib/meson.build
> index a7bccafc3..083baa68a 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -38,6 +38,7 @@ lib_sources = [
> 'igt_primes.c',
> 'igt_pci.c',
> 'igt_rand.c',
> + 'igt_sriov_device.c',
> 'igt_stats.c',
> 'igt_syncobj.c',
> 'igt_sysfs.c',
> --
> 2.40.0
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-09 6:55 ` Laguna, Lukasz
@ 2023-11-10 19:22 ` Michal Wajdeczko
2023-11-17 14:34 ` Laguna, Lukasz
2023-11-20 14:26 ` Laguna, Lukasz
0 siblings, 2 replies; 24+ messages in thread
From: Michal Wajdeczko @ 2023-11-10 19:22 UTC (permalink / raw)
To: Laguna, Lukasz, igt-dev
On 09.11.2023 07:55, Laguna, Lukasz wrote:
>
> On 11/6/2023 23:07, Michal Wajdeczko wrote:
>>
>> On 06.11.2023 20:59, Lukasz Laguna wrote:
>>> From: Katarzyna Dec <katarzyna.dec@intel.com>
>>>
>>> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
>>>
>>> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
>>> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>>> ---
>>> lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
>>> lib/igt_sriov_device.h | 20 +++++
>>> lib/meson.build | 1 +
>>> 3 files changed, 195 insertions(+)
>>> create mode 100644 lib/igt_sriov_device.c
>>> create mode 100644 lib/igt_sriov_device.h
>>>
>>> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
>>> new file mode 100644
>>> index 000000000..7d53c2045
>>> --- /dev/null
>>> +++ b/lib/igt_sriov_device.c
>>> @@ -0,0 +1,174 @@
>>> +// SPDX-License-Identifier: MIT
>>> +/*
>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>> + */
>>> +
>>> +#include "igt_core.h"
>>> +#include "igt_sriov_device.h"
>>> +#include "igt_sysfs.h"
>>> +
>>> +/**
>>> + * igt_sriov_is_pf:
>> nit: short function description missing, not required anymore?
> Most of the IGT helpers don't have it and from what I see it's not added
> for new helpers.
so will ask in a different way: what documentation rules IGT is trying
to follow ? is it kernel style [1] or something else ?
for me it looks like a former, but maybe I'm missing something
[1]
https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation
>>
>>> + * @device: device file descriptor
>>> + *
>>> + * Check if device is PF by checking existence of sriov_totalvfs file
>>> + * and non-zero value read from that file.
>> just to clarify/be precise, do you want to check here "device"
>> capability or "driver" capability ?
>>
>> IIRC the PCI subsystem will set these attributes on the "PF device" even
>> if attached "PF driver" does not provide required hook to enable VFs
>> (and this is main purpose of being a "PF", no?)
> Helper is for checking device capability. If device is not PF test will
> skip, if driver doesn't provide required hook to enable VFstest will fail.
so if device is a PF but driver decides to not support VFs and decrease
sriov_totalvfs back to 0, what would this function tell us ?
>>
>>> + *
>>> + * Returns:
>>> + * True if device is PF, false otherwise.
>>> + */
>>> +bool igt_sriov_is_pf(int device)
>>> +{
>>> + int sysfs;
>>> + bool ret;
>>> + uint32_t totalvfs;
>> nit: we shouldn't specify width if not needed, maybe plain unsigned int
>> will just work ? shame that there are no __igt_sysfs_get_uint()
>>
>>> +
>>> + sysfs = igt_sysfs_open(device);
>>> + igt_assert_fd(sysfs);
>>> +
>>> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs",
>>> &totalvfs);
>>> + close(sysfs);
>>> +
>>> + if (!ret)
>>> + return false;
>>> +
>>> + return totalvfs > 0;
>>> +}
>>> +
>>> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
>>> +{
>>> + int sysfs;
>>> + uint32_t value;
>>> +
>>> + igt_assert(igt_sriov_is_pf(pf));
>>> +
>>> + sysfs = igt_sysfs_open(pf);
>>> + igt_assert_fd(sysfs);
>>> +
>>> + value = igt_sysfs_get_u32(sysfs, attr);
>>> + close(sysfs);
>>> +
>>> + return value;
>>> +}
>>> +
>>> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
>>> +{
>>> + int sysfs;
>>> + bool ret;
>>> +
>>> + igt_assert(igt_sriov_is_pf(pf));
>>> +
>>> + sysfs = igt_sysfs_open(pf);
>>> + igt_assert_fd(sysfs);
>>> +
>>> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
>>> + close(sysfs);
>>> +
>>> + return ret;
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_get_totalvfs:
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Get maximum number of VFs that can be enabled.
>>> + *
>>> + * Returns:
>>> + * Maximum number of VFs that could be associated with given PF.
>>> + */
>>> +unsigned int igt_sriov_get_total_vfs(int pf)
>>> +{
>>> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_get_numvfs:
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Get number of enabled VFs.
>>> + *
>>> + * Returns:
>>> + * Number of VFs enabled by given PF.
>>> + */
>>> +unsigned int igt_sriov_get_enabled_vfs(int pf)
>>> +{
>>> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_enable_vfs:
>> Helper for VFs enabling
>>
>>> + * @pf: PF device file descriptor
>>> + * @num_vfs: Number of virtual functions to be enabled
>>> + *
>>> + * Helper for VFs enabling.
>> "This will try to enable VFs by writing @num_vfs to ...
> Done
>>
>>> + *
>>> + * Returns:
>>> + * True on success and false on failure.
>>> + */
>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
>>> +{
>>> + igt_assert(num_vfs > 0);
>>> + igt_debug("Enabling %u VFs\n", num_vfs);
>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_disable_vfs:
>> Helper for VFs disabling
>>
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Set 0 in sriov_numvfs file to disable VFs.
>> "This will try to disable already enabled VFs by writing 0 to ...
> Done
>>
>>> + *
>>> + * Returns:
>>> + * True on success and false on failure.
>>> + */
>>> +bool igt_sriov_disable_vfs(int pf)
>>> +{
>>> + igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
>> this will trigger unnecessary "read" operation just for debug purposes,
>> while in log you should already see "Enabling N VFs", so we know the N.
> Done
>>
>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_is_driver_autoprobe_enabled:
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Get current driver autoprobe setting.
>> hmm, this is SRIOV driver autoprobe (or VF driver autoprobe for
>> short/clarity)
> Done
>>
>>> + *
>>> + * Returns:
>>> + * True if autoprobe is enabled, false otherwise.
>>> + */
>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
>>> +{
>>> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_enable_driver_autoprobe:
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Set driver autoprobe to true.
>>> + *
>>> + * During VFs enabling driver will be bound to VFs.
>> "If successful, then kernel will automatically bind VFs to a compatible
>> driver immediately after they are enabled.
> Done
>>
>>> + *
>>> + * Return:
>>> + * True if setting driver autoprobe succeed, otherwise false.
>>> + */
>>> +bool igt_sriov_enable_driver_autoprobe(int pf)
>>> +{
>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>> true);
>>> +}
>>> +
>>> +/**
>>> + * igt_sriov_disable_driver_autoprobe:
>>> + * @pf: PF device file descriptor
>>> + *
>>> + * Set driver autoprobe to false.
>>> + *
>>> + * During VFs enabling driver won't be bound to VFs.
>>> + *
>>> + * Return:
>>> + * True if setting driver autoprobe succeed, otherwise false.
>>> + */
>>> +bool igt_sriov_disable_driver_autoprobe(int pf)
>>> +{
>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>> false);
>>> +}
>>> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
>>> new file mode 100644
>>> index 000000000..f2c5c44fa
>>> --- /dev/null
>>> +++ b/lib/igt_sriov_device.h
>>> @@ -0,0 +1,20 @@
>>> +/* SPDX-License-Identifier: MIT */
>>> +/*
>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>> + */
>>> +
>>> +#ifndef __IGT_SRIOV_DEVICE_H__
>>> +#define __IGT_SRIOV_DEVICE_H__
>>> +
>>> +#include <stdint.h>
>>> +
>>> +bool igt_sriov_is_pf(int device);
>>> +unsigned int igt_sriov_get_total_vfs(int pf);
>>> +unsigned int igt_sriov_get_enabled_vfs(int pf);
>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
>>> +bool igt_sriov_disable_vfs(int pf);
>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
>>> +bool igt_sriov_enable_driver_autoprobe(int pf);
>>> +bool igt_sriov_disable_driver_autoprobe(int pf);
>> nit: I'm wondering if there is any pattern to have:
>>
>> a) void function that has igt_assert() inside
>> b) bool function that has no igt_assert() inside
>>
>> then for writing scenario you just use a) without need to check
>> and use b) only when doing lower level testing and use dedicated checks
> Maybe we could use __ prefix for b), but I don't see a need for such
> split TBH.
instead of repeating the code like:
+ igt_assert(igt_sriov_disable_driver_autoprobe(pf_fd));
+ igt_assert(!igt_sriov_is_driver_autoprobe_enabled(pf_fd));
+ igt_assert(igt_sriov_enable_vfs(pf_fd, num_vfs));
+ igt_assert_eq(num_vfs, igt_sriov_get_enabled_vfs(pf_fd));
+ igt_assert(igt_sriov_disable_vfs(pf_fd));
you will just write:
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, num_vfs);
+ igt_sriov_disable_vfs(pf_fd);
as asserts with required checks will be already inside
>>
>>> +
>>> +#endif /* __IGT_SRIOV_DEVICE_H__ */
>>> diff --git a/lib/meson.build b/lib/meson.build
>>> index a7bccafc3..083baa68a 100644
>>> --- a/lib/meson.build
>>> +++ b/lib/meson.build
>>> @@ -38,6 +38,7 @@ lib_sources = [
>>> 'igt_primes.c',
>>> 'igt_pci.c',
>>> 'igt_rand.c',
>>> + 'igt_sriov_device.c',
>>> 'igt_stats.c',
>>> 'igt_syncobj.c',
>>> 'igt_sysfs.c',
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-10 19:22 ` Michal Wajdeczko
@ 2023-11-17 14:34 ` Laguna, Lukasz
2023-11-20 14:26 ` Laguna, Lukasz
1 sibling, 0 replies; 24+ messages in thread
From: Laguna, Lukasz @ 2023-11-17 14:34 UTC (permalink / raw)
To: Michal Wajdeczko, igt-dev
On 11/10/2023 20:22, Michal Wajdeczko wrote:
>
> On 09.11.2023 07:55, Laguna, Lukasz wrote:
>> On 11/6/2023 23:07, Michal Wajdeczko wrote:
>>> On 06.11.2023 20:59, Lukasz Laguna wrote:
>>>> From: Katarzyna Dec <katarzyna.dec@intel.com>
>>>>
>>>> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
>>>>
>>>> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
>>>> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>>> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>>>> ---
>>>> lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
>>>> lib/igt_sriov_device.h | 20 +++++
>>>> lib/meson.build | 1 +
>>>> 3 files changed, 195 insertions(+)
>>>> create mode 100644 lib/igt_sriov_device.c
>>>> create mode 100644 lib/igt_sriov_device.h
>>>>
>>>> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
>>>> new file mode 100644
>>>> index 000000000..7d53c2045
>>>> --- /dev/null
>>>> +++ b/lib/igt_sriov_device.c
>>>> @@ -0,0 +1,174 @@
>>>> +// SPDX-License-Identifier: MIT
>>>> +/*
>>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>>> + */
>>>> +
>>>> +#include "igt_core.h"
>>>> +#include "igt_sriov_device.h"
>>>> +#include "igt_sysfs.h"
>>>> +
>>>> +/**
>>>> + * igt_sriov_is_pf:
>>> nit: short function description missing, not required anymore?
>> Most of the IGT helpers don't have it and from what I see it's not added
>> for new helpers.
> so will ask in a different way: what documentation rules IGT is trying
> to follow ? is it kernel style [1] or something else ?
>
> for me it looks like a former, but maybe I'm missing something
>
> [1]
> https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation
>
>>>> + * @device: device file descriptor
>>>> + *
>>>> + * Check if device is PF by checking existence of sriov_totalvfs file
>>>> + * and non-zero value read from that file.
>>> just to clarify/be precise, do you want to check here "device"
>>> capability or "driver" capability ?
>>>
>>> IIRC the PCI subsystem will set these attributes on the "PF device" even
>>> if attached "PF driver" does not provide required hook to enable VFs
>>> (and this is main purpose of being a "PF", no?)
>> Helper is for checking device capability. If device is not PF test will
>> skip, if driver doesn't provide required hook to enable VFstest will fail.
> so if device is a PF but driver decides to not support VFs and decrease
> sriov_totalvfs back to 0, what would this function tell us ?
If we consider such case then I can rename this helper to
igt_sriov_vfs_supported() and create separate one igt_sriov_is_pf() that
only checks if sriov_totalvfs exists. What do you think?
>
>>>> + *
>>>> + * Returns:
>>>> + * True if device is PF, false otherwise.
>>>> + */
>>>> +bool igt_sriov_is_pf(int device)
>>>> +{
>>>> + int sysfs;
>>>> + bool ret;
>>>> + uint32_t totalvfs;
>>> nit: we shouldn't specify width if not needed, maybe plain unsigned int
>>> will just work ? shame that there are no __igt_sysfs_get_uint()
>>>
>>>> +
>>>> + sysfs = igt_sysfs_open(device);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs",
>>>> &totalvfs);
>>>> + close(sysfs);
>>>> +
>>>> + if (!ret)
>>>> + return false;
>>>> +
>>>> + return totalvfs > 0;
>>>> +}
>>>> +
>>>> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
>>>> +{
>>>> + int sysfs;
>>>> + uint32_t value;
>>>> +
>>>> + igt_assert(igt_sriov_is_pf(pf));
>>>> +
>>>> + sysfs = igt_sysfs_open(pf);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + value = igt_sysfs_get_u32(sysfs, attr);
>>>> + close(sysfs);
>>>> +
>>>> + return value;
>>>> +}
>>>> +
>>>> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
>>>> +{
>>>> + int sysfs;
>>>> + bool ret;
>>>> +
>>>> + igt_assert(igt_sriov_is_pf(pf));
>>>> +
>>>> + sysfs = igt_sysfs_open(pf);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
>>>> + close(sysfs);
>>>> +
>>>> + return ret;
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_get_totalvfs:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get maximum number of VFs that can be enabled.
>>>> + *
>>>> + * Returns:
>>>> + * Maximum number of VFs that could be associated with given PF.
>>>> + */
>>>> +unsigned int igt_sriov_get_total_vfs(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_get_numvfs:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get number of enabled VFs.
>>>> + *
>>>> + * Returns:
>>>> + * Number of VFs enabled by given PF.
>>>> + */
>>>> +unsigned int igt_sriov_get_enabled_vfs(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_enable_vfs:
>>> Helper for VFs enabling
>>>
>>>> + * @pf: PF device file descriptor
>>>> + * @num_vfs: Number of virtual functions to be enabled
>>>> + *
>>>> + * Helper for VFs enabling.
>>> "This will try to enable VFs by writing @num_vfs to ...
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True on success and false on failure.
>>>> + */
>>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
>>>> +{
>>>> + igt_assert(num_vfs > 0);
>>>> + igt_debug("Enabling %u VFs\n", num_vfs);
>>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_disable_vfs:
>>> Helper for VFs disabling
>>>
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set 0 in sriov_numvfs file to disable VFs.
>>> "This will try to disable already enabled VFs by writing 0 to ...
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True on success and false on failure.
>>>> + */
>>>> +bool igt_sriov_disable_vfs(int pf)
>>>> +{
>>>> + igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
>>> this will trigger unnecessary "read" operation just for debug purposes,
>>> while in log you should already see "Enabling N VFs", so we know the N.
>> Done
>>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_is_driver_autoprobe_enabled:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get current driver autoprobe setting.
>>> hmm, this is SRIOV driver autoprobe (or VF driver autoprobe for
>>> short/clarity)
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True if autoprobe is enabled, false otherwise.
>>>> + */
>>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_enable_driver_autoprobe:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set driver autoprobe to true.
>>>> + *
>>>> + * During VFs enabling driver will be bound to VFs.
>>> "If successful, then kernel will automatically bind VFs to a compatible
>>> driver immediately after they are enabled.
>> Done
>>>> + *
>>>> + * Return:
>>>> + * True if setting driver autoprobe succeed, otherwise false.
>>>> + */
>>>> +bool igt_sriov_enable_driver_autoprobe(int pf)
>>>> +{
>>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>>> true);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_disable_driver_autoprobe:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set driver autoprobe to false.
>>>> + *
>>>> + * During VFs enabling driver won't be bound to VFs.
>>>> + *
>>>> + * Return:
>>>> + * True if setting driver autoprobe succeed, otherwise false.
>>>> + */
>>>> +bool igt_sriov_disable_driver_autoprobe(int pf)
>>>> +{
>>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>>> false);
>>>> +}
>>>> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
>>>> new file mode 100644
>>>> index 000000000..f2c5c44fa
>>>> --- /dev/null
>>>> +++ b/lib/igt_sriov_device.h
>>>> @@ -0,0 +1,20 @@
>>>> +/* SPDX-License-Identifier: MIT */
>>>> +/*
>>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>>> + */
>>>> +
>>>> +#ifndef __IGT_SRIOV_DEVICE_H__
>>>> +#define __IGT_SRIOV_DEVICE_H__
>>>> +
>>>> +#include <stdint.h>
>>>> +
>>>> +bool igt_sriov_is_pf(int device);
>>>> +unsigned int igt_sriov_get_total_vfs(int pf);
>>>> +unsigned int igt_sriov_get_enabled_vfs(int pf);
>>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
>>>> +bool igt_sriov_disable_vfs(int pf);
>>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
>>>> +bool igt_sriov_enable_driver_autoprobe(int pf);
>>>> +bool igt_sriov_disable_driver_autoprobe(int pf);
>>> nit: I'm wondering if there is any pattern to have:
>>>
>>> a) void function that has igt_assert() inside
>>> b) bool function that has no igt_assert() inside
>>>
>>> then for writing scenario you just use a) without need to check
>>> and use b) only when doing lower level testing and use dedicated checks
>> Maybe we could use __ prefix for b), but I don't see a need for such
>> split TBH.
> instead of repeating the code like:
>
> + igt_assert(igt_sriov_disable_driver_autoprobe(pf_fd));
> + igt_assert(!igt_sriov_is_driver_autoprobe_enabled(pf_fd));
> + igt_assert(igt_sriov_enable_vfs(pf_fd, num_vfs));
> + igt_assert_eq(num_vfs, igt_sriov_get_enabled_vfs(pf_fd));
> + igt_assert(igt_sriov_disable_vfs(pf_fd));
>
> you will just write:
>
> + igt_sriov_disable_driver_autoprobe(pf_fd);
> + igt_sriov_enable_vfs(pf_fd, num_vfs);
> + igt_sriov_disable_vfs(pf_fd);
>
> as asserts with required checks will be already inside
>
>>>> +
>>>> +#endif /* __IGT_SRIOV_DEVICE_H__ */
>>>> diff --git a/lib/meson.build b/lib/meson.build
>>>> index a7bccafc3..083baa68a 100644
>>>> --- a/lib/meson.build
>>>> +++ b/lib/meson.build
>>>> @@ -38,6 +38,7 @@ lib_sources = [
>>>> 'igt_primes.c',
>>>> 'igt_pci.c',
>>>> 'igt_rand.c',
>>>> + 'igt_sriov_device.c',
>>>> 'igt_stats.c',
>>>> 'igt_syncobj.c',
>>>> 'igt_sysfs.c',
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-20 14:14 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
@ 2023-11-20 14:14 ` Lukasz Laguna
0 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-20 14:14 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Create lib for core SR-IOV (Single Root I/O Virtualization) helpers
that allow to manage SR-IOV devices.
v2:
- change functions description (Michal)
v3:
- decipher SR-IOV shortcut in commit message (Kamil)
- add SR-IOV description in header file (Kamil)
- remove old r-b and add cc (Kamil)
- return bool result in functions prefixed with "__" (Kamil)
- add brief description in functions documentation (Michal)
- add asserts in helpers (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.c | 213 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 29 ++++++
lib/meson.build | 1 +
3 files changed, 243 insertions(+)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
new file mode 100644
index 000000000..c5c594c2c
--- /dev/null
+++ b/lib/igt_sriov_device.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include <errno.h>
+
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+#include "igt_sysfs.h"
+
+/**
+ * igt_sriov_is_pf - Check if device is PF
+ * @device: device file descriptor
+ *
+ * Determine if device is PF by checking existence of sriov_totalvfs file.
+ *
+ * Return:
+ * True if device is PF, false otherwise.
+ */
+bool igt_sriov_is_pf(int device)
+{
+ int sysfs;
+ bool ret;
+
+ sysfs = igt_sysfs_open(device);
+ igt_assert_fd(sysfs);
+
+ ret = igt_sysfs_has_attr(sysfs, "device/sriov_totalvfs");
+ close(sysfs);
+
+ return ret;
+}
+
+static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_get_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static uint32_t pf_attr_get_u32(int pf, const char *attr)
+{
+ uint32_t value;
+
+ igt_assert_f(__pf_attr_get_u32(pf, attr, &value),
+ "Failed to read %s attribute (%s)\n", attr, strerror(errno));
+
+ return value;
+}
+
+static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_set_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static void pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ igt_assert_f(__pf_attr_set_u32(pf, attr, value),
+ "Failed to write %u to %s attribute (%s)\n", value, attr, strerror(errno));
+}
+
+/**
+ * igt_sriov_vfs_supported - Check if VFs are supported
+ * @pf: PF device file descriptor
+ *
+ * Determine VFs support by checking if value of sriov_totalvfs attribute
+ * corresponding to @pf device is bigger than 0.
+ *
+ * Return:
+ * True if VFs are supported, false otherwise.
+ */
+bool igt_sriov_vfs_supported(int pf)
+{
+ uint32_t totalvfs;
+
+ if (!__pf_attr_get_u32(pf, "device/sriov_totalvfs", &totalvfs))
+ return false;
+
+ return totalvfs > 0;
+}
+
+/**
+ * igt_sriov_get_totalvfs - Get maximum number of VFs that can be enabled
+ * @pf: PF device file descriptor
+ *
+ * Maximum number of VFs that can be enabled is checked by reading
+ * sriov_totalvfs attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Maximum number of VFs that can be associated with given PF.
+ */
+unsigned int igt_sriov_get_total_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_totalvfs");
+}
+
+/**
+ * igt_sriov_get_numvfs - Get number of enabled VFs
+ * @pf: PF device file descriptor
+ *
+ * Number of enabled VFs is checked by reading sriov_numvfs attribute
+ * corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Number of VFs enabled by given PF.
+ */
+unsigned int igt_sriov_get_enabled_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_numvfs");
+}
+
+/**
+ * igt_sriov_enable_vfs - Enable VFs
+ * @pf: PF device file descriptor
+ * @num_vfs: Number of virtual functions to be enabled
+ *
+ * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
+ * @pf device.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
+{
+ igt_assert(num_vfs > 0);
+
+ igt_debug("Enabling %u VFs\n", num_vfs);
+ pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
+}
+
+/**
+ * igt_sriov_disable_vfs - Disable VFs
+ * @pf: PF device file descriptor
+ *
+ * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
+ * device.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_vfs(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
+}
+
+/**
+ * igt_sriov_is_driver_autoprobe_enabled - Get VF driver autoprobe setting
+ * @pf: PF device file descriptor
+ *
+ * Get current VF driver autoprobe setting by reading sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * True if autoprobe is enabled, false otherwise.
+ */
+bool igt_sriov_is_driver_autoprobe_enabled(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
+}
+
+/**
+ * igt_sriov_enable_driver_autoprobe - Enable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Enable VF driver autoprobe setting by writing 1 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * If successful, kernel will automatically bind VFs to a compatible driver
+ * immediately after they are enabled.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
+}
+
+/**
+ * igt_sriov_disable_driver_autoprobe - Disable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Disable VF driver autoprobe setting by writing 0 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * During VFs enabling driver won't be bound to VFs.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
new file mode 100644
index 000000000..337fdf84b
--- /dev/null
+++ b/lib/igt_sriov_device.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __IGT_SRIOV_DEVICE_H__
+#define __IGT_SRIOV_DEVICE_H__
+
+/* Library for managing SR-IOV (Single Root I/O Virtualization)
+ * devices.
+ *
+ * SR-IOV is a specification that allows a single PCIe physical
+ * device to appear as a physical function (PF) and multiple virtual
+ * functions (VFs) to the operating system.
+ */
+
+#include <stdint.h>
+
+bool igt_sriov_is_pf(int device);
+bool igt_sriov_vfs_supported(int pf);
+unsigned int igt_sriov_get_total_vfs(int pf);
+unsigned int igt_sriov_get_enabled_vfs(int pf);
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
+void igt_sriov_disable_vfs(int pf);
+bool igt_sriov_is_driver_autoprobe_enabled(int pf);
+void igt_sriov_enable_driver_autoprobe(int pf);
+void igt_sriov_disable_driver_autoprobe(int pf);
+
+#endif /* __IGT_SRIOV_DEVICE_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index a7bccafc3..083baa68a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -38,6 +38,7 @@ lib_sources = [
'igt_primes.c',
'igt_pci.c',
'igt_rand.c',
+ 'igt_sriov_device.c',
'igt_stats.c',
'igt_syncobj.c',
'igt_sysfs.c',
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-09 11:57 ` Kamil Konieczny
@ 2023-11-20 14:21 ` Laguna, Lukasz
0 siblings, 0 replies; 24+ messages in thread
From: Laguna, Lukasz @ 2023-11-20 14:21 UTC (permalink / raw)
To: Kamil Konieczny, igt-dev
On 11/9/2023 12:57, Kamil Konieczny wrote:
> Hi Lukasz,
> On 2023-11-09 at 07:51:40 +0100, Lukasz Laguna wrote:
>> From: Katarzyna Dec <katarzyna.dec@intel.com>
>>
>> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
> --------------------- ^^^^^^
> Please decipher here what that shortcut means. It can help
> also to add same comment in header.
Done
>
>> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
>> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
> - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> You should remove r-b and add some (or all) to Cc.
> The same goes for all other patches in patchseries.
Done
>
>> ---
>> lib/igt_sriov_device.c | 176 +++++++++++++++++++++++++++++++++++++++++
>> lib/igt_sriov_device.h | 20 +++++
>> lib/meson.build | 1 +
>> 3 files changed, 197 insertions(+)
>> create mode 100644 lib/igt_sriov_device.c
>> create mode 100644 lib/igt_sriov_device.h
>>
>> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
>> new file mode 100644
>> index 000000000..c7338d13a
>> --- /dev/null
>> +++ b/lib/igt_sriov_device.c
>> @@ -0,0 +1,176 @@
>> +// SPDX-License-Identifier: MIT
>> +/*
>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>> + */
>> +
>> +#include "igt_core.h"
>> +#include "igt_sriov_device.h"
>> +#include "igt_sysfs.h"
>> +
>> +/**
>> + * igt_sriov_is_pf:
>> + * @device: device file descriptor
>> + *
>> + * Check if device is PF by checking existence of sriov_totalvfs file
>> + * and non-zero value read from that file.
>> + *
>> + * Returns:
>> + * True if device is PF, false otherwise.
>> + */
>> +bool igt_sriov_is_pf(int device)
>> +{
>> + int sysfs;
>> + bool ret;
>> + uint32_t totalvfs;
>> +
>> + sysfs = igt_sysfs_open(device);
>> + igt_assert_fd(sysfs);
> This one assert makes sense even in __function
>
>> +
>> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs", &totalvfs);
>> + close(sysfs);
>> +
>> + if (!ret)
> Add igt_debug here.
Debug info is in __igt_sysfs_get_u32already.
>
>> + return false;
>> +
>> + return totalvfs > 0;
>> +}
>> +
>> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
>> +{
>> + int sysfs;
>> + uint32_t value;
>> +
>> + igt_assert(igt_sriov_is_pf(pf));
> --- ^^^^^^^^^^^
> The convention in igt is that __function useally do not assert,
> so what about:
>
> static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *val)
>
> and return false on any error?
>
>> +
>> + sysfs = igt_sysfs_open(pf);
>> + igt_assert_fd(sysfs);
>> +
>> + value = igt_sysfs_get_u32(sysfs, attr);
> Better use
> err = __igt_sysfs_get_u32(sysfs, attr, &value);
> and in case of error print it with igt_debug
I changed the code and used __igt_sysfs_get_u32() here to follow the
convention, but I left assert for igt_sriov_is_pf() as this helper is
dedicated for PF device and it shouldn't be called on different devices.
In such case I prefer to don't continue on a non-PF device and just assert.
>> + close(sysfs);
>> +
>> + return value;
>> +}
>> +
>> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
>> +{
>> + int sysfs;
>> + bool ret;
>> +
>> + igt_assert(igt_sriov_is_pf(pf));
> In __function you should print error with igt_debug and return
> false.
>
>> +
>> + sysfs = igt_sysfs_open(pf);
>> + igt_assert_fd(sysfs);
>> +
>> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
>> + close(sysfs);
> You can print igt_debug on error here.
>
>> +
>> + return ret;
>> +}
>> +
>> +/**
>> + * igt_sriov_get_totalvfs:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get maximum number of VFs that can be enabled.
>> + *
>> + * Returns:
>> + * Maximum number of VFs that could be associated with given PF.
>> + */
>> +unsigned int igt_sriov_get_total_vfs(int pf)
>> +{
> Here you can assert on errors.
Done
>
>> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
>> +}
>> +
>> +/**
>> + * igt_sriov_get_numvfs:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get number of enabled VFs.
>> + *
>> + * Returns:
>> + * Number of VFs enabled by given PF.
>> + */
>> +unsigned int igt_sriov_get_enabled_vfs(int pf)
>> +{
>> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
>> +}
>> +
>> +/**
>> + * igt_sriov_enable_vfs:
>> + * @pf: PF device file descriptor
>> + * @num_vfs: Number of virtual functions to be enabled
>> + *
>> + * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
>> + * @pf device.
>> + *
>> + * Returns:
>> + * True on success and false on failure.
>> + */
>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
>> +{
>> + igt_assert(num_vfs > 0);
>> + igt_debug("Enabling %u VFs\n", num_vfs);
> Add newline before return.
Done
>
>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
>> +}
>> +
>> +/**
>> + * igt_sriov_disable_vfs:
>> + * @pf: PF device file descriptor
>> + *
>> + * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
>> + * device.
>> + *
>> + * Returns:
>> + * True on success and false on failure.
>> + */
>> +bool igt_sriov_disable_vfs(int pf)
>> +{
>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
>> +}
>> +
>> +/**
>> + * igt_sriov_is_driver_autoprobe_enabled:
>> + * @pf: PF device file descriptor
>> + *
>> + * Get current VF driver autoprobe setting.
>> + *
>> + * Returns:
>> + * True if autoprobe is enabled, false otherwise.
>> + */
>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
>> +{
>> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
>> +}
>> +
>> +/**
>> + * igt_sriov_enable_driver_autoprobe:
>> + * @pf: PF device file descriptor
>> + *
>> + * Set VF driver autoprobe to true.
>> + *
>> + * If successful, kernel will automatically bind VFs to a compatible driver
>> + * immediately after they are enabled.
>> + *
>> + * Return:
>> + * True if setting driver autoprobe succeed, otherwise false.
>> + */
>> +bool igt_sriov_enable_driver_autoprobe(int pf)
>> +{
>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
>> +}
>> +
>> +/**
>> + * igt_sriov_disable_driver_autoprobe:
>> + * @pf: PF device file descriptor
>> + *
>> + * Set VF driver autoprobe to false.
>> + *
>> + * During VFs enabling driver won't be bound to VFs.
>> + *
>> + * Return:
>> + * True if setting driver autoprobe succeed, otherwise false.
>> + */
>> +bool igt_sriov_disable_driver_autoprobe(int pf)
>> +{
>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
>> +}
>> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
>> new file mode 100644
>> index 000000000..f2c5c44fa
>> --- /dev/null
>> +++ b/lib/igt_sriov_device.h
>> @@ -0,0 +1,20 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>> + */
>> +
>> +#ifndef __IGT_SRIOV_DEVICE_H__
>> +#define __IGT_SRIOV_DEVICE_H__
>> +
> Put here comment what is SRIOV.
Done
>
> Regards,
> Kamil
>
>> +#include <stdint.h>
>> +
>> +bool igt_sriov_is_pf(int device);
>> +unsigned int igt_sriov_get_total_vfs(int pf);
>> +unsigned int igt_sriov_get_enabled_vfs(int pf);
>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
>> +bool igt_sriov_disable_vfs(int pf);
>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
>> +bool igt_sriov_enable_driver_autoprobe(int pf);
>> +bool igt_sriov_disable_driver_autoprobe(int pf);
>> +
>> +#endif /* __IGT_SRIOV_DEVICE_H__ */
>> diff --git a/lib/meson.build b/lib/meson.build
>> index a7bccafc3..083baa68a 100644
>> --- a/lib/meson.build
>> +++ b/lib/meson.build
>> @@ -38,6 +38,7 @@ lib_sources = [
>> 'igt_primes.c',
>> 'igt_pci.c',
>> 'igt_rand.c',
>> + 'igt_sriov_device.c',
>> 'igt_stats.c',
>> 'igt_syncobj.c',
>> 'igt_sysfs.c',
>> --
>> 2.40.0
>>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-10 19:22 ` Michal Wajdeczko
2023-11-17 14:34 ` Laguna, Lukasz
@ 2023-11-20 14:26 ` Laguna, Lukasz
1 sibling, 0 replies; 24+ messages in thread
From: Laguna, Lukasz @ 2023-11-20 14:26 UTC (permalink / raw)
To: Michal Wajdeczko, igt-dev
On 11/10/2023 20:22, Michal Wajdeczko wrote:
>
> On 09.11.2023 07:55, Laguna, Lukasz wrote:
>> On 11/6/2023 23:07, Michal Wajdeczko wrote:
>>> On 06.11.2023 20:59, Lukasz Laguna wrote:
>>>> From: Katarzyna Dec <katarzyna.dec@intel.com>
>>>>
>>>> Create lib for core SR-IOV helpers that allow to manage SR-IOV devices.
>>>>
>>>> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
>>>> Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>>> Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
>>>> ---
>>>> lib/igt_sriov_device.c | 174 +++++++++++++++++++++++++++++++++++++++++
>>>> lib/igt_sriov_device.h | 20 +++++
>>>> lib/meson.build | 1 +
>>>> 3 files changed, 195 insertions(+)
>>>> create mode 100644 lib/igt_sriov_device.c
>>>> create mode 100644 lib/igt_sriov_device.h
>>>>
>>>> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
>>>> new file mode 100644
>>>> index 000000000..7d53c2045
>>>> --- /dev/null
>>>> +++ b/lib/igt_sriov_device.c
>>>> @@ -0,0 +1,174 @@
>>>> +// SPDX-License-Identifier: MIT
>>>> +/*
>>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>>> + */
>>>> +
>>>> +#include "igt_core.h"
>>>> +#include "igt_sriov_device.h"
>>>> +#include "igt_sysfs.h"
>>>> +
>>>> +/**
>>>> + * igt_sriov_is_pf:
>>> nit: short function description missing, not required anymore?
>> Most of the IGT helpers don't have it and from what I see it's not added
>> for new helpers.
> so will ask in a different way: what documentation rules IGT is trying
> to follow ? is it kernel style [1] or something else ?
>
> for me it looks like a former, but maybe I'm missing something
>
> [1]
> https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#function-documentation
Done
>
>>>> + * @device: device file descriptor
>>>> + *
>>>> + * Check if device is PF by checking existence of sriov_totalvfs file
>>>> + * and non-zero value read from that file.
>>> just to clarify/be precise, do you want to check here "device"
>>> capability or "driver" capability ?
>>>
>>> IIRC the PCI subsystem will set these attributes on the "PF device" even
>>> if attached "PF driver" does not provide required hook to enable VFs
>>> (and this is main purpose of being a "PF", no?)
>> Helper is for checking device capability. If device is not PF test will
>> skip, if driver doesn't provide required hook to enable VFstest will fail.
> so if device is a PF but driver decides to not support VFs and decrease
> sriov_totalvfs back to 0, what would this function tell us ?
Done
>
>>>> + *
>>>> + * Returns:
>>>> + * True if device is PF, false otherwise.
>>>> + */
>>>> +bool igt_sriov_is_pf(int device)
>>>> +{
>>>> + int sysfs;
>>>> + bool ret;
>>>> + uint32_t totalvfs;
>>> nit: we shouldn't specify width if not needed, maybe plain unsigned int
>>> will just work ? shame that there are no __igt_sysfs_get_uint()
>>>
>>>> +
>>>> + sysfs = igt_sysfs_open(device);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + ret = __igt_sysfs_get_u32(sysfs, "device/sriov_totalvfs",
>>>> &totalvfs);
>>>> + close(sysfs);
>>>> +
>>>> + if (!ret)
>>>> + return false;
>>>> +
>>>> + return totalvfs > 0;
>>>> +}
>>>> +
>>>> +static uint32_t __pf_attr_get_u32(int pf, const char *attr)
>>>> +{
>>>> + int sysfs;
>>>> + uint32_t value;
>>>> +
>>>> + igt_assert(igt_sriov_is_pf(pf));
>>>> +
>>>> + sysfs = igt_sysfs_open(pf);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + value = igt_sysfs_get_u32(sysfs, attr);
>>>> + close(sysfs);
>>>> +
>>>> + return value;
>>>> +}
>>>> +
>>>> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
>>>> +{
>>>> + int sysfs;
>>>> + bool ret;
>>>> +
>>>> + igt_assert(igt_sriov_is_pf(pf));
>>>> +
>>>> + sysfs = igt_sysfs_open(pf);
>>>> + igt_assert_fd(sysfs);
>>>> +
>>>> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
>>>> + close(sysfs);
>>>> +
>>>> + return ret;
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_get_totalvfs:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get maximum number of VFs that can be enabled.
>>>> + *
>>>> + * Returns:
>>>> + * Maximum number of VFs that could be associated with given PF.
>>>> + */
>>>> +unsigned int igt_sriov_get_total_vfs(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_totalvfs");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_get_numvfs:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get number of enabled VFs.
>>>> + *
>>>> + * Returns:
>>>> + * Number of VFs enabled by given PF.
>>>> + */
>>>> +unsigned int igt_sriov_get_enabled_vfs(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_numvfs");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_enable_vfs:
>>> Helper for VFs enabling
>>>
>>>> + * @pf: PF device file descriptor
>>>> + * @num_vfs: Number of virtual functions to be enabled
>>>> + *
>>>> + * Helper for VFs enabling.
>>> "This will try to enable VFs by writing @num_vfs to ...
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True on success and false on failure.
>>>> + */
>>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
>>>> +{
>>>> + igt_assert(num_vfs > 0);
>>>> + igt_debug("Enabling %u VFs\n", num_vfs);
>>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_disable_vfs:
>>> Helper for VFs disabling
>>>
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set 0 in sriov_numvfs file to disable VFs.
>>> "This will try to disable already enabled VFs by writing 0 to ...
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True on success and false on failure.
>>>> + */
>>>> +bool igt_sriov_disable_vfs(int pf)
>>>> +{
>>>> + igt_debug("Disabling %u VFs\n", igt_sriov_get_enabled_vfs(pf));
>>> this will trigger unnecessary "read" operation just for debug purposes,
>>> while in log you should already see "Enabling N VFs", so we know the N.
>> Done
>>>> + return __pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_is_driver_autoprobe_enabled:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Get current driver autoprobe setting.
>>> hmm, this is SRIOV driver autoprobe (or VF driver autoprobe for
>>> short/clarity)
>> Done
>>>> + *
>>>> + * Returns:
>>>> + * True if autoprobe is enabled, false otherwise.
>>>> + */
>>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
>>>> +{
>>>> + return __pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_enable_driver_autoprobe:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set driver autoprobe to true.
>>>> + *
>>>> + * During VFs enabling driver will be bound to VFs.
>>> "If successful, then kernel will automatically bind VFs to a compatible
>>> driver immediately after they are enabled.
>> Done
>>>> + *
>>>> + * Return:
>>>> + * True if setting driver autoprobe succeed, otherwise false.
>>>> + */
>>>> +bool igt_sriov_enable_driver_autoprobe(int pf)
>>>> +{
>>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>>> true);
>>>> +}
>>>> +
>>>> +/**
>>>> + * igt_sriov_disable_driver_autoprobe:
>>>> + * @pf: PF device file descriptor
>>>> + *
>>>> + * Set driver autoprobe to false.
>>>> + *
>>>> + * During VFs enabling driver won't be bound to VFs.
>>>> + *
>>>> + * Return:
>>>> + * True if setting driver autoprobe succeed, otherwise false.
>>>> + */
>>>> +bool igt_sriov_disable_driver_autoprobe(int pf)
>>>> +{
>>>> + return __pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe",
>>>> false);
>>>> +}
>>>> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
>>>> new file mode 100644
>>>> index 000000000..f2c5c44fa
>>>> --- /dev/null
>>>> +++ b/lib/igt_sriov_device.h
>>>> @@ -0,0 +1,20 @@
>>>> +/* SPDX-License-Identifier: MIT */
>>>> +/*
>>>> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
>>>> + */
>>>> +
>>>> +#ifndef __IGT_SRIOV_DEVICE_H__
>>>> +#define __IGT_SRIOV_DEVICE_H__
>>>> +
>>>> +#include <stdint.h>
>>>> +
>>>> +bool igt_sriov_is_pf(int device);
>>>> +unsigned int igt_sriov_get_total_vfs(int pf);
>>>> +unsigned int igt_sriov_get_enabled_vfs(int pf);
>>>> +bool igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
>>>> +bool igt_sriov_disable_vfs(int pf);
>>>> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
>>>> +bool igt_sriov_enable_driver_autoprobe(int pf);
>>>> +bool igt_sriov_disable_driver_autoprobe(int pf);
>>> nit: I'm wondering if there is any pattern to have:
>>>
>>> a) void function that has igt_assert() inside
>>> b) bool function that has no igt_assert() inside
>>>
>>> then for writing scenario you just use a) without need to check
>>> and use b) only when doing lower level testing and use dedicated checks
>> Maybe we could use __ prefix for b), but I don't see a need for such
>> split TBH.
> instead of repeating the code like:
>
> + igt_assert(igt_sriov_disable_driver_autoprobe(pf_fd));
> + igt_assert(!igt_sriov_is_driver_autoprobe_enabled(pf_fd));
> + igt_assert(igt_sriov_enable_vfs(pf_fd, num_vfs));
> + igt_assert_eq(num_vfs, igt_sriov_get_enabled_vfs(pf_fd));
> + igt_assert(igt_sriov_disable_vfs(pf_fd));
>
> you will just write:
>
> + igt_sriov_disable_driver_autoprobe(pf_fd);
> + igt_sriov_enable_vfs(pf_fd, num_vfs);
> + igt_sriov_disable_vfs(pf_fd);
>
> as asserts with required checks will be already inside
Done. I added asserts to helpers. Non-asserting helpers can be added to
librarary when needed.
>
>>>> +
>>>> +#endif /* __IGT_SRIOV_DEVICE_H__ */
>>>> diff --git a/lib/meson.build b/lib/meson.build
>>>> index a7bccafc3..083baa68a 100644
>>>> --- a/lib/meson.build
>>>> +++ b/lib/meson.build
>>>> @@ -38,6 +38,7 @@ lib_sources = [
>>>> 'igt_primes.c',
>>>> 'igt_pci.c',
>>>> 'igt_rand.c',
>>>> + 'igt_sriov_device.c',
>>>> 'igt_stats.c',
>>>> 'igt_syncobj.c',
>>>> 'igt_sysfs.c',
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation
@ 2023-11-24 8:52 Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
` (10 more replies)
0 siblings, 11 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
Series introduces a basic SR-IOV test that validates VFs enabling in
different scenarios together with VF DRM driver binding. Implemented
library helpers rely on generic PCI device attributes defined in ABI.
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
Daniel Mrzyglod (1):
lib/igt_sriov_device: add helper for checking if VF DRM driver is
probed
Katarzyna Dec (4):
lib/igt_sriov_device: add core SR-IOV helpers
lib/igt_sriov_device: add helper for opening VF device
tests/sriov_basic: add basic tests for enabling SR-IOV VFs
tests/sriov_basic: validate driver binding to VFs
Lukasz Laguna (3):
lib/igt_sriov_device: add helpers for operations in different VFs
scenarios
lib/igt_sriov_device: add helpers for VF DRM driver bind and unbind
tests/sriov_basic: add more tests for VF driver binding
lib/drmtest.c | 17 ++-
lib/drmtest.h | 1 +
lib/igt_sriov_device.c | 340 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 74 +++++++++
lib/meson.build | 1 +
tests/meson.build | 1 +
tests/sriov_basic.c | 262 +++++++++++++++++++++++++++++++
7 files changed, 692 insertions(+), 4 deletions(-)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
create mode 100644 tests/sriov_basic.c
--
2.40.0
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_sriov_device: add helper for opening VF device Lukasz Laguna
` (9 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Create lib for core SR-IOV (Single Root I/O Virtualization) helpers
that allow to manage SR-IOV devices.
v2:
- change functions description (Michal)
v3:
- decipher SR-IOV shortcut in commit message (Kamil)
- add SR-IOV description in header file (Kamil)
- remove old r-b and add cc (Kamil)
- return bool result in functions prefixed with "__" (Kamil)
- add brief description in functions documentation (Michal)
- add asserts in helpers (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.c | 213 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 29 ++++++
lib/meson.build | 1 +
3 files changed, 243 insertions(+)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
new file mode 100644
index 000000000..c5c594c2c
--- /dev/null
+++ b/lib/igt_sriov_device.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include <errno.h>
+
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+#include "igt_sysfs.h"
+
+/**
+ * igt_sriov_is_pf - Check if device is PF
+ * @device: device file descriptor
+ *
+ * Determine if device is PF by checking existence of sriov_totalvfs file.
+ *
+ * Return:
+ * True if device is PF, false otherwise.
+ */
+bool igt_sriov_is_pf(int device)
+{
+ int sysfs;
+ bool ret;
+
+ sysfs = igt_sysfs_open(device);
+ igt_assert_fd(sysfs);
+
+ ret = igt_sysfs_has_attr(sysfs, "device/sriov_totalvfs");
+ close(sysfs);
+
+ return ret;
+}
+
+static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_get_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static uint32_t pf_attr_get_u32(int pf, const char *attr)
+{
+ uint32_t value;
+
+ igt_assert_f(__pf_attr_get_u32(pf, attr, &value),
+ "Failed to read %s attribute (%s)\n", attr, strerror(errno));
+
+ return value;
+}
+
+static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_set_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static void pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ igt_assert_f(__pf_attr_set_u32(pf, attr, value),
+ "Failed to write %u to %s attribute (%s)\n", value, attr, strerror(errno));
+}
+
+/**
+ * igt_sriov_vfs_supported - Check if VFs are supported
+ * @pf: PF device file descriptor
+ *
+ * Determine VFs support by checking if value of sriov_totalvfs attribute
+ * corresponding to @pf device is bigger than 0.
+ *
+ * Return:
+ * True if VFs are supported, false otherwise.
+ */
+bool igt_sriov_vfs_supported(int pf)
+{
+ uint32_t totalvfs;
+
+ if (!__pf_attr_get_u32(pf, "device/sriov_totalvfs", &totalvfs))
+ return false;
+
+ return totalvfs > 0;
+}
+
+/**
+ * igt_sriov_get_totalvfs - Get maximum number of VFs that can be enabled
+ * @pf: PF device file descriptor
+ *
+ * Maximum number of VFs that can be enabled is checked by reading
+ * sriov_totalvfs attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Maximum number of VFs that can be associated with given PF.
+ */
+unsigned int igt_sriov_get_total_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_totalvfs");
+}
+
+/**
+ * igt_sriov_get_numvfs - Get number of enabled VFs
+ * @pf: PF device file descriptor
+ *
+ * Number of enabled VFs is checked by reading sriov_numvfs attribute
+ * corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Number of VFs enabled by given PF.
+ */
+unsigned int igt_sriov_get_enabled_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_numvfs");
+}
+
+/**
+ * igt_sriov_enable_vfs - Enable VFs
+ * @pf: PF device file descriptor
+ * @num_vfs: Number of virtual functions to be enabled
+ *
+ * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
+ * @pf device.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
+{
+ igt_assert(num_vfs > 0);
+
+ igt_debug("Enabling %u VFs\n", num_vfs);
+ pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
+}
+
+/**
+ * igt_sriov_disable_vfs - Disable VFs
+ * @pf: PF device file descriptor
+ *
+ * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
+ * device.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_vfs(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
+}
+
+/**
+ * igt_sriov_is_driver_autoprobe_enabled - Get VF driver autoprobe setting
+ * @pf: PF device file descriptor
+ *
+ * Get current VF driver autoprobe setting by reading sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * True if autoprobe is enabled, false otherwise.
+ */
+bool igt_sriov_is_driver_autoprobe_enabled(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
+}
+
+/**
+ * igt_sriov_enable_driver_autoprobe - Enable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Enable VF driver autoprobe setting by writing 1 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * If successful, kernel will automatically bind VFs to a compatible driver
+ * immediately after they are enabled.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
+}
+
+/**
+ * igt_sriov_disable_driver_autoprobe - Disable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Disable VF driver autoprobe setting by writing 0 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * During VFs enabling driver won't be bound to VFs.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
new file mode 100644
index 000000000..337fdf84b
--- /dev/null
+++ b/lib/igt_sriov_device.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __IGT_SRIOV_DEVICE_H__
+#define __IGT_SRIOV_DEVICE_H__
+
+/* Library for managing SR-IOV (Single Root I/O Virtualization)
+ * devices.
+ *
+ * SR-IOV is a specification that allows a single PCIe physical
+ * device to appear as a physical function (PF) and multiple virtual
+ * functions (VFs) to the operating system.
+ */
+
+#include <stdint.h>
+
+bool igt_sriov_is_pf(int device);
+bool igt_sriov_vfs_supported(int pf);
+unsigned int igt_sriov_get_total_vfs(int pf);
+unsigned int igt_sriov_get_enabled_vfs(int pf);
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
+void igt_sriov_disable_vfs(int pf);
+bool igt_sriov_is_driver_autoprobe_enabled(int pf);
+void igt_sriov_enable_driver_autoprobe(int pf);
+void igt_sriov_disable_driver_autoprobe(int pf);
+
+#endif /* __IGT_SRIOV_DEVICE_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index a7bccafc3..083baa68a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -38,6 +38,7 @@ lib_sources = [
'igt_primes.c',
'igt_pci.c',
'igt_rand.c',
+ 'igt_sriov_device.c',
'igt_stats.c',
'igt_syncobj.c',
'igt_sysfs.c',
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 2/8] lib/igt_sriov_device: add helper for opening VF device
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_sriov_device: add helper for checking if VF DRM driver is probed Lukasz Laguna
` (8 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Helper opens DRM device node and returns its file descriptor.
v2:
- s/drm_open_device/__drm_open_device (Kamil)
- combine string with one go (Kamil)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/drmtest.c | 17 ++++++++++++----
lib/drmtest.h | 1 +
lib/igt_sriov_device.c | 46 ++++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 1 +
4 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/lib/drmtest.c b/lib/drmtest.c
index f0b97e362..8aa510695 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -245,7 +245,16 @@ static void log_opened_device_path(const char *device_path)
igt_info("Opened device: %s\n", item->path);
}
-static int open_device(const char *name, unsigned int chipset)
+/**
+ * __drm_open_device:
+ * @name: DRM node name
+ * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
+ *
+ * Open a drm legacy device node.
+ *
+ * Returns: DRM file descriptor or -1 on error
+ */
+int __drm_open_device(const char *name, unsigned int chipset)
{
const char *forced;
char dev_name[16] = "";
@@ -350,7 +359,7 @@ static int __search_and_open(const char *base, int offset, unsigned int chipset,
if (_is_already_opened(name, as_idx))
continue;
- fd = open_device(name, chipset);
+ fd = __drm_open_device(name, chipset);
if (fd != -1)
return fd;
}
@@ -392,13 +401,13 @@ static int __open_driver_exact(const char *name, unsigned int chipset)
{
int fd;
- fd = open_device(name, chipset);
+ fd = __drm_open_device(name, chipset);
if (fd != -1)
return fd;
drm_load_module(chipset);
- return open_device(name, chipset);
+ return __drm_open_device(name, chipset);
}
/*
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 909a0c12c..271a93e8b 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -98,6 +98,7 @@ void __set_forced_driver(const char *name);
*/
#define ALIGN_DOWN(x, a) ALIGN((x) - ((a) - 1), (a))
+int __drm_open_device(const char *name, unsigned int chipset);
void drm_load_module(unsigned int chipset);
int drm_open_driver(int chipset);
int drm_open_driver_master(int chipset);
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
index c5c594c2c..8e4d30b91 100644
--- a/lib/igt_sriov_device.c
+++ b/lib/igt_sriov_device.c
@@ -3,8 +3,10 @@
* Copyright(c) 2023 Intel Corporation. All rights reserved.
*/
+#include <dirent.h>
#include <errno.h>
+#include "drmtest.h"
#include "igt_core.h"
#include "igt_sriov_device.h"
#include "igt_sysfs.h"
@@ -211,3 +213,47 @@ void igt_sriov_disable_driver_autoprobe(int pf)
{
pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
}
+
+/**
+ * igt_sriov_open_vf_drm_device - Open VF DRM device node
+ * @pf: PF device file descriptor
+ * @vf_num: VF number (1-based to identify single VF)
+ *
+ * Open DRM device node for given VF.
+ *
+ * Return:
+ * VF file descriptor or -1 on error.
+ */
+int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num)
+{
+ char dir_path[PATH_MAX], path[256], dev_name[16];
+ DIR *dir;
+ struct dirent *de;
+ bool found = false;
+
+ igt_assert(vf_num > 0);
+
+ if (!igt_sysfs_path(pf, path, sizeof(path)))
+ return -1;
+ /* vf_num is 1-based, but virtfn is 0-based */
+ snprintf(dir_path, sizeof(dir_path), "%s/device/virtfn%u/drm", path, vf_num - 1);
+
+ dir = opendir(dir_path);
+ if (!dir)
+ return -1;
+ while ((de = readdir(dir))) {
+ unsigned int card_num;
+
+ if (sscanf(de->d_name, "card%d", &card_num) == 1) {
+ snprintf(dev_name, sizeof(dev_name), "/dev/dri/card%u", card_num);
+ found = true;
+ break;
+ }
+ }
+ closedir(dir);
+
+ if (!found)
+ return -1;
+
+ return __drm_open_device(dev_name, DRIVER_ANY);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
index 337fdf84b..4e57f0dcb 100644
--- a/lib/igt_sriov_device.h
+++ b/lib/igt_sriov_device.h
@@ -25,5 +25,6 @@ void igt_sriov_disable_vfs(int pf);
bool igt_sriov_is_driver_autoprobe_enabled(int pf);
void igt_sriov_enable_driver_autoprobe(int pf);
void igt_sriov_disable_driver_autoprobe(int pf);
+int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num);
#endif /* __IGT_SRIOV_DEVICE_H__ */
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 3/8] lib/igt_sriov_device: add helper for checking if VF DRM driver is probed
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_sriov_device: add helper for opening VF device Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 4/8] lib/igt_sriov_device: add helpers for operations in different VFs scenarios Lukasz Laguna
` (7 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
From: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
Probe check is based on existence of the DRM subsystem attribute in
sysfs.
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.c | 29 +++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
index 8e4d30b91..051161096 100644
--- a/lib/igt_sriov_device.c
+++ b/lib/igt_sriov_device.c
@@ -257,3 +257,32 @@ int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num)
return __drm_open_device(dev_name, DRIVER_ANY);
}
+
+/**
+ * igt_sriov_is_vf_drm_driver_probed - Check if VF DRM driver is probed
+ * @pf: PF device file descriptor
+ * @vf_num: VF number (1-based to identify single VF)
+ *
+ * Verify if DRM driver is bound to VF device. Probe check is based on
+ * existence of the DRM subsystem attribute in sysfs.
+ *
+ * Returns:
+ * True if VF has DRM driver loaded, false if not.
+ */
+bool igt_sriov_is_vf_drm_driver_probed(int pf, unsigned int vf_num)
+{
+ char path[PATH_MAX];
+ int sysfs;
+ bool ret;
+
+ igt_assert(vf_num > 0);
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+ /* vf_num is 1-based, but virtfn is 0-based */
+ snprintf(path, sizeof(path), "device/virtfn%u/drm", vf_num - 1);
+ ret = igt_sysfs_has_attr(sysfs, path);
+ close(sysfs);
+
+ return ret;
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
index 4e57f0dcb..84f033f52 100644
--- a/lib/igt_sriov_device.h
+++ b/lib/igt_sriov_device.h
@@ -26,5 +26,6 @@ bool igt_sriov_is_driver_autoprobe_enabled(int pf);
void igt_sriov_enable_driver_autoprobe(int pf);
void igt_sriov_disable_driver_autoprobe(int pf);
int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num);
+bool igt_sriov_is_vf_drm_driver_probed(int pf, unsigned int vf_num);
#endif /* __IGT_SRIOV_DEVICE_H__ */
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 4/8] lib/igt_sriov_device: add helpers for operations in different VFs scenarios
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (2 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_sriov_device: add helper for checking if VF DRM driver is probed Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 5/8] tests/sriov_basic: add basic tests for enabling SR-IOV VFs Lukasz Laguna
` (6 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
Added helpers:
- for_each_vf and for_each_num_vfs
- for_random_vf and for_random_num_vfs
- for_last_vf and for_max_num_vfs
v2:
- document helpers (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.h | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
index 84f033f52..3ab984720 100644
--- a/lib/igt_sriov_device.h
+++ b/lib/igt_sriov_device.h
@@ -28,4 +28,45 @@ void igt_sriov_disable_driver_autoprobe(int pf);
int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num);
bool igt_sriov_is_vf_drm_driver_probed(int pf, unsigned int vf_num);
+/**
+ * for_each_vf - Helper for running code on each VF
+ * @__pf_fd: PF device file descriptor
+ * @__vf_num: VFs iterator
+ *
+ * For loop that iterates over all VFs associated with given PF @__pf_fd.
+ */
+#define for_each_vf(__pf_fd, __vf_num) \
+ for (unsigned int __vf_num = 1, __total_vfs = igt_sriov_get_total_vfs(__pf_fd); \
+ __vf_num <= __total_vfs; \
+ ++__vf_num)
+#define for_each_num_vfs for_each_vf
+
+/**
+ * for_random_vf - Helper for running code on random VF
+ * @__pf_fd: PF device file descriptor
+ * @__vf_num: stores random VF
+ *
+ * Helper allows to run code using random VF number (stored in @__vf_num)
+ * picked from the range of all VFs associated with given PF @__pf_fd.
+ */
+#define for_random_vf(__pf_fd, __vf_num) \
+ for (unsigned int __vf_num = 1 + random() % igt_sriov_get_total_vfs(__pf_fd), __tmp = 0; \
+ __tmp < 1; \
+ ++__tmp)
+#define for_random_num_vfs for_random_vf
+
+/**
+ * for_last_vf - Helper for running code on last VF
+ * @__pf_fd: PF device file descriptor
+ * @__vf_num: stores last VF number
+ *
+ * Helper allows to run code using last VF number (stored in @__vf_num)
+ * associated with given PF @__pf_fd.
+ */
+#define for_last_vf(__pf_fd, __vf_num) \
+ for (unsigned int __vf_num = igt_sriov_get_total_vfs(__pf_fd), __tmp = 0; \
+ __tmp < 1; \
+ ++__tmp)
+#define for_max_num_vfs for_last_vf
+
#endif /* __IGT_SRIOV_DEVICE_H__ */
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 5/8] tests/sriov_basic: add basic tests for enabling SR-IOV VFs
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (3 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 4/8] lib/igt_sriov_device: add helpers for operations in different VFs scenarios Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 6/8] lib/igt_sriov_device: add helpers for VF DRM driver bind and unbind Lukasz Laguna
` (5 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Add subtests that validate SR-IOV VFs enabling in two variants: with
autoprobe disabled and enabled.
v2:
- rename function (Michal)
- remove checks that are outside the scope of the test (Michal)
v3:
- change run type of enable-vfs-autoprobe-on subtest (Michal)
- don't init random seed in test code (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
tests/meson.build | 1 +
tests/sriov_basic.c | 123 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+)
create mode 100644 tests/sriov_basic.c
diff --git a/tests/meson.build b/tests/meson.build
index 3e4d54601..928753098 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -71,6 +71,7 @@ test_progs = [
'panfrost_submit',
'prime_udl',
'prime_vgem',
+ 'sriov_basic',
'syncobj_basic',
'syncobj_eventfd',
'syncobj_wait',
diff --git a/tests/sriov_basic.c b/tests/sriov_basic.c
new file mode 100644
index 000000000..ce75f4198
--- /dev/null
+++ b/tests/sriov_basic.c
@@ -0,0 +1,123 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include "drmtest.h"
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+
+IGT_TEST_DESCRIPTION("Basic tests for enabling SR-IOV Virtual Functions");
+
+/**
+ * TEST: sriov_basic
+ * Category: Software building block
+ * Mega feature: SR-IOV
+ * Sub-category: VFs enabling
+ * Description: Validate SR-IOV VFs enabling
+ */
+
+/**
+ * SUBTEST: enable-vfs-autoprobe-off
+ * Description:
+ * Verify VFs enabling without probing VF driver
+ * Run type: BAT
+ */
+static void enable_vfs_autoprobe_off(int pf_fd, unsigned int num_vfs)
+{
+ igt_debug("Testing %u VFs\n", num_vfs);
+
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, num_vfs);
+ igt_assert_eq(num_vfs, igt_sriov_get_enabled_vfs(pf_fd));
+ igt_sriov_disable_vfs(pf_fd);
+}
+
+/**
+ * SUBTEST: enable-vfs-autoprobe-on
+ * Description:
+ * Verify VFs enabling and auto-probing VF driver
+ * Run type: FULL
+ */
+static void enable_vfs_autoprobe_on(int pf_fd, unsigned int num_vfs)
+{
+ bool err = false;
+
+ igt_debug("Testing %u VFs\n", num_vfs);
+
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+ igt_sriov_enable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, num_vfs);
+ igt_assert_eq(num_vfs, igt_sriov_get_enabled_vfs(pf_fd));
+ for (int vf_num = 1; vf_num <= num_vfs; ++vf_num) {
+ if (!igt_sriov_is_vf_drm_driver_probed(pf_fd, vf_num)) {
+ igt_debug("VF%u probe failed\n", vf_num);
+ err = true;
+ }
+ }
+ igt_sriov_disable_vfs(pf_fd);
+ igt_assert(!err);
+}
+
+igt_main
+{
+ int pf_fd;
+ bool autoprobe;
+
+ igt_fixture {
+ pf_fd = drm_open_driver(DRIVER_ANY);
+ igt_require(igt_sriov_is_pf(pf_fd));
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+ autoprobe = igt_sriov_is_driver_autoprobe_enabled(pf_fd);
+ }
+
+ igt_describe("Verify VFs enabling without probing VF driver");
+ igt_subtest_with_dynamic("enable-vfs-autoprobe-off") {
+ for_each_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-%u", num_vfs) {
+ enable_vfs_autoprobe_off(pf_fd, num_vfs);
+ }
+ }
+ for_random_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-random") {
+ enable_vfs_autoprobe_off(pf_fd, num_vfs);
+ }
+ }
+ for_max_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-all") {
+ enable_vfs_autoprobe_off(pf_fd, num_vfs);
+ }
+ }
+ }
+
+ igt_describe("Verify VFs enabling and auto-probing VF driver");
+ igt_subtest_with_dynamic("enable-vfs-autoprobe-on") {
+ for_each_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-%u", num_vfs) {
+ enable_vfs_autoprobe_on(pf_fd, num_vfs);
+ }
+ }
+ for_random_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-random") {
+ enable_vfs_autoprobe_on(pf_fd, num_vfs);
+ }
+ }
+ for_max_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-all") {
+ enable_vfs_autoprobe_on(pf_fd, num_vfs);
+ }
+ }
+ }
+
+ igt_fixture {
+ igt_sriov_disable_vfs(pf_fd);
+ /* abort to avoid execution of next tests with enabled VFs */
+ igt_abort_on_f(igt_sriov_get_enabled_vfs(pf_fd) > 0, "Failed to disable VF(s)");
+ autoprobe ? igt_sriov_enable_driver_autoprobe(pf_fd) :
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_abort_on_f(autoprobe != igt_sriov_is_driver_autoprobe_enabled(pf_fd),
+ "Failed to restore sriov_drivers_autoprobe value\n");
+ close(pf_fd);
+ }
+}
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 6/8] lib/igt_sriov_device: add helpers for VF DRM driver bind and unbind
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (4 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 5/8] tests/sriov_basic: add basic tests for enabling SR-IOV VFs Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 7/8] tests/sriov_basic: validate driver binding to VFs Lukasz Laguna
` (4 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
Helpers allow to bind and unbind a DRM driver for specified VF of a
given PF device.
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.c | 52 ++++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 2 ++
2 files changed, 54 insertions(+)
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
index 051161096..193d474fc 100644
--- a/lib/igt_sriov_device.c
+++ b/lib/igt_sriov_device.c
@@ -5,9 +5,11 @@
#include <dirent.h>
#include <errno.h>
+#include <pciaccess.h>
#include "drmtest.h"
#include "igt_core.h"
+#include "igt_device.h"
#include "igt_sriov_device.h"
#include "igt_sysfs.h"
@@ -286,3 +288,53 @@ bool igt_sriov_is_vf_drm_driver_probed(int pf, unsigned int vf_num)
return ret;
}
+
+static bool __igt_sriov_bind_vf_drm_driver(int pf, unsigned int vf_num, bool bind)
+{
+ int sysfs, ret;
+ struct pci_device *pci_dev;
+ char pci_slot[14];
+
+ igt_assert(vf_num > 0);
+
+ pci_dev = __igt_device_get_pci_device(pf, vf_num);
+ igt_assert_f(pci_dev, "No PCI device for given VF number: %d\n", vf_num);
+ sprintf(pci_slot, "%04x:%02x:%02x.%x",
+ pci_dev->domain_16, pci_dev->bus, pci_dev->dev, pci_dev->func);
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ igt_debug("vf_num: %u, pci_slot: %s\n", vf_num, pci_slot);
+ ret = igt_sysfs_set(sysfs, bind ? "device/driver/bind" : "device/driver/unbind", pci_slot);
+
+ close(sysfs);
+
+ return ret;
+}
+
+/**
+ * igt_sriov_bind_vf_drm_driver - Bind DRM driver to VF
+ * @pf: PF device file descriptor
+ * @vf_num: VF number (1-based to identify single VF)
+ *
+ * Bind the DRM driver to given VF.
+ * It asserts on failure.
+ */
+void igt_sriov_bind_vf_drm_driver(int pf, unsigned int vf_num)
+{
+ igt_assert(__igt_sriov_bind_vf_drm_driver(pf, vf_num, true));
+}
+
+/**
+ * igt_sriov_unbind_vf_drm_driver - Unbind DRM driver from VF
+ * @pf: PF device file descriptor
+ * @vf_num: VF number (1-based to identify single VF)
+ *
+ * Unbind the DRM driver from given VF.
+ * It asserts on failure.
+ */
+void igt_sriov_unbind_vf_drm_driver(int pf, unsigned int vf_num)
+{
+ igt_assert(__igt_sriov_bind_vf_drm_driver(pf, vf_num, false));
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
index 3ab984720..354beb23d 100644
--- a/lib/igt_sriov_device.h
+++ b/lib/igt_sriov_device.h
@@ -27,6 +27,8 @@ void igt_sriov_enable_driver_autoprobe(int pf);
void igt_sriov_disable_driver_autoprobe(int pf);
int igt_sriov_open_vf_drm_device(int pf, unsigned int vf_num);
bool igt_sriov_is_vf_drm_driver_probed(int pf, unsigned int vf_num);
+void igt_sriov_bind_vf_drm_driver(int pf, unsigned int vf_num);
+void igt_sriov_unbind_vf_drm_driver(int pf, unsigned int vf_num);
/**
* for_each_vf - Helper for running code on each VF
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 7/8] tests/sriov_basic: validate driver binding to VFs
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (5 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 6/8] lib/igt_sriov_device: add helpers for VF DRM driver bind and unbind Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 8/8] tests/sriov_basic: add more tests for VF driver binding Lukasz Laguna
` (3 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Test enables VFs in range <1..totalvfs>, bind driver to all of them and
then unbind driver from all of them.
v2:
- remove checks that are outside the scope of the test (Michal)
- change subtest run type (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
tests/sriov_basic.c | 49 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/tests/sriov_basic.c b/tests/sriov_basic.c
index ce75f4198..866bb88e4 100644
--- a/tests/sriov_basic.c
+++ b/tests/sriov_basic.c
@@ -60,6 +60,36 @@ static void enable_vfs_autoprobe_on(int pf_fd, unsigned int num_vfs)
igt_assert(!err);
}
+/**
+ * SUBTEST: enable-vfs-bind-all-unbind-all
+ * Description:
+ * Verify VFs enabling, binding the driver and then unbinding it from all of them
+ * Run type: FULL
+ */
+static void enable_vfs_bind_all_unbind_all(int pf_fd, unsigned int num_vfs)
+{
+ igt_debug("Testing %u VFs\n", num_vfs);
+
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, num_vfs);
+ igt_sriov_enable_driver_autoprobe(pf_fd);
+
+ for (int i = 1; i <= num_vfs; i++) {
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ igt_sriov_bind_vf_drm_driver(pf_fd, i);
+ igt_assert(igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ }
+
+ for (int i = 1; i <= num_vfs; i++) {
+ igt_sriov_unbind_vf_drm_driver(pf_fd, i);
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ }
+
+ igt_sriov_disable_vfs(pf_fd);
+}
+
igt_main
{
int pf_fd;
@@ -110,6 +140,25 @@ igt_main
}
}
+ igt_describe("Verify VFs enabling, binding the driver and then unbinding it from all of them");
+ igt_subtest_with_dynamic("enable-vfs-bind-all-unbind-all") {
+ for_each_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-%u", num_vfs) {
+ enable_vfs_bind_all_unbind_all(pf_fd, num_vfs);
+ }
+ }
+ for_random_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-random") {
+ enable_vfs_bind_all_unbind_all(pf_fd, num_vfs);
+ }
+ }
+ for_max_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-all") {
+ enable_vfs_bind_all_unbind_all(pf_fd, num_vfs);
+ }
+ }
+ }
+
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] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 8/8] tests/sriov_basic: add more tests for VF driver binding
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (6 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 7/8] tests/sriov_basic: validate driver binding to VFs Lukasz Laguna
@ 2023-11-24 8:52 ` Lukasz Laguna
2023-11-24 11:10 ` [igt-dev] ✓ Fi.CI.BAT: success for Initial SR-IOV validation (rev5) Patchwork
` (2 subsequent siblings)
10 siblings, 0 replies; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-24 8:52 UTC (permalink / raw)
To: igt-dev
- bind-unbind-vf: validate driver binding and unbinding to specified VF
- enable-vfs-bind-unbind-each: validate driver binding and unbinding to
VFs from specified range.
v2:
- remove checks that are outside the scope of the test (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
tests/sriov_basic.c | 90 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 90 insertions(+)
diff --git a/tests/sriov_basic.c b/tests/sriov_basic.c
index 866bb88e4..72541fe2f 100644
--- a/tests/sriov_basic.c
+++ b/tests/sriov_basic.c
@@ -90,6 +90,58 @@ static void enable_vfs_bind_all_unbind_all(int pf_fd, unsigned int num_vfs)
igt_sriov_disable_vfs(pf_fd);
}
+/**
+ * SUBTEST: enable-vfs-bind-unbind-each
+ * Description:
+ * Verify VFs enabling with binding and unbinding the driver one be one to each of them
+ * Run type: BAT
+ */
+static void enable_vfs_bind_unbind_each(int pf_fd, unsigned int num_vfs)
+{
+ igt_debug("Testing %u VFs\n", num_vfs);
+
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, num_vfs);
+ igt_sriov_enable_driver_autoprobe(pf_fd);
+
+ for (int i = 1; i <= num_vfs; i++) {
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ igt_sriov_bind_vf_drm_driver(pf_fd, i);
+ igt_assert(igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ igt_sriov_unbind_vf_drm_driver(pf_fd, i);
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, i));
+ }
+
+ igt_sriov_disable_vfs(pf_fd);
+}
+
+/**
+ * SUBTEST: bind-unbind-vf
+ * Description:
+ * Verify binding and unbinding the driver to specific VF
+ * Run type: BAT
+ */
+static void bind_unbind_vf(int pf_fd, unsigned int vf_num)
+{
+ igt_debug("Testing VF%u\n", vf_num);
+
+ igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0);
+
+ igt_sriov_disable_driver_autoprobe(pf_fd);
+ igt_sriov_enable_vfs(pf_fd, vf_num);
+ igt_sriov_enable_driver_autoprobe(pf_fd);
+
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, vf_num));
+ igt_sriov_bind_vf_drm_driver(pf_fd, vf_num);
+ igt_assert(igt_sriov_is_vf_drm_driver_probed(pf_fd, vf_num));
+ igt_sriov_unbind_vf_drm_driver(pf_fd, vf_num);
+ igt_assert(!igt_sriov_is_vf_drm_driver_probed(pf_fd, vf_num));
+
+ igt_sriov_disable_vfs(pf_fd);
+}
+
igt_main
{
int pf_fd;
@@ -159,6 +211,44 @@ igt_main
}
}
+ igt_describe("Verify VFs enabling with binding and unbinding the driver one be one to each of them");
+ igt_subtest_with_dynamic("enable-vfs-bind-unbind-each") {
+ for_each_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-%u", num_vfs) {
+ enable_vfs_bind_unbind_each(pf_fd, num_vfs);
+ }
+ }
+ for_random_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-random") {
+ enable_vfs_bind_unbind_each(pf_fd, num_vfs);
+ }
+ }
+ for_max_num_vfs(pf_fd, num_vfs) {
+ igt_dynamic_f("numvfs-all") {
+ enable_vfs_bind_unbind_each(pf_fd, num_vfs);
+ }
+ }
+ }
+
+ igt_describe("Test binds and unbinds the driver to specific VF");
+ igt_subtest_with_dynamic("bind-unbind-vf") {
+ for_each_vf(pf_fd, vf) {
+ igt_dynamic_f("vf-%u", vf) {
+ bind_unbind_vf(pf_fd, vf);
+ }
+ }
+ for_random_vf(pf_fd, vf) {
+ igt_dynamic_f("vf-random") {
+ bind_unbind_vf(pf_fd, vf);
+ }
+ }
+ for_last_vf(pf_fd, vf) {
+ igt_dynamic_f("vf-last") {
+ bind_unbind_vf(pf_fd, vf);
+ }
+ }
+ }
+
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] 24+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for Initial SR-IOV validation (rev5)
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (7 preceding siblings ...)
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 8/8] tests/sriov_basic: add more tests for VF driver binding Lukasz Laguna
@ 2023-11-24 11:10 ` Patchwork
2023-11-24 12:16 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-11-25 14:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
10 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2023-11-24 11:10 UTC (permalink / raw)
To: Laguna, Lukasz; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 4658 bytes --]
== Series Details ==
Series: Initial SR-IOV validation (rev5)
URL : https://patchwork.freedesktop.org/series/126034/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_13920 -> IGTPW_10262
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
Participating hosts (38 -> 37)
------------------------------
Additional (1): fi-bsw-n3050
Missing (2): bat-dg2-9 fi-snb-2520m
Known issues
------------
Here are the changes found in IGTPW_10262 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_lmem_swapping@random-engines:
- fi-bsw-n3050: NOTRUN -> [SKIP][1] ([fdo#109271]) +14 other tests skip
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/fi-bsw-n3050/igt@gem_lmem_swapping@random-engines.html
* igt@i915_selftest@live@hangcheck:
- bat-adls-5: [PASS][2] -> [DMESG-WARN][3] ([i915#5591])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/bat-adls-5/igt@i915_selftest@live@hangcheck.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/bat-adls-5/igt@i915_selftest@live@hangcheck.html
* igt@i915_selftest@live@workarounds:
- bat-dg1-5: [PASS][4] -> [ABORT][5] ([i915#9413])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/bat-dg1-5/igt@i915_selftest@live@workarounds.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/bat-dg1-5/igt@i915_selftest@live@workarounds.html
* igt@kms_hdmi_inject@inject-audio:
- fi-bsw-n3050: NOTRUN -> [FAIL][6] ([IGT#152])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/fi-bsw-n3050/igt@kms_hdmi_inject@inject-audio.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence:
- bat-dg2-11: NOTRUN -> [SKIP][7] ([i915#1845] / [i915#9197])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/bat-dg2-11/igt@kms_pipe_crc_basic@read-crc-frame-sequence.html
#### Possible fixes ####
* igt@i915_selftest@live@gem_contexts:
- bat-mtlp-6: [DMESG-FAIL][8] ([i915#9579]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/bat-mtlp-6/igt@i915_selftest@live@gem_contexts.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/bat-mtlp-6/igt@i915_selftest@live@gem_contexts.html
* igt@kms_hdmi_inject@inject-audio:
- fi-kbl-guc: [FAIL][10] ([IGT#3]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/fi-kbl-guc/igt@kms_hdmi_inject@inject-audio.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [ABORT][12] ([i915#8668]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[IGT#152]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/152
[IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#5591]: https://gitlab.freedesktop.org/drm/intel/issues/5591
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#9197]: https://gitlab.freedesktop.org/drm/intel/issues/9197
[i915#9413]: https://gitlab.freedesktop.org/drm/intel/issues/9413
[i915#9579]: https://gitlab.freedesktop.org/drm/intel/issues/9579
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7601 -> IGTPW_10262
CI-20190529: 20190529
CI_DRM_13920: 278e4673d0a5f5cd5d0b585df88cbcb6d3afd0d8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10262: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
IGT_7601: 9c6e7f255724e327627be7c8ed30e23742e97386 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Testlist changes
----------------
+igt@sriov_basic@bind-unbind-vf
+igt@sriov_basic@enable-vfs-autoprobe-off
+igt@sriov_basic@enable-vfs-autoprobe-on
+igt@sriov_basic@enable-vfs-bind-all-unbind-all
+igt@sriov_basic@enable-vfs-bind-unbind-each
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
[-- Attachment #2: Type: text/html, Size: 5490 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] ✓ CI.xeBAT: success for Initial SR-IOV validation (rev5)
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (8 preceding siblings ...)
2023-11-24 11:10 ` [igt-dev] ✓ Fi.CI.BAT: success for Initial SR-IOV validation (rev5) Patchwork
@ 2023-11-24 12:16 ` Patchwork
2023-11-25 14:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
10 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2023-11-24 12:16 UTC (permalink / raw)
To: Laguna, Lukasz; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 5070 bytes --]
== Series Details ==
Series: Initial SR-IOV validation (rev5)
URL : https://patchwork.freedesktop.org/series/126034/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_7601_BAT -> XEIGTPW_10262_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (4 -> 4)
------------------------------
No changes in participating hosts
Known issues
------------
Here are the changes found in XEIGTPW_10262_BAT that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_cursor_legacy@basic-flip-before-cursor-atomic:
- bat-adlp-7: [PASS][1] -> [FAIL][2] ([i915#2346])
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-adlp-7/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-adlp-7/igt@kms_cursor_legacy@basic-flip-before-cursor-atomic.html
* igt@kms_flip@basic-flip-vs-wf_vblank@a-edp1:
- bat-adlp-7: [PASS][3] -> [FAIL][4] ([Intel XE#480]) +3 other tests fail
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@a-edp1.html
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@a-edp1.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-d-dp-3:
- bat-dg2-oem2: NOTRUN -> [FAIL][5] ([Intel XE#400] / [Intel XE#616])
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-d-dp-3.html
* igt@xe_exec_fault_mode@many-basic:
- bat-dg2-oem2: NOTRUN -> [SKIP][6] ([Intel XE#288]) +17 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@xe_exec_fault_mode@many-basic.html
#### Possible fixes ####
* igt@kms_pipe_crc_basic@hang-read-crc:
- bat-dg2-oem2: [INCOMPLETE][7] ([Intel XE#282] / [Intel XE#749]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-dg2-oem2/igt@kms_pipe_crc_basic@hang-read-crc.html
[8]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@kms_pipe_crc_basic@hang-read-crc.html
* igt@kms_pipe_crc_basic@hang-read-crc@pipe-a-dp-3:
- bat-dg2-oem2: [INCOMPLETE][9] ([Intel XE#282] / [Intel XE#545]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-dg2-oem2/igt@kms_pipe_crc_basic@hang-read-crc@pipe-a-dp-3.html
[10]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@kms_pipe_crc_basic@hang-read-crc@pipe-a-dp-3.html
#### Warnings ####
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12:
- bat-dg2-oem2: [TIMEOUT][11] ([Intel XE#430] / [Intel XE#530]) -> [FAIL][12] ([Intel XE#400] / [Intel XE#616])
[11]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12.html
[12]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-3:
- bat-dg2-oem2: [TIMEOUT][13] ([Intel XE#530]) -> [FAIL][14] ([Intel XE#400] / [Intel XE#616])
[13]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7601/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-3.html
[14]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12@pipe-b-dp-3.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[Intel XE#282]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/282
[Intel XE#288]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/288
[Intel XE#400]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/400
[Intel XE#430]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/430
[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524
[Intel XE#530]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/530
[Intel XE#545]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/545
[Intel XE#616]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/616
[Intel XE#749]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/749
[Intel XE#929]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/929
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
Build changes
-------------
* IGT: IGT_7601 -> IGTPW_10262
IGTPW_10262: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
IGT_7601: 9c6e7f255724e327627be7c8ed30e23742e97386 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-518-1832821c7e4c5bd24353183f060f1435b2eb7992: 1832821c7e4c5bd24353183f060f1435b2eb7992
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10262/index.html
[-- Attachment #2: Type: text/html, Size: 6085 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for Initial SR-IOV validation (rev5)
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
` (9 preceding siblings ...)
2023-11-24 12:16 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
@ 2023-11-25 14:06 ` Patchwork
10 siblings, 0 replies; 24+ messages in thread
From: Patchwork @ 2023-11-25 14:06 UTC (permalink / raw)
To: Laguna, Lukasz; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 59457 bytes --]
== Series Details ==
Series: Initial SR-IOV validation (rev5)
URL : https://patchwork.freedesktop.org/series/126034/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_13920_full -> IGTPW_10262_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_10262_full absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_10262_full, please notify your bug team (I915-ci-infra@lists.freedesktop.org) 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_10262/index.html
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_10262_full:
### IGT changes ###
#### Possible regressions ####
* igt@gem_softpin@evict-single-offset:
- shard-dg1: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg1-17/igt@gem_softpin@evict-single-offset.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-14/igt@gem_softpin@evict-single-offset.html
* {igt@sriov_basic@bind-unbind-vf} (NEW):
- shard-dg2: NOTRUN -> [SKIP][3] +3 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@sriov_basic@bind-unbind-vf.html
- shard-dg1: NOTRUN -> [SKIP][4] +4 other tests skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-12/igt@sriov_basic@bind-unbind-vf.html
* {igt@sriov_basic@enable-vfs-autoprobe-on} (NEW):
- shard-tglu: NOTRUN -> [SKIP][5] +4 other tests skip
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-8/igt@sriov_basic@enable-vfs-autoprobe-on.html
* {igt@sriov_basic@enable-vfs-bind-all-unbind-all} (NEW):
- shard-mtlp: NOTRUN -> [SKIP][6] +3 other tests skip
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@sriov_basic@enable-vfs-bind-all-unbind-all.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* {igt@i915_pm_rc6_residency@rc6-idle@gt0-vecs0}:
- shard-tglu: [FAIL][7] ([i915#3591]) -> [WARN][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-6/igt@i915_pm_rc6_residency@rc6-idle@gt0-vecs0.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@i915_pm_rc6_residency@rc6-idle@gt0-vecs0.html
New tests
---------
New tests have been introduced between CI_DRM_13920_full and IGTPW_10262_full:
### New IGT tests (5) ###
* igt@sriov_basic@bind-unbind-vf:
- Statuses : 6 skip(s)
- Exec time: [0.0] s
* igt@sriov_basic@enable-vfs-autoprobe-off:
- Statuses : 6 skip(s)
- Exec time: [0.0] s
* igt@sriov_basic@enable-vfs-autoprobe-on:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@sriov_basic@enable-vfs-bind-all-unbind-all:
- Statuses : 5 skip(s)
- Exec time: [0.0] s
* igt@sriov_basic@enable-vfs-bind-unbind-each:
- Statuses : 6 skip(s)
- Exec time: [0.0] s
Known issues
------------
Here are the changes found in IGTPW_10262_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@api_intel_bb@blit-reloc-keep-cache:
- shard-mtlp: NOTRUN -> [SKIP][9] ([i915#8411])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@api_intel_bb@blit-reloc-keep-cache.html
* igt@device_reset@cold-reset-bound:
- shard-dg2: NOTRUN -> [SKIP][10] ([i915#7701])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@device_reset@cold-reset-bound.html
* igt@device_reset@unbind-reset-rebind:
- shard-dg2: [PASS][11] -> [INCOMPLETE][12] ([i915#5507])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg2-5/igt@device_reset@unbind-reset-rebind.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@device_reset@unbind-reset-rebind.html
* igt@drm_fdinfo@busy-idle@bcs0:
- shard-dg2: NOTRUN -> [SKIP][13] ([i915#8414]) +11 other tests skip
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@drm_fdinfo@busy-idle@bcs0.html
* igt@drm_fdinfo@most-busy-idle-check-all@ccs0:
- shard-mtlp: NOTRUN -> [SKIP][14] ([i915#8414]) +11 other tests skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@drm_fdinfo@most-busy-idle-check-all@ccs0.html
* igt@gem_busy@semaphore:
- shard-mtlp: NOTRUN -> [SKIP][15] ([i915#3936])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@gem_busy@semaphore.html
* igt@gem_close_race@multigpu-basic-process:
- shard-snb: NOTRUN -> [SKIP][16] ([fdo#109271]) +75 other tests skip
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb1/igt@gem_close_race@multigpu-basic-process.html
- shard-dg2: NOTRUN -> [SKIP][17] ([i915#7697])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_close_race@multigpu-basic-process.html
* igt@gem_create@create-ext-cpu-access-big:
- shard-dg2: NOTRUN -> [INCOMPLETE][18] ([i915#9364])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@gem_create@create-ext-cpu-access-big.html
* igt@gem_create@create-ext-set-pat:
- shard-dg2: NOTRUN -> [SKIP][19] ([i915#8562])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@gem_create@create-ext-set-pat.html
* igt@gem_ctx_persistence@heartbeat-hang:
- shard-mtlp: NOTRUN -> [SKIP][20] ([i915#8555])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-4/igt@gem_ctx_persistence@heartbeat-hang.html
* igt@gem_ctx_persistence@legacy-engines-cleanup:
- shard-snb: NOTRUN -> [SKIP][21] ([fdo#109271] / [i915#1099])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb1/igt@gem_ctx_persistence@legacy-engines-cleanup.html
* igt@gem_ctx_sseu@invalid-sseu:
- shard-dg2: NOTRUN -> [SKIP][22] ([i915#280])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@gem_ctx_sseu@invalid-sseu.html
* igt@gem_eio@hibernate:
- shard-tglu: [PASS][23] -> [ABORT][24] ([i915#7975] / [i915#8213] / [i915#8398])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-3/igt@gem_eio@hibernate.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-10/igt@gem_eio@hibernate.html
- shard-dg2: NOTRUN -> [ABORT][25] ([i915#7975] / [i915#8213])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@gem_eio@hibernate.html
* igt@gem_eio@in-flight-suspend:
- shard-mtlp: [PASS][26] -> [ABORT][27] ([i915#7892] / [i915#9414])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-8/igt@gem_eio@in-flight-suspend.html
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@gem_eio@in-flight-suspend.html
* igt@gem_exec_balancer@invalid-bonds:
- shard-dg2: NOTRUN -> [SKIP][28] ([i915#4036])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@gem_exec_balancer@invalid-bonds.html
* igt@gem_exec_balancer@noheartbeat:
- shard-dg2: NOTRUN -> [SKIP][29] ([i915#8555]) +1 other test skip
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@gem_exec_balancer@noheartbeat.html
* igt@gem_exec_capture@capture-invisible@lmem0:
- shard-dg2: NOTRUN -> [SKIP][30] ([i915#6334]) +1 other test skip
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_exec_capture@capture-invisible@lmem0.html
* igt@gem_exec_capture@many-4k-incremental:
- shard-dg2: NOTRUN -> [FAIL][31] ([i915#9606])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@gem_exec_capture@many-4k-incremental.html
* igt@gem_exec_fair@basic-none-rrul:
- shard-mtlp: NOTRUN -> [SKIP][32] ([i915#4473] / [i915#4771]) +2 other tests skip
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-1/igt@gem_exec_fair@basic-none-rrul.html
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-tglu: [PASS][33] -> [FAIL][34] ([i915#2842]) +1 other test fail
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-3/igt@gem_exec_fair@basic-pace-share@rcs0.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-7/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@gem_exec_fence@concurrent:
- shard-mtlp: NOTRUN -> [SKIP][35] ([i915#4812])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@gem_exec_fence@concurrent.html
* igt@gem_exec_fence@submit:
- shard-dg2: NOTRUN -> [SKIP][36] ([i915#4812])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_exec_fence@submit.html
* igt@gem_exec_flush@basic-wb-prw-default:
- shard-dg2: NOTRUN -> [SKIP][37] ([i915#3539] / [i915#4852]) +2 other tests skip
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@gem_exec_flush@basic-wb-prw-default.html
* igt@gem_exec_params@secure-non-root:
- shard-dg2: NOTRUN -> [SKIP][38] ([fdo#112283])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@gem_exec_params@secure-non-root.html
* igt@gem_exec_reloc@basic-gtt-read:
- shard-dg2: NOTRUN -> [SKIP][39] ([i915#3281]) +10 other tests skip
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_exec_reloc@basic-gtt-read.html
* igt@gem_exec_reloc@basic-write-cpu-noreloc:
- shard-mtlp: NOTRUN -> [SKIP][40] ([i915#3281]) +4 other tests skip
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-4/igt@gem_exec_reloc@basic-write-cpu-noreloc.html
* igt@gem_exec_schedule@preempt-queue-chain:
- shard-mtlp: NOTRUN -> [SKIP][41] ([i915#4537] / [i915#4812])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-1/igt@gem_exec_schedule@preempt-queue-chain.html
* igt@gem_exec_schedule@preempt-queue-contexts-chain:
- shard-dg2: NOTRUN -> [SKIP][42] ([i915#4537] / [i915#4812])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_exec_schedule@preempt-queue-contexts-chain.html
* igt@gem_exec_whisper@basic-fds-priority-all:
- shard-tglu: [PASS][43] -> [INCOMPLETE][44] ([i915#6755] / [i915#7392])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-6/igt@gem_exec_whisper@basic-fds-priority-all.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-6/igt@gem_exec_whisper@basic-fds-priority-all.html
* igt@gem_fence_thrash@bo-copy:
- shard-dg2: NOTRUN -> [SKIP][45] ([i915#4860]) +2 other tests skip
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@gem_fence_thrash@bo-copy.html
* igt@gem_lmem_swapping@heavy-random:
- shard-glk: NOTRUN -> [SKIP][46] ([fdo#109271] / [i915#4613]) +1 other test skip
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk9/igt@gem_lmem_swapping@heavy-random.html
* igt@gem_lmem_swapping@parallel-random-verify-ccs:
- shard-mtlp: NOTRUN -> [SKIP][47] ([i915#4613]) +1 other test skip
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@gem_lmem_swapping@parallel-random-verify-ccs.html
* igt@gem_mmap_gtt@basic-write-read:
- shard-mtlp: NOTRUN -> [SKIP][48] ([i915#4077]) +9 other tests skip
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@gem_mmap_gtt@basic-write-read.html
* igt@gem_mmap_gtt@cpuset-big-copy-odd:
- shard-dg2: NOTRUN -> [SKIP][49] ([i915#4077]) +5 other tests skip
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@gem_mmap_gtt@cpuset-big-copy-odd.html
* igt@gem_mmap_wc@write-read-distinct:
- shard-dg2: NOTRUN -> [SKIP][50] ([i915#4083]) +2 other tests skip
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@gem_mmap_wc@write-read-distinct.html
* igt@gem_mmap_wc@write-wc-read-gtt:
- shard-mtlp: NOTRUN -> [SKIP][51] ([i915#4083]) +4 other tests skip
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@gem_mmap_wc@write-wc-read-gtt.html
* igt@gem_pread@exhaustion:
- shard-glk: NOTRUN -> [WARN][52] ([i915#2658])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk6/igt@gem_pread@exhaustion.html
* igt@gem_pread@snoop:
- shard-dg2: NOTRUN -> [SKIP][53] ([i915#3282]) +3 other tests skip
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@gem_pread@snoop.html
* igt@gem_pxp@create-protected-buffer:
- shard-dg2: NOTRUN -> [SKIP][54] ([i915#4270]) +2 other tests skip
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@gem_pxp@create-protected-buffer.html
* igt@gem_pxp@create-regular-buffer:
- shard-mtlp: NOTRUN -> [SKIP][55] ([i915#4270]) +2 other tests skip
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@gem_pxp@create-regular-buffer.html
* igt@gem_readwrite@beyond-eob:
- shard-mtlp: NOTRUN -> [SKIP][56] ([i915#3282]) +2 other tests skip
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@gem_readwrite@beyond-eob.html
* igt@gem_render_copy@y-tiled-ccs-to-y-tiled-mc-ccs:
- shard-mtlp: NOTRUN -> [SKIP][57] ([i915#8428]) +1 other test skip
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@gem_render_copy@y-tiled-ccs-to-y-tiled-mc-ccs.html
* igt@gem_set_tiling_vs_blt@tiled-to-tiled:
- shard-mtlp: NOTRUN -> [SKIP][58] ([i915#4079])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@gem_set_tiling_vs_blt@tiled-to-tiled.html
* igt@gem_set_tiling_vs_blt@untiled-to-tiled:
- shard-dg2: NOTRUN -> [SKIP][59] ([i915#4079]) +1 other test skip
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_set_tiling_vs_blt@untiled-to-tiled.html
* igt@gem_softpin@evict-snoop-interruptible:
- shard-dg2: NOTRUN -> [SKIP][60] ([i915#4885])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@gem_softpin@evict-snoop-interruptible.html
* igt@gem_userptr_blits@dmabuf-sync:
- shard-glk: NOTRUN -> [SKIP][61] ([fdo#109271] / [i915#3323])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk3/igt@gem_userptr_blits@dmabuf-sync.html
* igt@gem_userptr_blits@dmabuf-unsync:
- shard-tglu: NOTRUN -> [SKIP][62] ([i915#3297]) +1 other test skip
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-6/igt@gem_userptr_blits@dmabuf-unsync.html
* igt@gem_userptr_blits@invalid-mmap-offset-unsync:
- shard-dg2: NOTRUN -> [SKIP][63] ([i915#3297]) +2 other tests skip
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@gem_userptr_blits@invalid-mmap-offset-unsync.html
* igt@gem_userptr_blits@vma-merge:
- shard-dg2: NOTRUN -> [FAIL][64] ([i915#3318])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@gem_userptr_blits@vma-merge.html
* igt@gen7_exec_parse@basic-allocation:
- shard-mtlp: NOTRUN -> [SKIP][65] ([fdo#109289]) +2 other tests skip
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@gen7_exec_parse@basic-allocation.html
* igt@gen7_exec_parse@batch-without-end:
- shard-dg2: NOTRUN -> [SKIP][66] ([fdo#109289])
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@gen7_exec_parse@batch-without-end.html
* igt@gen9_exec_parse@batch-invalid-length:
- shard-mtlp: NOTRUN -> [SKIP][67] ([i915#2856])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@gen9_exec_parse@batch-invalid-length.html
* igt@gen9_exec_parse@batch-zero-length:
- shard-tglu: NOTRUN -> [SKIP][68] ([i915#2527] / [i915#2856])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-9/igt@gen9_exec_parse@batch-zero-length.html
* igt@gen9_exec_parse@shadow-peek:
- shard-dg2: NOTRUN -> [SKIP][69] ([i915#2856]) +3 other tests skip
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@gen9_exec_parse@shadow-peek.html
* igt@i915_module_load@reload-with-fault-injection:
- shard-mtlp: [PASS][70] -> [ABORT][71] ([i915#9697])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-7/igt@i915_module_load@reload-with-fault-injection.html
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-4/igt@i915_module_load@reload-with-fault-injection.html
* igt@i915_module_load@resize-bar:
- shard-mtlp: NOTRUN -> [SKIP][72] ([i915#6412])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@i915_module_load@resize-bar.html
* igt@i915_pipe_stress@stress-xrgb8888-ytiled:
- shard-dg2: NOTRUN -> [SKIP][73] ([i915#7091])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@i915_pipe_stress@stress-xrgb8888-ytiled.html
* igt@i915_pm_rps@min-max-config-idle:
- shard-dg2: NOTRUN -> [SKIP][74] ([i915#6621]) +1 other test skip
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@i915_pm_rps@min-max-config-idle.html
* igt@i915_pm_rps@thresholds@gt0:
- shard-dg2: NOTRUN -> [SKIP][75] ([i915#8925])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@i915_pm_rps@thresholds@gt0.html
* igt@i915_query@query-topology-coherent-slice-mask:
- shard-dg2: NOTRUN -> [SKIP][76] ([i915#6188])
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@i915_query@query-topology-coherent-slice-mask.html
* igt@i915_query@query-topology-unsupported:
- shard-mtlp: NOTRUN -> [SKIP][77] ([fdo#109302])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@i915_query@query-topology-unsupported.html
* igt@i915_selftest@mock@memory_region:
- shard-snb: NOTRUN -> [DMESG-WARN][78] ([i915#9311])
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb7/igt@i915_selftest@mock@memory_region.html
* igt@kms_addfb_basic@basic-x-tiled-legacy:
- shard-dg2: NOTRUN -> [SKIP][79] ([i915#4212])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@kms_addfb_basic@basic-x-tiled-legacy.html
* igt@kms_async_flips@crc@pipe-b-hdmi-a-1:
- shard-dg2: NOTRUN -> [FAIL][80] ([i915#8247]) +3 other tests fail
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_async_flips@crc@pipe-b-hdmi-a-1.html
* igt@kms_async_flips@crc@pipe-d-hdmi-a-4:
- shard-dg1: NOTRUN -> [FAIL][81] ([i915#8247]) +3 other tests fail
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-16/igt@kms_async_flips@crc@pipe-d-hdmi-a-4.html
* igt@kms_atomic_transition@plane-all-modeset-transition-fencing-internal-panels:
- shard-dg2: NOTRUN -> [SKIP][82] ([i915#1769] / [i915#3555])
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_atomic_transition@plane-all-modeset-transition-fencing-internal-panels.html
* igt@kms_big_fb@4-tiled-max-hw-stride-64bpp-rotate-0:
- shard-mtlp: [PASS][83] -> [FAIL][84] ([i915#5138])
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-7/igt@kms_big_fb@4-tiled-max-hw-stride-64bpp-rotate-0.html
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_big_fb@4-tiled-max-hw-stride-64bpp-rotate-0.html
* igt@kms_big_fb@x-tiled-32bpp-rotate-270:
- shard-dg2: NOTRUN -> [SKIP][85] ([fdo#111614]) +5 other tests skip
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_big_fb@x-tiled-32bpp-rotate-270.html
* igt@kms_big_fb@y-tiled-addfb-size-offset-overflow:
- shard-dg2: NOTRUN -> [SKIP][86] ([i915#5190]) +14 other tests skip
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_big_fb@y-tiled-addfb-size-offset-overflow.html
* igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
- shard-tglu: [PASS][87] -> [FAIL][88] ([i915#3743])
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-2/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-9/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
* igt@kms_big_fb@yf-tiled-addfb-size-offset-overflow:
- shard-tglu: NOTRUN -> [SKIP][89] ([fdo#111615])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-9/igt@kms_big_fb@yf-tiled-addfb-size-offset-overflow.html
* igt@kms_big_fb@yf-tiled-addfb-size-overflow:
- shard-mtlp: NOTRUN -> [SKIP][90] ([i915#6187]) +1 other test skip
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@kms_big_fb@yf-tiled-addfb-size-overflow.html
* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip:
- shard-dg2: NOTRUN -> [SKIP][91] ([i915#4538] / [i915#5190]) +4 other tests skip
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip.html
* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip:
- shard-mtlp: NOTRUN -> [SKIP][92] ([fdo#111615]) +6 other tests skip
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-180-hflip-async-flip.html
* igt@kms_cdclk@mode-transition@pipe-b-hdmi-a-1:
- shard-dg2: NOTRUN -> [SKIP][93] ([i915#4087] / [i915#7213]) +2 other tests skip
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_cdclk@mode-transition@pipe-b-hdmi-a-1.html
* igt@kms_cdclk@mode-transition@pipe-d-hdmi-a-1:
- shard-dg2: NOTRUN -> [SKIP][94] ([i915#7213])
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_cdclk@mode-transition@pipe-d-hdmi-a-1.html
* igt@kms_cdclk@plane-scaling@pipe-a-hdmi-a-2:
- shard-dg2: NOTRUN -> [SKIP][95] ([i915#4087]) +3 other tests skip
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_cdclk@plane-scaling@pipe-a-hdmi-a-2.html
* igt@kms_cdclk@plane-scaling@pipe-c-edp-1:
- shard-mtlp: NOTRUN -> [SKIP][96] ([i915#4087]) +3 other tests skip
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_cdclk@plane-scaling@pipe-c-edp-1.html
* igt@kms_chamelium_audio@hdmi-audio-edid:
- shard-mtlp: NOTRUN -> [SKIP][97] ([i915#7828]) +5 other tests skip
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@kms_chamelium_audio@hdmi-audio-edid.html
* igt@kms_chamelium_color@ctm-0-50:
- shard-dg2: NOTRUN -> [SKIP][98] ([fdo#111827]) +1 other test skip
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_chamelium_color@ctm-0-50.html
* igt@kms_chamelium_color@ctm-green-to-red:
- shard-mtlp: NOTRUN -> [SKIP][99] ([fdo#111827])
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_chamelium_color@ctm-green-to-red.html
* igt@kms_chamelium_color@ctm-negative:
- shard-glk: NOTRUN -> [SKIP][100] ([fdo#109271]) +108 other tests skip
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk8/igt@kms_chamelium_color@ctm-negative.html
* igt@kms_chamelium_frames@dp-frame-dump:
- shard-tglu: NOTRUN -> [SKIP][101] ([i915#7828])
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@kms_chamelium_frames@dp-frame-dump.html
* igt@kms_chamelium_hpd@dp-hpd-storm:
- shard-dg2: NOTRUN -> [SKIP][102] ([i915#7828]) +9 other tests skip
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_chamelium_hpd@dp-hpd-storm.html
* igt@kms_content_protection@atomic-dpms@pipe-a-dp-4:
- shard-dg2: NOTRUN -> [TIMEOUT][103] ([i915#7173])
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_content_protection@atomic-dpms@pipe-a-dp-4.html
* igt@kms_content_protection@dp-mst-lic-type-1:
- shard-dg2: NOTRUN -> [SKIP][104] ([i915#3299])
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@kms_content_protection@dp-mst-lic-type-1.html
* igt@kms_content_protection@lic:
- shard-dg2: NOTRUN -> [SKIP][105] ([i915#7118])
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_content_protection@lic.html
* igt@kms_content_protection@srm:
- shard-mtlp: NOTRUN -> [SKIP][106] ([i915#6944])
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-4/igt@kms_content_protection@srm.html
* igt@kms_cursor_crc@cursor-offscreen-512x512:
- shard-dg2: NOTRUN -> [SKIP][107] ([i915#3359]) +1 other test skip
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_cursor_crc@cursor-offscreen-512x512.html
* igt@kms_cursor_crc@cursor-onscreen-32x10:
- shard-mtlp: NOTRUN -> [SKIP][108] ([i915#3555] / [i915#8814]) +1 other test skip
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_cursor_crc@cursor-onscreen-32x10.html
* igt@kms_cursor_crc@cursor-sliding-32x10:
- shard-dg2: NOTRUN -> [SKIP][109] ([i915#3555]) +5 other tests skip
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_cursor_crc@cursor-sliding-32x10.html
* igt@kms_cursor_crc@cursor-sliding-512x170:
- shard-mtlp: NOTRUN -> [SKIP][110] ([i915#3359]) +1 other test skip
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@kms_cursor_crc@cursor-sliding-512x170.html
* igt@kms_cursor_legacy@2x-flip-vs-cursor-atomic:
- shard-dg2: NOTRUN -> [SKIP][111] ([fdo#109274] / [fdo#111767] / [i915#5354])
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_cursor_legacy@2x-flip-vs-cursor-atomic.html
* igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
- shard-mtlp: NOTRUN -> [SKIP][112] ([i915#3546]) +1 other test skip
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- shard-dg2: NOTRUN -> [SKIP][113] ([i915#4103] / [i915#4213] / [i915#5608])
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
* igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions:
- shard-tglu: NOTRUN -> [SKIP][114] ([fdo#109274])
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-8/igt@kms_cursor_legacy@cursora-vs-flipb-atomic-transitions.html
* igt@kms_cursor_legacy@cursorb-vs-flipb-legacy:
- shard-dg2: NOTRUN -> [SKIP][115] ([fdo#109274] / [i915#5354]) +6 other tests skip
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_cursor_legacy@cursorb-vs-flipb-legacy.html
* igt@kms_cursor_legacy@short-busy-flip-before-cursor-toggle:
- shard-dg2: NOTRUN -> [SKIP][116] ([i915#4103] / [i915#4213]) +1 other test skip
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_cursor_legacy@short-busy-flip-before-cursor-toggle.html
* igt@kms_dsc@dsc-basic:
- shard-mtlp: NOTRUN -> [SKIP][117] ([i915#3555] / [i915#3840] / [i915#4098] / [i915#9159])
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@kms_dsc@dsc-basic.html
* igt@kms_dsc@dsc-with-output-formats:
- shard-mtlp: NOTRUN -> [SKIP][118] ([i915#3555] / [i915#3840])
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@kms_dsc@dsc-with-output-formats.html
* igt@kms_fbcon_fbt@fbc-suspend:
- shard-tglu: [PASS][119] -> [FAIL][120] ([i915#4767])
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-2/igt@kms_fbcon_fbt@fbc-suspend.html
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@kms_fbcon_fbt@fbc-suspend.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-dg2: NOTRUN -> [SKIP][121] ([fdo#109274] / [fdo#111767])
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
- shard-snb: NOTRUN -> [SKIP][122] ([fdo#109271] / [fdo#111767])
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb5/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
* igt@kms_flip@2x-flip-vs-fences-interruptible:
- shard-dg2: NOTRUN -> [SKIP][123] ([i915#8381]) +1 other test skip
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@kms_flip@2x-flip-vs-fences-interruptible.html
* igt@kms_flip@2x-modeset-vs-vblank-race:
- shard-dg2: NOTRUN -> [SKIP][124] ([fdo#109274]) +5 other tests skip
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_flip@2x-modeset-vs-vblank-race.html
* igt@kms_flip@2x-wf_vblank-ts-check:
- shard-mtlp: NOTRUN -> [SKIP][125] ([i915#3637]) +3 other tests skip
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@kms_flip@2x-wf_vblank-ts-check.html
* igt@kms_flip@2x-wf_vblank-ts-check-interruptible:
- shard-tglu: NOTRUN -> [SKIP][126] ([fdo#109274] / [i915#3637])
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@kms_flip@2x-wf_vblank-ts-check-interruptible.html
* igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-default-mode:
- shard-mtlp: NOTRUN -> [SKIP][127] ([i915#2672]) +1 other test skip
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-32bpp-4tiledg2rcccs-downscaling@pipe-a-default-mode.html
* igt@kms_flip_scaled_crc@flip-32bpp-yftileccs-to-64bpp-yftile-upscaling@pipe-a-valid-mode:
- shard-dg2: NOTRUN -> [SKIP][128] ([i915#2672]) +2 other tests skip
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_flip_scaled_crc@flip-32bpp-yftileccs-to-64bpp-yftile-upscaling@pipe-a-valid-mode.html
* igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-downscaling@pipe-a-default-mode:
- shard-mtlp: NOTRUN -> [SKIP][129] ([i915#8810])
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-downscaling@pipe-a-default-mode.html
* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling@pipe-a-valid-mode:
- shard-dg2: NOTRUN -> [SKIP][130] ([i915#2672] / [i915#3555])
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilegen12rcccs-upscaling@pipe-a-valid-mode.html
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt:
- shard-mtlp: NOTRUN -> [SKIP][131] ([i915#8708]) +3 other tests skip
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-mmap-gtt.html
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-wc:
- shard-dg2: NOTRUN -> [SKIP][132] ([i915#8708]) +12 other tests skip
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-plflip-blt:
- shard-dg2: NOTRUN -> [SKIP][133] ([i915#5354]) +28 other tests skip
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-indfb-plflip-blt.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-mmap-cpu:
- shard-dg2: NOTRUN -> [SKIP][134] ([i915#3458]) +13 other tests skip
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-mmap-cpu.html
* igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt:
- shard-tglu: NOTRUN -> [SKIP][135] ([fdo#110189]) +2 other tests skip
[135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt.html
* igt@kms_frontbuffer_tracking@fbcpsr-tiling-y:
- shard-mtlp: NOTRUN -> [SKIP][136] ([i915#5460])
[136]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@kms_frontbuffer_tracking@fbcpsr-tiling-y.html
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-render:
- shard-mtlp: NOTRUN -> [SKIP][137] ([i915#1825]) +18 other tests skip
[137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_frontbuffer_tracking@psr-2p-primscrn-spr-indfb-draw-render.html
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-draw-blt:
- shard-tglu: NOTRUN -> [SKIP][138] ([fdo#109280]) +1 other test skip
[138]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-3/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-cur-indfb-draw-blt.html
* igt@kms_hdr@bpc-switch-dpms:
- shard-dg2: NOTRUN -> [SKIP][139] ([i915#3555] / [i915#8228]) +1 other test skip
[139]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@kms_hdr@bpc-switch-dpms.html
* igt@kms_invalid_mode@clock-too-high@pipe-c-edp-1:
- shard-mtlp: NOTRUN -> [SKIP][140] ([i915#9457]) +2 other tests skip
[140]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@kms_invalid_mode@clock-too-high@pipe-c-edp-1.html
* igt@kms_plane_alpha_blend@alpha-basic@pipe-a-hdmi-a-1:
- shard-glk: NOTRUN -> [FAIL][141] ([i915#7862]) +1 other test fail
[141]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk4/igt@kms_plane_alpha_blend@alpha-basic@pipe-a-hdmi-a-1.html
* igt@kms_plane_lowres@tiling-none@pipe-b-edp-1:
- shard-mtlp: NOTRUN -> [SKIP][142] ([i915#3582]) +3 other tests skip
[142]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_plane_lowres@tiling-none@pipe-b-edp-1.html
* igt@kms_plane_lowres@tiling-yf:
- shard-dg2: NOTRUN -> [SKIP][143] ([i915#3555] / [i915#8821])
[143]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_plane_lowres@tiling-yf.html
* igt@kms_plane_multiple@tiling-y:
- shard-mtlp: NOTRUN -> [SKIP][144] ([i915#3555] / [i915#8806])
[144]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-8/igt@kms_plane_multiple@tiling-y.html
* igt@kms_plane_scaling@intel-max-src-size@pipe-a-hdmi-a-3:
- shard-dg1: NOTRUN -> [FAIL][145] ([i915#8292])
[145]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-12/igt@kms_plane_scaling@intel-max-src-size@pipe-a-hdmi-a-3.html
* igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-hdmi-a-3:
- shard-dg1: NOTRUN -> [SKIP][146] ([i915#5176] / [i915#9423]) +3 other tests skip
[146]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-12/igt@kms_plane_scaling@plane-scaler-with-clipping-clamping-rotation@pipe-a-hdmi-a-3.html
* igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-factor-0-25@pipe-d-edp-1:
- shard-mtlp: NOTRUN -> [SKIP][147] ([i915#3555] / [i915#5235]) +1 other test skip
[147]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-factor-0-25@pipe-d-edp-1.html
* igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-factor-0-25@pipe-d-hdmi-a-3:
- shard-dg2: NOTRUN -> [SKIP][148] ([i915#5235]) +7 other tests skip
[148]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-5/igt@kms_plane_scaling@planes-downscale-factor-0-25-upscale-factor-0-25@pipe-d-hdmi-a-3.html
* igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-a-edp-1:
- shard-mtlp: NOTRUN -> [SKIP][149] ([i915#5235]) +5 other tests skip
[149]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@kms_plane_scaling@planes-upscale-factor-0-25-downscale-factor-0-75@pipe-a-edp-1.html
* igt@kms_psr2_su@frontbuffer-xrgb8888:
- shard-dg2: NOTRUN -> [SKIP][150] ([i915#9683]) +3 other tests skip
[150]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_psr2_su@frontbuffer-xrgb8888.html
* igt@kms_psr@psr2_suspend:
- shard-dg2: NOTRUN -> [SKIP][151] ([i915#9681])
[151]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_psr@psr2_suspend.html
* igt@kms_psr_stress_test@flip-primary-invalidate-overlay:
- shard-dg2: NOTRUN -> [SKIP][152] ([i915#9685])
[152]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-2/igt@kms_psr_stress_test@flip-primary-invalidate-overlay.html
* igt@kms_rotation_crc@bad-pixel-format:
- shard-dg2: NOTRUN -> [SKIP][153] ([i915#4235])
[153]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_rotation_crc@bad-pixel-format.html
* igt@kms_rotation_crc@primary-y-tiled-reflect-x-270:
- shard-mtlp: NOTRUN -> [SKIP][154] ([i915#4235])
[154]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_rotation_crc@primary-y-tiled-reflect-x-270.html
* igt@kms_setmode@basic@pipe-a-hdmi-a-1:
- shard-snb: NOTRUN -> [FAIL][155] ([i915#5465]) +1 other test fail
[155]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb1/igt@kms_setmode@basic@pipe-a-hdmi-a-1.html
* igt@kms_tv_load_detect@load-detect:
- shard-dg2: NOTRUN -> [SKIP][156] ([fdo#109309])
[156]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_tv_load_detect@load-detect.html
* igt@kms_universal_plane@cursor-fb-leak@pipe-a-edp-1:
- shard-mtlp: [PASS][157] -> [FAIL][158] ([i915#9196]) +1 other test fail
[157]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-5/igt@kms_universal_plane@cursor-fb-leak@pipe-a-edp-1.html
[158]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@kms_universal_plane@cursor-fb-leak@pipe-a-edp-1.html
* igt@kms_writeback@writeback-fb-id:
- shard-dg2: NOTRUN -> [SKIP][159] ([i915#2437]) +2 other tests skip
[159]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@kms_writeback@writeback-fb-id.html
* igt@perf@mi-rpc:
- shard-dg2: NOTRUN -> [SKIP][160] ([i915#2434])
[160]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@perf@mi-rpc.html
* igt@perf_pmu@busy-double-start@rcs0:
- shard-mtlp: [PASS][161] -> [FAIL][162] ([i915#4349])
[161]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-8/igt@perf_pmu@busy-double-start@rcs0.html
[162]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-1/igt@perf_pmu@busy-double-start@rcs0.html
* igt@perf_pmu@busy-double-start@vecs1:
- shard-dg2: NOTRUN -> [FAIL][163] ([i915#4349]) +3 other tests fail
[163]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@perf_pmu@busy-double-start@vecs1.html
* igt@perf_pmu@cpu-hotplug:
- shard-mtlp: NOTRUN -> [SKIP][164] ([i915#8850])
[164]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-5/igt@perf_pmu@cpu-hotplug.html
* igt@perf_pmu@event-wait@rcs0:
- shard-mtlp: NOTRUN -> [SKIP][165] ([i915#3555] / [i915#8807])
[165]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@perf_pmu@event-wait@rcs0.html
* igt@perf_pmu@module-unload:
- shard-dg2: NOTRUN -> [FAIL][166] ([i915#5793])
[166]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-10/igt@perf_pmu@module-unload.html
* igt@prime_udl:
- shard-mtlp: NOTRUN -> [SKIP][167] ([fdo#109291])
[167]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-1/igt@prime_udl.html
* igt@prime_vgem@basic-fence-mmap:
- shard-mtlp: NOTRUN -> [SKIP][168] ([i915#3708] / [i915#4077])
[168]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@prime_vgem@basic-fence-mmap.html
* igt@v3d/v3d_submit_cl@bad-bo:
- shard-mtlp: NOTRUN -> [SKIP][169] ([i915#2575]) +3 other tests skip
[169]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-4/igt@v3d/v3d_submit_cl@bad-bo.html
* igt@v3d/v3d_submit_cl@bad-perfmon:
- shard-dg2: NOTRUN -> [SKIP][170] ([i915#2575]) +10 other tests skip
[170]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@v3d/v3d_submit_cl@bad-perfmon.html
* igt@v3d/v3d_submit_cl@multi-and-single-sync:
- shard-tglu: NOTRUN -> [SKIP][171] ([fdo#109315] / [i915#2575])
[171]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-9/igt@v3d/v3d_submit_cl@multi-and-single-sync.html
* igt@vc4/vc4_tiling@get-after-free:
- shard-mtlp: NOTRUN -> [SKIP][172] ([i915#7711]) +3 other tests skip
[172]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-2/igt@vc4/vc4_tiling@get-after-free.html
* igt@vc4/vc4_tiling@get-bad-modifier:
- shard-dg2: NOTRUN -> [SKIP][173] ([i915#7711]) +4 other tests skip
[173]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@vc4/vc4_tiling@get-bad-modifier.html
#### Possible fixes ####
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [FAIL][174] ([i915#2842]) -> [PASS][175]
[174]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-glk4/igt@gem_exec_fair@basic-pace-share@rcs0.html
[175]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk8/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@gem_lmem_swapping@smem-oom@lmem0:
- shard-dg1: [DMESG-WARN][176] ([i915#4936] / [i915#5493]) -> [PASS][177]
[176]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg1-14/igt@gem_lmem_swapping@smem-oom@lmem0.html
[177]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-15/igt@gem_lmem_swapping@smem-oom@lmem0.html
* igt@gem_workarounds@reset-fd:
- shard-mtlp: [ABORT][178] ([i915#9414]) -> [PASS][179]
[178]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-8/igt@gem_workarounds@reset-fd.html
[179]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-6/igt@gem_workarounds@reset-fd.html
* igt@gen9_exec_parse@allowed-single:
- shard-glk: [INCOMPLETE][180] ([i915#5566]) -> [PASS][181]
[180]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-glk6/igt@gen9_exec_parse@allowed-single.html
[181]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk1/igt@gen9_exec_parse@allowed-single.html
* igt@i915_power@sanity:
- shard-mtlp: [SKIP][182] ([i915#7984]) -> [PASS][183]
[182]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-4/igt@i915_power@sanity.html
[183]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@i915_power@sanity.html
* igt@kms_atomic@crtc-invalid-params-fence@pipe-a-edp-1:
- shard-mtlp: [DMESG-WARN][184] ([i915#2017]) -> [PASS][185]
[184]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-6/igt@kms_atomic@crtc-invalid-params-fence@pipe-a-edp-1.html
[185]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-7/igt@kms_atomic@crtc-invalid-params-fence@pipe-a-edp-1.html
* igt@kms_big_fb@4-tiled-64bpp-rotate-180:
- shard-mtlp: [FAIL][186] ([i915#5138]) -> [PASS][187]
[186]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-mtlp-6/igt@kms_big_fb@4-tiled-64bpp-rotate-180.html
[187]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-mtlp-1/igt@kms_big_fb@4-tiled-64bpp-rotate-180.html
* igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
- shard-tglu: [FAIL][188] ([i915#3743]) -> [PASS][189] +2 other tests pass
[188]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-tglu-6/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
[189]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-tglu-7/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-glk: [FAIL][190] ([i915#2346]) -> [PASS][191] +1 other test pass
[190]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-glk4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
[191]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-glk4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
* {igt@kms_pm_rpm@dpms-mode-unset-non-lpsp}:
- shard-dg2: [SKIP][192] ([i915#9519]) -> [PASS][193]
[192]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg2-10/igt@kms_pm_rpm@dpms-mode-unset-non-lpsp.html
[193]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_pm_rpm@dpms-mode-unset-non-lpsp.html
* igt@kms_sysfs_edid_timing:
- shard-dg2: [FAIL][194] ([IGT#2]) -> [PASS][195]
[194]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg2-5/igt@kms_sysfs_edid_timing.html
[195]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-11/igt@kms_sysfs_edid_timing.html
* igt@kms_universal_plane@cursor-fb-leak@pipe-a-vga-1:
- shard-snb: [FAIL][196] ([i915#9196]) -> [PASS][197]
[196]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-snb5/igt@kms_universal_plane@cursor-fb-leak@pipe-a-vga-1.html
[197]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-snb5/igt@kms_universal_plane@cursor-fb-leak@pipe-a-vga-1.html
* igt@perf@enable-disable@0-rcs0:
- shard-dg2: [FAIL][198] ([i915#8724]) -> [PASS][199]
[198]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg2-11/igt@perf@enable-disable@0-rcs0.html
[199]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg2-6/igt@perf@enable-disable@0-rcs0.html
#### Warnings ####
* igt@device_reset@unbind-reset-rebind:
- shard-dg1: [INCOMPLETE][200] ([i915#9408]) -> [INCOMPLETE][201] ([i915#1982] / [i915#9408])
[200]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13920/shard-dg1-16/igt@device_reset@unbind-reset-rebind.html
[201]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/shard-dg1-17/igt@device_reset@unbind-reset-rebind.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
[fdo#109293]: https://bugs.freedesktop.org/show_bug.cgi?id=109293
[fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111767]: https://bugs.freedesktop.org/show_bug.cgi?id=111767
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
[i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2017]: https://gitlab.freedesktop.org/drm/intel/issues/2017
[i915#2065]: https://gitlab.freedesktop.org/drm/intel/issues/2065
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3582]: https://gitlab.freedesktop.org/drm/intel/issues/3582
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3743]: https://gitlab.freedesktop.org/drm/intel/issues/3743
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3936]: https://gitlab.freedesktop.org/drm/intel/issues/3936
[i915#4036]: https://gitlab.freedesktop.org/drm/intel/issues/4036
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4087]: https://gitlab.freedesktop.org/drm/intel/issues/4087
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4235]: https://gitlab.freedesktop.org/drm/intel/issues/4235
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4473]: https://gitlab.freedesktop.org/drm/intel/issues/4473
[i915#4537]: https://gitlab.freedesktop.org/drm/intel/issues/4537
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4854]: https://gitlab.freedesktop.org/drm/intel/issues/4854
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4885]: https://gitlab.freedesktop.org/drm/intel/issues/4885
[i915#4936]: https://gitlab.freedesktop.org/drm/intel/issues/4936
[i915#5138]: https://gitlab.freedesktop.org/drm/intel/issues/5138
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5460]: https://gitlab.freedesktop.org/drm/intel/issues/5460
[i915#5465]: https://gitlab.freedesktop.org/drm/intel/issues/5465
[i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
[i915#5507]: https://gitlab.freedesktop.org/drm/intel/issues/5507
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5608]: https://gitlab.freedesktop.org/drm/intel/issues/5608
[i915#5793]: https://gitlab.freedesktop.org/drm/intel/issues/5793
[i915#5978]: https://gitlab.freedesktop.org/drm/intel/issues/5978
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6187]: https://gitlab.freedesktop.org/drm/intel/issues/6187
[i915#6188]: https://gitlab.freedesktop.org/drm/intel/issues/6188
[i915#6334]: https://gitlab.freedesktop.org/drm/intel/issues/6334
[i915#6412]: https://gitlab.freedesktop.org/drm/intel/issues/6412
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6755]: https://gitlab.freedesktop.org/drm/intel/issues/6755
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#7091]: https://gitlab.freedesktop.org/drm/intel/issues/7091
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7173]: https://gitlab.freedesktop.org/drm/intel/issues/7173
[i915#7213]: https://gitlab.freedesktop.org/drm/intel/issues/7213
[i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7862]: https://gitlab.freedesktop.org/drm/intel/issues/7862
[i915#7892]: https://gitlab.freedesktop.org/drm/intel/issues/7892
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
[i915#7984]: https://gitlab.freedesktop.org/drm/intel/issues/7984
[i915#8063]: https://gitlab.freedesktop.org/drm/intel/issues/8063
[i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
[i915#8228]: https://gitlab.freedesktop.org/drm/intel/issues/8228
[i915#8247]: https://gitlab.freedesktop.org/drm/intel/issues/8247
[i915#8292]: https://gitlab.freedesktop.org/drm/intel/issues/8292
[i915#8381]: https://gitlab.freedesktop.org/drm/intel/issues/8381
[i915#8398]: https://gitlab.freedesktop.org/drm/intel/issues/8398
[i915#8411]: https://gitlab.freedesktop.org/drm/intel/issues/8411
[i915#8414]: https://gitlab.freedesktop.org/drm/intel/issues/8414
[i915#8428]: https://gitlab.freedesktop.org/drm/intel/issues/8428
[i915#8430]: https://gitlab.freedesktop.org/drm/intel/issues/8430
[i915#8555]: https://gitlab.freedesktop.org/drm/intel/issues/8555
[i915#8562]: https://gitlab.freedesktop.org/drm/intel/issues/8562
[i915#8708]: https://gitlab.freedesktop.org/drm/intel/issues/8708
[i915#8709]: https://gitlab.freedesktop.org/drm/intel/issues/8709
[i915#8724]: https://gitlab.freedesktop.org/drm/intel/issues/8724
[i915#8806]: https://gitlab.freedesktop.org/drm/intel/issues/8806
[i915#8807]: https://gitlab.freedesktop.org/drm/intel/issues/8807
[i915#8810]: https://gitlab.freedesktop.org/drm/intel/issues/8810
[i915#8814]: https://gitlab.freedesktop.org/drm/intel/issues/8814
[i915#8821]: https://gitlab.freedesktop.org/drm/intel/issues/8821
[i915#8850]: https://gitlab.freedesktop.org/drm/intel/issues/8850
[i915#8925]: https://gitlab.freedesktop.org/drm/intel/issues/8925
[i915#9159]: https://gitlab.freedesktop.org/drm/intel/issues/9159
[i915#9196]: https://gitlab.freedesktop.org/drm/intel/issues/9196
[i915#9295]: https://gitlab.freedesktop.org/drm/intel/issues/9295
[i915#9311]: https://gitlab.freedesktop.org/drm/intel/issues/9311
[i915#9364]: https://gitlab.freedesktop.org/drm/intel/issues/9364
[i915#9408]: https://gitlab.freedesktop.org/drm/intel/issues/9408
[i915#9414]: https://gitlab.freedesktop.org/drm/intel/issues/9414
[i915#9423]: https://gitlab.freedesktop.org/drm/intel/issues/9423
[i915#9424]: https://gitlab.freedesktop.org/drm/intel/issues/9424
[i915#9433]: https://gitlab.freedesktop.org/drm/intel/issues/9433
[i915#9457]: https://gitlab.freedesktop.org/drm/intel/issues/9457
[i915#9519]: https://gitlab.freedesktop.org/drm/intel/issues/9519
[i915#9606]: https://gitlab.freedesktop.org/drm/intel/issues/9606
[i915#9653]: https://gitlab.freedesktop.org/drm/intel/issues/9653
[i915#9673]: https://gitlab.freedesktop.org/drm/intel/issues/9673
[i915#9681]: https://gitlab.freedesktop.org/drm/intel/issues/9681
[i915#9683]: https://gitlab.freedesktop.org/drm/intel/issues/9683
[i915#9685]: https://gitlab.freedesktop.org/drm/intel/issues/9685
[i915#9688]: https://gitlab.freedesktop.org/drm/intel/issues/9688
[i915#9697]: https://gitlab.freedesktop.org/drm/intel/issues/9697
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7601 -> IGTPW_10262
* Piglit: piglit_4509 -> None
CI-20190529: 20190529
CI_DRM_13920: 278e4673d0a5f5cd5d0b585df88cbcb6d3afd0d8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_10262: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
IGT_7601: 9c6e7f255724e327627be7c8ed30e23742e97386 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_10262/index.html
[-- Attachment #2: Type: text/html, Size: 68265 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-30 12:48 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
@ 2023-11-30 12:48 ` Lukasz Laguna
2023-12-01 15:21 ` Kamil Konieczny
0 siblings, 1 reply; 24+ messages in thread
From: Lukasz Laguna @ 2023-11-30 12:48 UTC (permalink / raw)
To: igt-dev
From: Katarzyna Dec <katarzyna.dec@intel.com>
Create lib for core SR-IOV (Single Root I/O Virtualization) helpers
that allow to manage SR-IOV devices.
v2:
- change functions description (Michal)
v3:
- decipher SR-IOV shortcut in commit message (Kamil)
- add SR-IOV description in header file (Kamil)
- remove old r-b and add cc (Kamil)
- return bool result in functions prefixed with "__" (Kamil)
- add brief description in functions documentation (Michal)
- add asserts in helpers (Michal)
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
lib/igt_sriov_device.c | 213 +++++++++++++++++++++++++++++++++++++++++
lib/igt_sriov_device.h | 29 ++++++
lib/meson.build | 1 +
3 files changed, 243 insertions(+)
create mode 100644 lib/igt_sriov_device.c
create mode 100644 lib/igt_sriov_device.h
diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
new file mode 100644
index 000000000..c5c594c2c
--- /dev/null
+++ b/lib/igt_sriov_device.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#include <errno.h>
+
+#include "igt_core.h"
+#include "igt_sriov_device.h"
+#include "igt_sysfs.h"
+
+/**
+ * igt_sriov_is_pf - Check if device is PF
+ * @device: device file descriptor
+ *
+ * Determine if device is PF by checking existence of sriov_totalvfs file.
+ *
+ * Return:
+ * True if device is PF, false otherwise.
+ */
+bool igt_sriov_is_pf(int device)
+{
+ int sysfs;
+ bool ret;
+
+ sysfs = igt_sysfs_open(device);
+ igt_assert_fd(sysfs);
+
+ ret = igt_sysfs_has_attr(sysfs, "device/sriov_totalvfs");
+ close(sysfs);
+
+ return ret;
+}
+
+static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_get_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static uint32_t pf_attr_get_u32(int pf, const char *attr)
+{
+ uint32_t value;
+
+ igt_assert_f(__pf_attr_get_u32(pf, attr, &value),
+ "Failed to read %s attribute (%s)\n", attr, strerror(errno));
+
+ return value;
+}
+
+static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ int sysfs;
+ bool ret;
+
+ igt_assert(igt_sriov_is_pf(pf));
+
+ sysfs = igt_sysfs_open(pf);
+ igt_assert_fd(sysfs);
+
+ ret = __igt_sysfs_set_u32(sysfs, attr, value);
+ close(sysfs);
+
+ return ret;
+}
+
+static void pf_attr_set_u32(int pf, const char *attr, uint32_t value)
+{
+ igt_assert_f(__pf_attr_set_u32(pf, attr, value),
+ "Failed to write %u to %s attribute (%s)\n", value, attr, strerror(errno));
+}
+
+/**
+ * igt_sriov_vfs_supported - Check if VFs are supported
+ * @pf: PF device file descriptor
+ *
+ * Determine VFs support by checking if value of sriov_totalvfs attribute
+ * corresponding to @pf device is bigger than 0.
+ *
+ * Return:
+ * True if VFs are supported, false otherwise.
+ */
+bool igt_sriov_vfs_supported(int pf)
+{
+ uint32_t totalvfs;
+
+ if (!__pf_attr_get_u32(pf, "device/sriov_totalvfs", &totalvfs))
+ return false;
+
+ return totalvfs > 0;
+}
+
+/**
+ * igt_sriov_get_totalvfs - Get maximum number of VFs that can be enabled
+ * @pf: PF device file descriptor
+ *
+ * Maximum number of VFs that can be enabled is checked by reading
+ * sriov_totalvfs attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Maximum number of VFs that can be associated with given PF.
+ */
+unsigned int igt_sriov_get_total_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_totalvfs");
+}
+
+/**
+ * igt_sriov_get_numvfs - Get number of enabled VFs
+ * @pf: PF device file descriptor
+ *
+ * Number of enabled VFs is checked by reading sriov_numvfs attribute
+ * corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * Number of VFs enabled by given PF.
+ */
+unsigned int igt_sriov_get_enabled_vfs(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_numvfs");
+}
+
+/**
+ * igt_sriov_enable_vfs - Enable VFs
+ * @pf: PF device file descriptor
+ * @num_vfs: Number of virtual functions to be enabled
+ *
+ * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
+ * @pf device.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
+{
+ igt_assert(num_vfs > 0);
+
+ igt_debug("Enabling %u VFs\n", num_vfs);
+ pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
+}
+
+/**
+ * igt_sriov_disable_vfs - Disable VFs
+ * @pf: PF device file descriptor
+ *
+ * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
+ * device.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_vfs(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
+}
+
+/**
+ * igt_sriov_is_driver_autoprobe_enabled - Get VF driver autoprobe setting
+ * @pf: PF device file descriptor
+ *
+ * Get current VF driver autoprobe setting by reading sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * It asserts on failure.
+ *
+ * Return:
+ * True if autoprobe is enabled, false otherwise.
+ */
+bool igt_sriov_is_driver_autoprobe_enabled(int pf)
+{
+ return pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
+}
+
+/**
+ * igt_sriov_enable_driver_autoprobe - Enable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Enable VF driver autoprobe setting by writing 1 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * If successful, kernel will automatically bind VFs to a compatible driver
+ * immediately after they are enabled.
+ * It asserts on failure.
+ */
+void igt_sriov_enable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
+}
+
+/**
+ * igt_sriov_disable_driver_autoprobe - Disable VF driver autoprobe
+ * @pf: PF device file descriptor
+ *
+ * Disable VF driver autoprobe setting by writing 0 to sriov_drivers_autoprobe
+ * attribute corresponding to @pf device.
+ *
+ * During VFs enabling driver won't be bound to VFs.
+ * It asserts on failure.
+ */
+void igt_sriov_disable_driver_autoprobe(int pf)
+{
+ pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
+}
diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
new file mode 100644
index 000000000..337fdf84b
--- /dev/null
+++ b/lib/igt_sriov_device.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2023 Intel Corporation. All rights reserved.
+ */
+
+#ifndef __IGT_SRIOV_DEVICE_H__
+#define __IGT_SRIOV_DEVICE_H__
+
+/* Library for managing SR-IOV (Single Root I/O Virtualization)
+ * devices.
+ *
+ * SR-IOV is a specification that allows a single PCIe physical
+ * device to appear as a physical function (PF) and multiple virtual
+ * functions (VFs) to the operating system.
+ */
+
+#include <stdint.h>
+
+bool igt_sriov_is_pf(int device);
+bool igt_sriov_vfs_supported(int pf);
+unsigned int igt_sriov_get_total_vfs(int pf);
+unsigned int igt_sriov_get_enabled_vfs(int pf);
+void igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
+void igt_sriov_disable_vfs(int pf);
+bool igt_sriov_is_driver_autoprobe_enabled(int pf);
+void igt_sriov_enable_driver_autoprobe(int pf);
+void igt_sriov_disable_driver_autoprobe(int pf);
+
+#endif /* __IGT_SRIOV_DEVICE_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index 48466a2e9..0fc11b26c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -38,6 +38,7 @@ lib_sources = [
'igt_primes.c',
'igt_pci.c',
'igt_rand.c',
+ 'igt_sriov_device.c',
'igt_stats.c',
'igt_syncobj.c',
'igt_sysfs.c',
--
2.40.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers
2023-11-30 12:48 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
@ 2023-12-01 15:21 ` Kamil Konieczny
0 siblings, 0 replies; 24+ messages in thread
From: Kamil Konieczny @ 2023-12-01 15:21 UTC (permalink / raw)
To: igt-dev
Hi Lukasz,
On 2023-11-30 at 13:48:34 +0100, Lukasz Laguna wrote:
> From: Katarzyna Dec <katarzyna.dec@intel.com>
>
> Create lib for core SR-IOV (Single Root I/O Virtualization) helpers
> that allow to manage SR-IOV devices.
>
> v2:
> - change functions description (Michal)
> v3:
> - decipher SR-IOV shortcut in commit message (Kamil)
> - add SR-IOV description in header file (Kamil)
> - remove old r-b and add cc (Kamil)
> - return bool result in functions prefixed with "__" (Kamil)
> - add brief description in functions documentation (Michal)
> - add asserts in helpers (Michal)
>
> Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com>
> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
> ---
> lib/igt_sriov_device.c | 213 +++++++++++++++++++++++++++++++++++++++++
> lib/igt_sriov_device.h | 29 ++++++
> lib/meson.build | 1 +
> 3 files changed, 243 insertions(+)
> create mode 100644 lib/igt_sriov_device.c
> create mode 100644 lib/igt_sriov_device.h
>
> diff --git a/lib/igt_sriov_device.c b/lib/igt_sriov_device.c
> new file mode 100644
> index 000000000..c5c594c2c
> --- /dev/null
> +++ b/lib/igt_sriov_device.c
> @@ -0,0 +1,213 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#include <errno.h>
> +
> +#include "igt_core.h"
> +#include "igt_sriov_device.h"
> +#include "igt_sysfs.h"
> +
> +/**
> + * igt_sriov_is_pf - Check if device is PF
> + * @device: device file descriptor
> + *
> + * Determine if device is PF by checking existence of sriov_totalvfs file.
> + *
> + * Return:
> + * True if device is PF, false otherwise.
> + */
> +bool igt_sriov_is_pf(int device)
> +{
> + int sysfs;
> + bool ret;
> +
> + sysfs = igt_sysfs_open(device);
> + igt_assert_fd(sysfs);
> +
> + ret = igt_sysfs_has_attr(sysfs, "device/sriov_totalvfs");
> + close(sysfs);
> +
> + return ret;
> +}
> +
> +static bool __pf_attr_get_u32(int pf, const char *attr, uint32_t *value)
> +{
> + int sysfs;
> + bool ret;
> +
> + igt_assert(igt_sriov_is_pf(pf));
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + ret = __igt_sysfs_get_u32(sysfs, attr, value);
> + close(sysfs);
> +
> + return ret;
> +}
> +
> +static uint32_t pf_attr_get_u32(int pf, const char *attr)
> +{
> + uint32_t value;
> +
> + igt_assert_f(__pf_attr_get_u32(pf, attr, &value),
> + "Failed to read %s attribute (%s)\n", attr, strerror(errno));
> +
> + return value;
> +}
> +
> +static bool __pf_attr_set_u32(int pf, const char *attr, uint32_t value)
> +{
> + int sysfs;
> + bool ret;
> +
> + igt_assert(igt_sriov_is_pf(pf));
> +
> + sysfs = igt_sysfs_open(pf);
> + igt_assert_fd(sysfs);
> +
> + ret = __igt_sysfs_set_u32(sysfs, attr, value);
> + close(sysfs);
> +
> + return ret;
> +}
> +
> +static void pf_attr_set_u32(int pf, const char *attr, uint32_t value)
> +{
> + igt_assert_f(__pf_attr_set_u32(pf, attr, value),
> + "Failed to write %u to %s attribute (%s)\n", value, attr, strerror(errno));
> +}
> +
> +/**
> + * igt_sriov_vfs_supported - Check if VFs are supported
> + * @pf: PF device file descriptor
> + *
> + * Determine VFs support by checking if value of sriov_totalvfs attribute
> + * corresponding to @pf device is bigger than 0.
> + *
> + * Return:
> + * True if VFs are supported, false otherwise.
> + */
> +bool igt_sriov_vfs_supported(int pf)
> +{
> + uint32_t totalvfs;
> +
> + if (!__pf_attr_get_u32(pf, "device/sriov_totalvfs", &totalvfs))
> + return false;
> +
> + return totalvfs > 0;
> +}
> +
> +/**
> + * igt_sriov_get_totalvfs - Get maximum number of VFs that can be enabled
> + * @pf: PF device file descriptor
> + *
> + * Maximum number of VFs that can be enabled is checked by reading
> + * sriov_totalvfs attribute corresponding to @pf device.
> + *
> + * It asserts on failure.
> + *
> + * Return:
> + * Maximum number of VFs that can be associated with given PF.
> + */
> +unsigned int igt_sriov_get_total_vfs(int pf)
> +{
> + return pf_attr_get_u32(pf, "device/sriov_totalvfs");
> +}
> +
> +/**
> + * igt_sriov_get_numvfs - Get number of enabled VFs
> + * @pf: PF device file descriptor
> + *
> + * Number of enabled VFs is checked by reading sriov_numvfs attribute
> + * corresponding to @pf device.
> + *
> + * It asserts on failure.
> + *
> + * Return:
> + * Number of VFs enabled by given PF.
> + */
> +unsigned int igt_sriov_get_enabled_vfs(int pf)
> +{
> + return pf_attr_get_u32(pf, "device/sriov_numvfs");
> +}
> +
> +/**
> + * igt_sriov_enable_vfs - Enable VFs
> + * @pf: PF device file descriptor
> + * @num_vfs: Number of virtual functions to be enabled
> + *
> + * Enable VFs by writing @num_vfs to sriov_numvfs attribute corresponding to
> + * @pf device.
> + * It asserts on failure.
> + */
> +void igt_sriov_enable_vfs(int pf, unsigned int num_vfs)
> +{
> + igt_assert(num_vfs > 0);
> +
> + igt_debug("Enabling %u VFs\n", num_vfs);
> + pf_attr_set_u32(pf, "device/sriov_numvfs", num_vfs);
> +}
> +
> +/**
> + * igt_sriov_disable_vfs - Disable VFs
> + * @pf: PF device file descriptor
> + *
> + * Disable VFs by writing 0 to sriov_numvfs attribute corresponding to @pf
> + * device.
> + * It asserts on failure.
> + */
> +void igt_sriov_disable_vfs(int pf)
> +{
> + pf_attr_set_u32(pf, "device/sriov_numvfs", 0);
> +}
> +
> +/**
> + * igt_sriov_is_driver_autoprobe_enabled - Get VF driver autoprobe setting
> + * @pf: PF device file descriptor
> + *
> + * Get current VF driver autoprobe setting by reading sriov_drivers_autoprobe
> + * attribute corresponding to @pf device.
> + *
> + * It asserts on failure.
> + *
> + * Return:
> + * True if autoprobe is enabled, false otherwise.
> + */
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf)
> +{
> + return pf_attr_get_u32(pf, "device/sriov_drivers_autoprobe");
> +}
> +
> +/**
> + * igt_sriov_enable_driver_autoprobe - Enable VF driver autoprobe
> + * @pf: PF device file descriptor
> + *
> + * Enable VF driver autoprobe setting by writing 1 to sriov_drivers_autoprobe
> + * attribute corresponding to @pf device.
> + *
> + * If successful, kernel will automatically bind VFs to a compatible driver
> + * immediately after they are enabled.
> + * It asserts on failure.
> + */
> +void igt_sriov_enable_driver_autoprobe(int pf)
> +{
> + pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", true);
> +}
> +
> +/**
> + * igt_sriov_disable_driver_autoprobe - Disable VF driver autoprobe
> + * @pf: PF device file descriptor
> + *
> + * Disable VF driver autoprobe setting by writing 0 to sriov_drivers_autoprobe
> + * attribute corresponding to @pf device.
> + *
> + * During VFs enabling driver won't be bound to VFs.
> + * It asserts on failure.
> + */
> +void igt_sriov_disable_driver_autoprobe(int pf)
> +{
> + pf_attr_set_u32(pf, "device/sriov_drivers_autoprobe", false);
> +}
> diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
> new file mode 100644
> index 000000000..337fdf84b
> --- /dev/null
> +++ b/lib/igt_sriov_device.h
> @@ -0,0 +1,29 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright(c) 2023 Intel Corporation. All rights reserved.
> + */
> +
> +#ifndef __IGT_SRIOV_DEVICE_H__
> +#define __IGT_SRIOV_DEVICE_H__
> +
> +/* Library for managing SR-IOV (Single Root I/O Virtualization)
> + * devices.
> + *
> + * SR-IOV is a specification that allows a single PCIe physical
> + * device to appear as a physical function (PF) and multiple virtual
> + * functions (VFs) to the operating system.
> + */
> +
> +#include <stdint.h>
Please remove this inlcude from header, it is not needed here
(or move it to .c file if needed).
Rest looks good, with this
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Regards,
Kamil
> +
> +bool igt_sriov_is_pf(int device);
> +bool igt_sriov_vfs_supported(int pf);
> +unsigned int igt_sriov_get_total_vfs(int pf);
> +unsigned int igt_sriov_get_enabled_vfs(int pf);
> +void igt_sriov_enable_vfs(int pf, unsigned int num_vfs);
> +void igt_sriov_disable_vfs(int pf);
> +bool igt_sriov_is_driver_autoprobe_enabled(int pf);
> +void igt_sriov_enable_driver_autoprobe(int pf);
> +void igt_sriov_disable_driver_autoprobe(int pf);
> +
> +#endif /* __IGT_SRIOV_DEVICE_H__ */
> diff --git a/lib/meson.build b/lib/meson.build
> index 48466a2e9..0fc11b26c 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -38,6 +38,7 @@ lib_sources = [
> 'igt_primes.c',
> 'igt_pci.c',
> 'igt_rand.c',
> + 'igt_sriov_device.c',
> 'igt_stats.c',
> 'igt_syncobj.c',
> 'igt_sysfs.c',
> --
> 2.40.0
>
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2023-12-01 15:21 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-24 8:52 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 2/8] lib/igt_sriov_device: add helper for opening VF device Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 3/8] lib/igt_sriov_device: add helper for checking if VF DRM driver is probed Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 4/8] lib/igt_sriov_device: add helpers for operations in different VFs scenarios Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 5/8] tests/sriov_basic: add basic tests for enabling SR-IOV VFs Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 6/8] lib/igt_sriov_device: add helpers for VF DRM driver bind and unbind Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 7/8] tests/sriov_basic: validate driver binding to VFs Lukasz Laguna
2023-11-24 8:52 ` [igt-dev] [PATCH i-g-t 8/8] tests/sriov_basic: add more tests for VF driver binding Lukasz Laguna
2023-11-24 11:10 ` [igt-dev] ✓ Fi.CI.BAT: success for Initial SR-IOV validation (rev5) Patchwork
2023-11-24 12:16 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-11-25 14:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-11-30 12:48 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-30 12:48 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-12-01 15:21 ` Kamil Konieczny
2023-11-20 14:14 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-20 14:14 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-11-09 6:51 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-09 6:51 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-11-09 11:57 ` Kamil Konieczny
2023-11-20 14:21 ` Laguna, Lukasz
2023-11-06 19:59 [igt-dev] [PATCH i-g-t 0/8] Initial SR-IOV validation Lukasz Laguna
2023-11-06 19:59 ` [igt-dev] [PATCH i-g-t 1/8] lib/igt_sriov_device: add core SR-IOV helpers Lukasz Laguna
2023-11-06 22:07 ` Michal Wajdeczko
2023-11-09 6:55 ` Laguna, Lukasz
2023-11-10 19:22 ` Michal Wajdeczko
2023-11-17 14:34 ` Laguna, Lukasz
2023-11-20 14:26 ` Laguna, Lukasz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox