Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Piórkowski, Piotr" <piotr.piorkowski@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Matt Atwood <matthew.s.atwood@intel.com>,
	Satyanarayana K V P <satyanarayana.k.v.p@intel.com>,
	Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>,
	Varun Gupta <varun.gupta@intel.com>
Subject: Re: [PATCH v3 1/5] drm/xe/vf: Don't use multi-queue if it is disabled in GuC
Date: Thu, 3 Dec 2026 21:08:57 -0500	[thread overview]
Message-ID: <axIguZ8ZHNm4kilH@intel.com> (raw)
In-Reply-To: <20261203231835.437637-2-piotr.piorkowski@intel.com>

On Fri, Dec 04, 2026 at 12:18:31AM +0100, Piórkowski, Piotr wrote:
> From: Piotr Piórkowski <piotr.piorkowski@intel.com>
> 
> Multi-queue can be disabled via configfs on the PF, which also disables
> it in the GuC shared with the VFs. A VF only knows its own configfs
> setting, so it may still try to use multi-queue.
> 
> Query GUC_FEATURE_KLV_DISABLE_MULTI_QUEUE from the GuC at VF probe and
> clear the multi-queue engine class mask if multi-queue is disabled. If
> the GuC can't report it, keep multi-queue enabled as before.
> 
> Add xe_gt_disable_multi_queue() for that and use it also when
> multi-queue is disabled via configfs.
> 
> Cc: Matt Atwood <matthew.s.atwood@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
> Cc: Tangudu Tilak Tirumalesh <tilak.tirumalesh.tangudu@intel.com>
> Cc: Varun Gupta <varun.gupta@intel.com>
> Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt.h          | 10 ++++++++
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 38 +++++++++++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_gt_sriov_vf.h |  1 +
>  drivers/gpu/drm/xe/xe_guc.c         |  2 ++
>  drivers/gpu/drm/xe/xe_pci.c         |  2 +-
>  5 files changed, 52 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.h b/drivers/gpu/drm/xe/xe_gt.h
> index 1c701dd98edc3..d4784e49420f3 100644
> --- a/drivers/gpu/drm/xe/xe_gt.h
> +++ b/drivers/gpu/drm/xe/xe_gt.h
> @@ -176,4 +176,14 @@ static inline bool xe_gt_has_multi_queue(const struct xe_gt *gt)
>  	return gt && gt->info.multi_queue_engine_class_mask;
>  }
>  
> +/**
> + * xe_gt_disable_multi_queue() - Disable multi-queue on all engine classes.
> + *
> + * @gt: the GT object
> + */
> +static inline void xe_gt_disable_multi_queue(struct xe_gt *gt)
> +{
> +	gt->info.multi_queue_engine_class_mask = 0;
> +}
> +
>  #endif
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> index 60f1b29358f93..6cad30e4a892b 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
> @@ -19,6 +19,7 @@
>  #include "xe_assert.h"
>  #include "xe_device.h"
>  #include "xe_ggtt.h"
> +#include "xe_gt.h"
>  #include "xe_gt_sriov_printk.h"
>  #include "xe_gt_sriov_vf.h"
>  #include "xe_gt_sriov_vf_types.h"
> @@ -728,6 +729,43 @@ int xe_gt_sriov_vf_query_config(struct xe_gt *gt)
>  	return 0;
>  }
>  
> +/**
> + * xe_gt_sriov_vf_check_multi_queue() - Check if multi-queue is enabled in GuC.
> + * @gt: the &xe_gt
> + *
> + * The GuC is shared with the PF, which may have disabled multi-queue in it.
> + * Query the GuC and don't use multi-queue on the VF if it is disabled there.
> + * If the GuC can't report it, assume multi-queue is enabled.
> + *
> + * This function is for VF use only.
> + */
> +void xe_gt_sriov_vf_check_multi_queue(struct xe_gt *gt)
> +{
> +	u32 disabled;
> +	int err;
> +
> +	xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
> +
> +	if (!xe_gt_has_multi_queue(gt))
> +		return;
> +
> +	err = guc_action_query_single_klv32(&gt->uc.guc,
> +					    GUC_FEATURE_KLV_DISABLE_MULTI_QUEUE,
> +					    &disabled);
> +	if (err) {
> +		xe_gt_sriov_dbg(gt, "Failed to query multi-queue status (%pe), assuming enabled\n",
> +				ERR_PTR(err));
> +		return;
> +	}
> +
> +	xe_gt_sriov_dbg(gt, "multi-queue %s\n", str_enabled_disabled(!disabled));
> +
> +	if (disabled) {
> +		xe_gt_sriov_info(gt, "Multi-queue disabled by the PF\n");
> +		xe_gt_disable_multi_queue(gt);
> +	}
> +}
> +
>  /**
>   * xe_gt_sriov_vf_sched_groups_enabled() - Check if PF has enabled multiple
>   * scheduler groups
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> index d171a8242a342..89226420884a7 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.h
> @@ -19,6 +19,7 @@ void xe_gt_sriov_vf_guc_versions(struct xe_gt *gt,
>  				 struct xe_uc_fw_version *wanted,
>  				 struct xe_uc_fw_version *found);
>  int xe_gt_sriov_vf_query_config(struct xe_gt *gt);
> +void xe_gt_sriov_vf_check_multi_queue(struct xe_gt *gt);
>  int xe_gt_sriov_vf_connect(struct xe_gt *gt);
>  int xe_gt_sriov_vf_query_runtime(struct xe_gt *gt);
>  void xe_gt_sriov_vf_migrated_event_handler(struct xe_gt *gt);
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index 00df83460022d..2201038774138 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -763,6 +763,8 @@ static int vf_guc_init_noalloc(struct xe_guc *guc)
>  	if (err)
>  		return err;
>  
> +	xe_gt_sriov_vf_check_multi_queue(gt);
> +
>  	return 0;
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 0c6bc82d917ba..b319abf7009eb 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -932,7 +932,7 @@ static struct xe_gt *alloc_primary_gt(struct xe_tile *tile,
>  	gt->info.multi_queue_engine_class_mask = graphics_desc->multi_queue_engine_class_mask;
>  	if (!xe_configfs_get_enable_multi_queue(to_pci_dev(xe->drm.dev))) {
>  		xe_gt_info(gt, "Multi-queue disabled via configfs\n");
> -		gt->info.multi_queue_engine_class_mask = 0;
> +		xe_gt_disable_multi_queue(gt);
>  	}
>  	gt->info.engine_mask = graphics_desc->hw_engine_mask;
>  	gt->info.num_geometry_xecore_fuse_regs = graphics_desc->num_geometry_xecore_fuse_regs;
> -- 
> 2.34.1
> 

  reply	other threads:[~2026-12-04  2:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 23:18 [PATCH v3 0/5] Apply Wa_14028597154 to SR-IOV VF Piórkowski, Piotr
2026-12-03 23:18 ` [PATCH v3 1/5] drm/xe/vf: Don't use multi-queue if it is disabled in GuC Piórkowski, Piotr
2026-12-04  2:08   ` Rodrigo Vivi [this message]
2026-12-03 23:18 ` [PATCH v3 2/5] drm/xe/ggtt: Align shareable GGTT nodes by GGTT address Piórkowski, Piotr
2026-12-03 23:18 ` [PATCH v3 3/5] drm/xe/tests: Test shareable GGTT alignment " Piórkowski, Piotr
2026-12-03 23:18 ` [PATCH v3 4/5] drm/xe/xe3p_lpg: Apply Wa_14028597154 to SR-IOV PF Piórkowski, Piotr
2026-12-03 23:18 ` [PATCH v3 5/5] drm/xe/xe3p_lpg: Apply Wa_14028597154 to SR-IOV VF Piórkowski, Piotr
2026-12-04  2:09   ` Rodrigo Vivi
2026-12-03 23:28 ` ✓ CI.KUnit: success for Apply Wa_14028597154 to SR-IOV VF (rev3) Patchwork
2026-12-04  0:03 ` ✓ Xe.CI.BAT: " 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=axIguZ8ZHNm4kilH@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.s.atwood@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=satyanarayana.k.v.p@intel.com \
    --cc=tilak.tirumalesh.tangudu@intel.com \
    --cc=varun.gupta@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