From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/pf: Show VFs LMEM provisioning summary over debugfs
Date: Tue, 22 Oct 2024 13:01:39 +0200 [thread overview]
Message-ID: <a8e41cc6-e54a-48b1-968b-64bd0245f662@linux.intel.com> (raw)
In-Reply-To: <20241021201506.1771-1-michal.wajdeczko@intel.com>
On 10/21/2024 10:15 PM, Michal Wajdeczko wrote:
> While we can already view individual VF LMEM provisioning using
> lmem_quota debugfs attribute, we want to have unified way to show
> summary across all VFs, like we do for GGTT or GuC doorbells/IDs.
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 35 +++++++++++++++++++++
> drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h | 1 +
> drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c | 5 +++
> 3 files changed, 41 insertions(+)
>
> 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 a863e50b756e..062a0c2fd2cd 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -2376,6 +2376,41 @@ int xe_gt_sriov_pf_config_print_dbs(struct xe_gt *gt, struct drm_printer *p)
> return 0;
> }
>
> +/**
> + * xe_gt_sriov_pf_config_print_lmem - Print LMEM configurations.
> + * @gt: the &xe_gt
> + * @p: the &drm_printer
> + *
> + * Print LMEM allocations across all VFs.
> + * VFs without LMEM allocation are skipped.
> + *
> + * This function can only be called on PF.
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_gt_sriov_pf_config_print_lmem(struct xe_gt *gt, struct drm_printer *p)
> +{
> + unsigned int n, total_vfs = xe_sriov_pf_get_totalvfs(gt_to_xe(gt));
> + const struct xe_gt_sriov_config *config;
> + char buf[10];
> +
> + xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
> + mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
> +
> + for (n = 1; n <= total_vfs; n++) {
> + config = >->sriov.pf.vfs[n].config;
> + if (!config->lmem_obj)
> + continue;
> +
> + string_get_size(config->lmem_obj->size, 1, STRING_UNITS_2,
> + buf, sizeof(buf));
> + drm_printf(p, "VF%u:\t%zu\t(%s)\n",
> + n, config->lmem_obj->size, buf);
> + }
> +
> + mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
> + return 0;
> +}
> +
> /**
> * xe_gt_sriov_pf_config_print_available_ggtt - Print available GGTT ranges.
> * @gt: the &xe_gt
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> index b74ec38baa18..0c55aa40a1a7 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> @@ -65,6 +65,7 @@ void xe_gt_sriov_pf_config_restart(struct xe_gt *gt);
> int xe_gt_sriov_pf_config_print_ggtt(struct xe_gt *gt, struct drm_printer *p);
> int xe_gt_sriov_pf_config_print_ctxs(struct xe_gt *gt, struct drm_printer *p);
> int xe_gt_sriov_pf_config_print_dbs(struct xe_gt *gt, struct drm_printer *p);
> +int xe_gt_sriov_pf_config_print_lmem(struct xe_gt *gt, struct drm_printer *p);
>
> int xe_gt_sriov_pf_config_print_available_ggtt(struct xe_gt *gt, struct drm_printer *p);
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c
> index 91fc42e386d8..05df4ab3514b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c
> @@ -81,6 +81,11 @@ static const struct drm_info_list pf_info[] = {
> .show = xe_gt_debugfs_simple_show,
> .data = xe_gt_sriov_pf_config_print_dbs,
> },
> + {
> + "lmem_provisioned",
> + .show = xe_gt_debugfs_simple_show,
> + .data = xe_gt_sriov_pf_config_print_lmem,
> + },
LGTM,
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
> {
> "runtime_registers",
> .show = xe_gt_debugfs_simple_show,
prev parent reply other threads:[~2024-10-22 11:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 20:15 [PATCH] drm/xe/pf: Show VFs LMEM provisioning summary over debugfs Michal Wajdeczko
2024-10-21 20:59 ` ✓ CI.Patch_applied: success for " Patchwork
2024-10-21 20:59 ` ✓ CI.checkpatch: " Patchwork
2024-10-21 21:00 ` ✓ CI.KUnit: " Patchwork
2024-10-21 21:12 ` ✓ CI.Build: " Patchwork
2024-10-21 21:14 ` ✓ CI.Hooks: " Patchwork
2024-10-21 21:15 ` ✓ CI.checksparse: " Patchwork
2024-10-21 21:34 ` ✓ CI.BAT: " Patchwork
2024-10-22 3:08 ` ✗ CI.FULL: failure " Patchwork
2024-10-22 18:01 ` Michal Wajdeczko
2024-10-22 11:01 ` Bernatowicz, Marcin [this message]
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=a8e41cc6-e54a-48b1-968b-64bd0245f662@linux.intel.com \
--to=marcin.bernatowicz@linux.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