From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
<igt-dev@lists.freedesktop.org>
Cc: "Adam Miszczak" <adam.miszczak@linux.intel.com>,
"Jakub Kolakowski" <jakub1.kolakowski@intel.com>,
"Michał Wajdeczko" <michal.wajdeczko@intel.com>,
"Michał Winiarski" <michal.winiarski@intel.com>,
"Narasimha C V" <narasimha.c.v@intel.com>,
"Piotr Piórkowski" <piotr.piorkowski@intel.com>,
"Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>,
"Tomasz Lis" <tomasz.lis@intel.com>
Subject: Re: [PATCH i-g-t 2/4] lib/xe/xe_sriov_provisioning: Add helper to check default scheduling attributes
Date: Wed, 29 Jan 2025 15:14:35 +0100 [thread overview]
Message-ID: <ff456783-b83d-4e59-af48-de2cf292e618@intel.com> (raw)
In-Reply-To: <20250120203445.16285-3-marcin.bernatowicz@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 3983 bytes --]
On 1/20/2025 21:34, Marcin Bernatowicz wrote:
> Introduce a function to validate default SR-IOV scheduling attributes
> for VFs and PF. This function skips the test if non-default attributes
> are detected. The default attributes verified include:
>
> - exec_quantum_ms set to 0 (infinite execution quantum)
> - preempt_timeout_us set to 0 (infinite preemption timeout)
> - sched_if_idle set to false
> - reset_engine set to false
> - sched_priority set to XE_SRIOV_SCHED_PRIORITY_LOW
>
> Signed-off-by: Marcin Bernatowicz<marcin.bernatowicz@linux.intel.com>
> Cc: Adam Miszczak<adam.miszczak@linux.intel.com>
> Cc: Jakub Kolakowski<jakub1.kolakowski@intel.com>
> Cc: Lukasz Laguna<lukasz.laguna@intel.com>
> Cc: Michał Wajdeczko<michal.wajdeczko@intel.com>
> Cc: Michał Winiarski<michal.winiarski@intel.com>
> Cc: Narasimha C V<narasimha.c.v@intel.com>
> Cc: Piotr Piórkowski<piotr.piorkowski@intel.com>
> Cc: Satyanarayana K V P<satyanarayana.k.v.p@intel.com>
> Cc: Tomasz Lis<tomasz.lis@intel.com>
> ---
> lib/xe/xe_sriov_provisioning.c | 42 ++++++++++++++++++++++++++++++++++
> lib/xe/xe_sriov_provisioning.h | 1 +
> 2 files changed, 43 insertions(+)
>
> diff --git a/lib/xe/xe_sriov_provisioning.c b/lib/xe/xe_sriov_provisioning.c
> index 4e3fbaae2..da580144d 100644
> --- a/lib/xe/xe_sriov_provisioning.c
> +++ b/lib/xe/xe_sriov_provisioning.c
> @@ -663,3 +663,45 @@ void xe_sriov_set_sched_priority(int pf, unsigned int vf_num, unsigned int gt_nu
> {
> igt_fail_on(__xe_sriov_set_sched_priority(pf, vf_num, gt_num, value));
> }
> +
> +/**
> + * xe_sriov_require_default_scheduling_attributes - Ensure default SR-IOV scheduling attributes
> + * @pf_fd: PF device file descriptor
> + *
> + * Skips the current test if non-default SR-IOV scheduling attributes are set.
> + *
> + * Default scheduling attributes are as follows for each VF and PF:
> + * - exec_quantum_ms equals zero (meaning infinity)
> + * - preempt_timeout_us equals zero (meaning infinity)
> + * - sched_if_idle equals false
> + * - reset_engine equals false
> + * - sched_priority equals XE_SRIOV_SCHED_PRIORITY_LOW
> + */
> +void xe_sriov_require_default_scheduling_attributes(int pf)
> +{
> + unsigned int totalvfs = igt_sriov_get_total_vfs(pf);
> + enum xe_sriov_sched_priority sched_priority;
> + bool sched_if_idle, reset_engine;
> + uint32_t eq, pt;
> + unsigned int gt;
> +
> + xe_for_each_gt(pf, gt) {
> + igt_skip_on(__xe_sriov_get_sched_if_idle(pf, gt, &sched_if_idle));
> + igt_require_f(!sched_if_idle, "sched_if_idle != false on gt%u\n", gt);
> + igt_skip_on(__xe_sriov_get_engine_reset(pf, gt, &reset_engine));
> + igt_require_f(!reset_engine, "reset_engine != false on gt%u\n", gt);
> +
> + for (unsigned int vf_num = 0; vf_num <= totalvfs; ++vf_num) {
> + igt_skip_on(__xe_sriov_get_exec_quantum_ms(pf, vf_num, gt, &eq));
> + igt_require_f(eq == 0, "exec_quantum_ms != 0 on gt%u/VF%u\n", gt, vf_num);
> +
> + igt_skip_on(__xe_sriov_get_preempt_timeout_us(pf, vf_num, gt, &pt));
> + igt_require_f(pt == 0, "preempt_timeout_us != 0 on gt%u/VF%u\n",
> + gt, vf_num);
> +
> + igt_skip_on(__xe_sriov_get_sched_priority(pf, vf_num, gt, &sched_priority));
> + igt_require_f(sched_priority == XE_SRIOV_SCHED_PRIORITY_LOW,
> + "sched_priority != LOW on gt%u/VF%u\n", gt, vf_num);
> + }
> + }
> +}
> diff --git a/lib/xe/xe_sriov_provisioning.h b/lib/xe/xe_sriov_provisioning.h
> index b22f96d88..4382f528f 100644
> --- a/lib/xe/xe_sriov_provisioning.h
> +++ b/lib/xe/xe_sriov_provisioning.h
> @@ -142,5 +142,6 @@ int __xe_sriov_set_sched_priority(int pf, unsigned int vf_num, unsigned int gt_n
> enum xe_sriov_sched_priority value);
> void xe_sriov_set_sched_priority(int pf, unsigned int vf_num, unsigned int gt_num,
> enum xe_sriov_sched_priority value);
> +void xe_sriov_require_default_scheduling_attributes(int pf);
>
> #endif /* __XE_SRIOV_PROVISIONING_H__ */
LGTM,
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
[-- Attachment #2: Type: text/html, Size: 5270 bytes --]
next prev parent reply other threads:[~2025-01-29 14:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 20:34 [PATCH i-g-t 0/4] Add SR-IOV provisioning scheduling attributes and tests Marcin Bernatowicz
2025-01-20 20:34 ` [PATCH i-g-t 1/4] lib/xe/xe_sriov_provisioning: Add scheduling attributes accessors Marcin Bernatowicz
2025-01-29 14:07 ` Laguna, Lukasz
2025-01-20 20:34 ` [PATCH i-g-t 2/4] lib/xe/xe_sriov_provisioning: Add helper to check default scheduling attributes Marcin Bernatowicz
2025-01-29 14:14 ` Laguna, Lukasz [this message]
2025-01-20 20:34 ` [PATCH i-g-t 3/4] tests/xe_sriov_scheduling: VF equal-throughput validation Marcin Bernatowicz
2025-01-30 15:40 ` Laguna, Lukasz
2025-01-20 20:34 ` [PATCH i-g-t 4/4] tests/xe_sriov_scheduling: nonpreempt-engine-resets subtest Marcin Bernatowicz
2025-01-30 17:02 ` Laguna, Lukasz
2025-01-20 22:31 ` ✗ i915.CI.BAT: failure for Add SR-IOV provisioning scheduling attributes and tests Patchwork
2025-01-20 22:43 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-21 0:12 ` ✗ Xe.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ff456783-b83d-4e59-af48-de2cf292e618@intel.com \
--to=lukasz.laguna@intel.com \
--cc=adam.miszczak@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=marcin.bernatowicz@linux.intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=michal.winiarski@intel.com \
--cc=narasimha.c.v@intel.com \
--cc=piotr.piorkowski@intel.com \
--cc=satyanarayana.k.v.p@intel.com \
--cc=tomasz.lis@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox