All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 4/5] drm/xe/pf: Define admin_only as real flag
Date: Wed, 28 Jan 2026 16:56:47 +0100	[thread overview]
Message-ID: <20260128155647.ausmrdrtkfys75u2@intel.com> (raw)
In-Reply-To: <20260127210501.794-1-michal.wajdeczko@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on wto [2026-sty-27 22:05:01 +0100]:
> Instead of doing guesses each time during the runtime, set flag
> admin_only once during PF's initialization.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
> v2: update flag in kunit test (CI)
> ---
>  drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c | 2 +-
>  drivers/gpu/drm/xe/xe_sriov_pf.c                       | 6 ++++++
>  drivers/gpu/drm/xe/xe_sriov_pf_helpers.h               | 3 ++-
>  drivers/gpu/drm/xe/xe_sriov_pf_types.h                 | 3 +++
>  4 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
> index 42bfc4bcfbcf..3889dc3e49ca 100644
> --- a/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
> +++ b/drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
> @@ -15,7 +15,7 @@
>  static void pf_set_admin_mode(struct xe_device *xe, bool enable)
>  {
>  	/* should match logic of xe_sriov_pf_admin_only() */
> -	xe->info.probe_display = !enable;
> +	xe->sriov.pf.admin_only = enable;
>  	KUNIT_EXPECT_EQ(kunit_get_current_test(), enable, xe_sriov_pf_admin_only(xe));
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf.c b/drivers/gpu/drm/xe/xe_sriov_pf.c
> index 33bd754d138f..919f176a19eb 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf.c
> @@ -20,6 +20,11 @@
>  #include "xe_sriov_pf_sysfs.h"
>  #include "xe_sriov_printk.h"
>  
> +static bool wanted_admin_only(struct xe_device *xe)
> +{
> +	return !xe->info.probe_display;
> +}
> +
>  static unsigned int wanted_max_vfs(struct xe_device *xe)
>  {
>  	return xe_configfs_get_max_vfs(to_pci_dev(xe->drm.dev));
> @@ -74,6 +79,7 @@ bool xe_sriov_pf_readiness(struct xe_device *xe)
>  
>  	pf_reduce_totalvfs(xe, newlimit);
>  
> +	xe->sriov.pf.admin_only = wanted_admin_only(xe);
>  	xe->sriov.pf.device_total_vfs = totalvfs;
>  	xe->sriov.pf.driver_max_vfs = newlimit;
>  
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> index 9054fdc34597..0fcc6cec4afc 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_helpers.h
> @@ -56,7 +56,8 @@ static inline unsigned int xe_sriov_pf_num_vfs(const struct xe_device *xe)
>   */
>  static inline bool xe_sriov_pf_admin_only(const struct xe_device *xe)
>  {
> -	return !xe->info.probe_display;
> +	xe_assert(xe, IS_SRIOV_PF(xe));
> +	return xe->sriov.pf.admin_only;
>  }
>  
>  static inline struct mutex *xe_sriov_pf_master_mutex(struct xe_device *xe)
> diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_types.h b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> index b0253e1ae5da..080cf10512f4 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> +++ b/drivers/gpu/drm/xe/xe_sriov_pf_types.h
> @@ -36,6 +36,9 @@ struct xe_sriov_metadata {
>   * @XE_SRIOV_MODE_PF mode.
>   */
>  struct xe_device_pf {
> +	/** @admin_only: PF functionality focused on VFs management only. */
> +	bool admin_only;
> +
>  	/** @device_total_vfs: Maximum number of VFs supported by the device. */
>  	u16 device_total_vfs;


LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
>  
> -- 
> 2.47.1
> 

-- 

  reply	other threads:[~2026-01-28 15:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 21:42 [PATCH 0/5] drm/xe/configfs: Add sriov.admin_only_pf attribute Michal Wajdeczko
2026-01-21 21:42 ` [PATCH 1/5] drm/xe: Keep all defaults in single header Michal Wajdeczko
2026-01-23 10:29   ` Piotr Piórkowski
2026-02-03  0:11   ` Rodrigo Vivi
2026-02-03 11:13   ` Jani Nikula
2026-02-03 14:58     ` Michal Wajdeczko
2026-01-21 21:42 ` [PATCH 2/5] drm/xe/configfs: Use proper notation for local include Michal Wajdeczko
2026-01-23 10:29   ` Piotr Piórkowski
2026-01-21 21:42 ` [PATCH 3/5] drm/xe/configfs: Always return consistent max_vfs value Michal Wajdeczko
2026-01-28 15:51   ` Piotr Piórkowski
2026-01-21 21:42 ` [PATCH 4/5] drm/xe/pf: Define admin_only as real flag Michal Wajdeczko
2026-01-27 21:05   ` [PATCH v2 " Michal Wajdeczko
2026-01-28 15:56     ` Piotr Piórkowski [this message]
2026-01-21 21:42 ` [PATCH 5/5] drm/xe/configfs: Add sriov.admin_only_pf attribute Michal Wajdeczko
2026-01-28 16:35   ` Piotr Piórkowski
2026-01-28 23:42     ` Michal Wajdeczko
2026-01-21 22:25 ` ✗ CI.checkpatch: warning for " Patchwork
2026-01-21 22:26 ` ✗ CI.KUnit: failure " Patchwork
2026-01-27 21:34 ` ✗ CI.checkpatch: warning for drm/xe/configfs: Add sriov.admin_only_pf attribute (rev2) Patchwork
2026-01-27 21:35 ` ✓ CI.KUnit: success " Patchwork
2026-01-27 22:33 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-28  6:46 ` ✓ Xe.CI.Full: " 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=20260128155647.ausmrdrtkfys75u2@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.