From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 11/13] drm/xe/pf: Extract helper to show which VFs are provisioned
Date: Thu, 2 Apr 2026 17:40:44 +0200 [thread overview]
Message-ID: <20260402154044.ogjcwp7hu224zku4@intel.com> (raw)
In-Reply-To: <20260330204046.567-12-michal.wajdeczko@intel.com>
Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2026-mar-30 22:40:42 +0200]:
> In upcoming patches we will want to show which VFs were already
> provisioned with resources other than LMEM(VRAM). Convert code
> from the LMEM reporting function into a more generic helper that
> can handle both u32 and u64 resources and can report also PF.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 30 +++++++++++++++++-----
> 1 file changed, 23 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index e673e96a147a..680ea73d1ce3 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -1934,29 +1934,45 @@ static u64 pf_profile_fair_lmem(struct xe_gt *gt, unsigned int num_vfs)
> return ALIGN_DOWN(fair, alignment);
> }
>
> -static void __pf_show_provisioning_lmem(struct xe_gt *gt, unsigned int first_vf,
> - unsigned int num_vfs, bool provisioned)
> +static void __pf_show_provisioned(struct xe_gt *gt, unsigned int first_vf,
> + unsigned int num_vfs, bool provisioned,
> + u32 (*get32)(struct xe_gt *, unsigned int),
> + u64 (*get64)(struct xe_gt *, unsigned int),
> + const char *what)
> {
> unsigned int allvfs = 1 + xe_gt_sriov_pf_get_totalvfs(gt); /* PF plus VFs */
> unsigned long *bitmap __free(bitmap) = bitmap_zalloc(allvfs, GFP_KERNEL);
> unsigned int weight;
> unsigned int n;
> + bool pf;
> +
> + xe_gt_assert(gt, get32 || get64);
>
> if (!bitmap)
> return;
>
> for (n = first_vf; n < first_vf + num_vfs; n++) {
> - if (!!pf_get_vf_config_lmem(gt, VFID(n)) == provisioned)
> + if ((get32 && (!!get32(gt, VFID(n)) == provisioned)) ||
> + (get64 && (!!get64(gt, VFID(n)) == provisioned)))
> bitmap_set(bitmap, n, 1);
> }
>
> + pf = test_and_clear_bit(0, bitmap);
> weight = bitmap_weight(bitmap, allvfs);
> - if (!weight)
> + if (!pf && !weight)
> return;
>
> - xe_gt_sriov_info(gt, "VF%s%*pbl %s provisioned with VRAM\n",
> - weight > 1 ? "s " : "", allvfs, bitmap,
> - provisioned ? "already" : "not");
> + xe_gt_sriov_info(gt, "%s%s%s%s%*pbl %s provisioned with %s\n",
> + pf ? "PF" : "", pf && weight ? " and " : "",
> + weight ? "VF" : "", weight > 1 ? "s " : "",
> + allvfs, bitmap, provisioned ? "already" : "not", what);
> +}
> +
> +static void __pf_show_provisioning_lmem(struct xe_gt *gt, unsigned int first_vf,
> + unsigned int num_vfs, bool provisioned)
> +{
> + __pf_show_provisioned(gt, first_vf, num_vfs, provisioned,
> + NULL, pf_get_vf_config_lmem, "VRAM");
> }
>
> static void pf_show_all_provisioned_lmem(struct xe_gt *gt)
LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
> --
> 2.47.1
>
--
next prev parent reply other threads:[~2026-04-02 15:40 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 20:40 [PATCH 00/13] drm/xe/pf: Improve EQ/PT provisioning Michal Wajdeczko
2026-03-30 20:40 ` [PATCH 01/13] drm/xe/guc: Update POLICY_SCHED_IF_IDLE documentation Michal Wajdeczko
2026-04-02 7:54 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 02/13] drm/xe/pf: Fix pf_get_sched_priority() function signature Michal Wajdeczko
2026-04-02 7:55 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 03/13] drm/xe/pf: Force new VFs prorities only once Michal Wajdeczko
2026-04-02 10:22 ` Piotr Piórkowski
2026-04-02 16:13 ` Michal Wajdeczko
2026-03-30 20:40 ` [PATCH 04/13] drm/xe/pf: Print applied policy KLVs Michal Wajdeczko
2026-04-02 10:56 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 05/13] drm/xe/pf: Reprovision policy settings after GT reset Michal Wajdeczko
2026-04-02 11:23 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 06/13] drm/xe/pf: Don't reprovision policies if already default Michal Wajdeczko
2026-04-02 11:23 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 07/13] drm/xe/pf: Encode scheduling priority KLV if needed Michal Wajdeczko
2026-04-02 13:18 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 08/13] drm/xe/pf: Check EQ/PT/PRIO when testing VF config Michal Wajdeczko
2026-04-02 13:30 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 09/13] drm/xe/pf: Allow to change sched_if_idle policy under lock Michal Wajdeczko
2026-04-02 13:33 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 10/13] drm/xe/pf: Reprovision scheduling to default when no VFs Michal Wajdeczko
2026-04-02 15:22 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 11/13] drm/xe/pf: Extract helper to show which VFs are provisioned Michal Wajdeczko
2026-04-02 15:40 ` Piotr Piórkowski [this message]
2026-03-30 20:40 ` [PATCH 12/13] drm/xe/pf: Extract helpers for bulk EQ/PT provisioning Michal Wajdeczko
2026-04-02 15:57 ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 13/13] drm/xe/pf: Perform fair scheduling auto-provisioning Michal Wajdeczko
2026-04-02 16:06 ` Piotr Piórkowski
2026-03-30 21:09 ` ✓ CI.KUnit: success for drm/xe/pf: Improve EQ/PT provisioning Patchwork
2026-03-30 21:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-31 0:28 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-02 16:20 ` Michal Wajdeczko
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=20260402154044.ogjcwp7hu224zku4@intel.com \
--to=piotr.piorkowski@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@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