Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Thomas Hellstrom <thomas.hellstrom@linux.intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [RFC] drm/xe: Add separate Kconfig file for SR-IOV options
Date: Mon, 21 Oct 2024 10:12:42 +0200	[thread overview]
Message-ID: <20241021081242.1727-1-michal.wajdeczko@intel.com> (raw)

There are few SR-IOV config options that we want to define:

 - DRM_XE_SRIOV_VF to allow compile-out support for the SR-IOV
   Virtual Function (VF)
 - DRM_XE_SRIOV_PF to allow compile-out support for the SR-IOV
   Physical Function (PF)

and for use by PF only:

 - DRM_XE_SRIOV_DEFAULT_SCHEDULING_[FLEXIBLE|FIXED|CUSTOM]
   to select preferred scheduling method using either predefined
   parameter values, or custom values
 - DRM_XE_SRIOV_DEFAULT_PF_[EXEC_QUANTUM_MS|PREEMPT_TIMEOUT_US]
   to define default execution quantum/preempt timeout for the PF
 - DRM_XE_SRIOV_DEFAULT_VF_[EXEC_QUANTUM_MS|PREEMPT_TIMEOUT_US]
   to define default execution quantum/preempt timeout for the VF
 - DRM_XE_SRIOV_DEFAULT_POLICY_[SCHED_IF_IDLE|RESET_ENGINE]
   to define default values for advanced scheduling policies

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/Kconfig       |   5 ++
 drivers/gpu/drm/xe/Kconfig.sriov | 140 +++++++++++++++++++++++++++++++
 2 files changed, 145 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/Kconfig.sriov

diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index bac96c0dd66e..cd68eda9ca79 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -87,6 +87,11 @@ config DRM_XE_FORCE_PROBE
 
 	  Use "!*" to block the probe of the driver for all known devices.
 
+menu "SR-IOV Configuration"
+depends on DRM_XE
+source "drivers/gpu/drm/xe/Kconfig.sriov"
+endmenu
+
 menu "drm/Xe Debugging"
 depends on DRM_XE
 depends on EXPERT
diff --git a/drivers/gpu/drm/xe/Kconfig.sriov b/drivers/gpu/drm/xe/Kconfig.sriov
new file mode 100644
index 000000000000..3bd3eee51e9f
--- /dev/null
+++ b/drivers/gpu/drm/xe/Kconfig.sriov
@@ -0,0 +1,140 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_XE_SRIOV_VF
+	bool
+	prompt "Virtual Function (VF) support"
+	default y
+	help
+	    Disable this option only if you want to compile out the SR-IOV VF support.
+	    Without SR-IOV VF support, driver can still be used in native mode.
+	    This option does not impact the support for the PF mode (if enabled).
+
+	    If in doubt, select "Y".
+
+config DRM_XE_SRIOV_PF
+	bool
+	prompt "Physical Function (PF) support" if PCI_IOV=y
+	default PCI_IOV
+	help
+	    Disable this option only if you want to compile out the SR-IOV PF support.
+	    Without SR-IOV PF support, driver can still be used in native mode.
+	    This option does not impact the support for the VF mode (if enabled).
+
+	    If in doubt, select "Y".
+
+if DRM_XE_SRIOV_PF
+
+choice
+	prompt "Default Scheduling Profile"
+	default DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+	help
+	    Select preferred scheduling profile to applied by default.
+	    Choose "Flexible" if maximizing the GPU usage is preferred.
+	    Choose "Fixed" if consitent VF execution time is required.
+	    Choose "Custom" to define all scheduling parameters.
+
+	    If in doubt, select "Flexible".
+
+	config DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+		bool "Flexible"
+		help
+		    Use this config to prefer flexible scheduling method.
+		    This config will predefine default scheduling parameters
+		    to maximize the GPU usage that may cause some fluctuations
+		    between VF execution slots.
+
+	config DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+		bool "Fixed"
+		help
+		    Use this config to prefer fixed scheduling method.
+		    This config will predefine default scheduling parameters
+		    in a such a way that all VFs execution time slots will
+		    be consistent.
+
+	config DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+		bool "Custom"
+		help
+		    Use this config to define custom default scheduling parameters.
+		    This config is mostly needed only if specific scheduling
+		    parameters are required without involving any manual
+		    provisioning over sysfs or debugfs interfaces.
+
+endchoice
+
+config DRM_XE_SRIOV_DEFAULT_PF_EXEC_QUANTUM_MS
+	int
+	range 0 100000
+	prompt "Default PF execution quantum (ms)" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+	default 20 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+	default 20 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+	default 0 # unlimited
+	help
+	    Use this config to define default PF execution-quantum provisioning.
+	    The value (in millisecond) indicates the amount of time the workloads
+	    from the PF can run on the GPU.
+	    Value 0 represents _infinity_ execution-quantum.
+
+config DRM_XE_SRIOV_DEFAULT_PF_PREEMPT_TIMEOUT_US
+	int
+	range 0 100000000
+	prompt "Default PF preemption timeout (us)" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+	default 20000 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+	default 20000 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+	default 0 # unlimited
+	help
+	    Use this config to define default PF preemption timeout provisioning.
+	    The value (in microseconds) indicates the amount of time the GPU scheduler
+	    will wait for the PF workload (context) to yield to other VF.
+	    Value 0 represents _infinity_ preemption timeout.
+
+config DRM_XE_SRIOV_DEFAULT_VF_EXEC_QUANTUM_MS
+	int
+	range 0 100000
+	prompt "Default VF execution quantum (ms)" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+	default 32 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+	default 16 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+	default 0 # unlimited
+	help
+	    Use this config to define default VF execution-quantum provisioning.
+	    The value (in millisecond) indicates the amount of time the workloads
+	    from the VF can run on the GPU.
+	    Value 0 represents _infinity_ execution-quantum.
+
+config DRM_XE_SRIOV_DEFAULT_VF_PREEMPT_TIMEOUT_US
+	int
+	range 0 100000000
+	prompt "Default VF preemption timeout (us)" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+	default 32000 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FLEXIBLE
+	default 16000 if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+	default 0 # unlimited
+	help
+	    Use this config to define default VF preemption timeout provisioning.
+	    The value (in microseconds) indicates the amount of time the GPU scheduler
+	    will wait for the VF workload (context) to yield to other VF.
+	    Value 0 represents _infinity_ preemption timeout.
+
+config DRM_XE_SRIOV_DEFAULT_POLICY_SCHED_IF_IDLE
+	bool
+	prompt "Default schedule-if-idle policy" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM
+	default y if DRM_XE_SRIOV_DEFAULT_SCHEDULING_FIXED
+	default n
+	help
+	    Enable this config to turn on the strict scheduling policy by default.
+	    When this policy is enabled, VFs that do not have work to submit are
+	    still allocated a fixed execution time-slice to ensure all active VFs
+	    execution is always consistent.
+
+	    If in doubt, say "N".
+
+config DRM_XE_SRIOV_DEFAULT_POLICY_RESET_ENGINE
+	bool
+	prompt "Default reset-engine policy" if DRM_XE_SRIOV_DEFAULT_SCHEDULING_CUSTOM && EXPERT
+	default n
+	help
+	    Enable this config to turn on the engine reset policy by default.
+	    When this policy is enabled, GPU engines will be reset by the GuC
+	    on each VF switch to enforce cleanup of any stale HW register state.
+
+	    If in doubt, say "N".
+
+endif # DRM_XE_SRIOV_PF
-- 
2.43.0


             reply	other threads:[~2024-10-21  8:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  8:12 Michal Wajdeczko [this message]
2024-10-21  8:25 ` ✓ CI.Patch_applied: success for drm/xe: Add separate Kconfig file for SR-IOV options Patchwork
2024-10-21  8:26 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-21  8:28 ` ✓ CI.KUnit: success " Patchwork
2024-10-21  8:39 ` ✓ CI.Build: " Patchwork
2024-10-21  8:42 ` ✓ CI.Hooks: " Patchwork
2024-10-21  8:43 ` ✓ CI.checksparse: " Patchwork
2024-10-21  9:11 ` ✓ CI.BAT: " Patchwork
2024-10-21 11:42 ` ✗ CI.FULL: failure " Patchwork
2024-10-22 21:39 ` [RFC] " Rodrigo Vivi

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=20241021081242.1727-1-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.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