diff options
author | 2024-08-30 15:21:00 +0200 | |
---|---|---|
committer | 2024-09-02 20:51:03 +0200 | |
commit | da6ec743397702e0b551bcacfeaa48829d303a29 (patch) | |
tree | 733e6e8b29a81407fc8816eccd21b847e61f873b | |
parent | drm/xe/pf: Add thresholds to the VF KLV config (diff) | |
download | wireguard-linux-da6ec743397702e0b551bcacfeaa48829d303a29.tar.xz wireguard-linux-da6ec743397702e0b551bcacfeaa48829d303a29.zip |
drm/xe/pf: Reset thresholds when releasing a VF config
As part of the VF config release, we should reset all parameters,
including thresholds, to always start with the clean VF config.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240830132100.1704-3-michal.wajdeczko@intel.com
-rw-r--r-- | drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 13 |
1 files changed, 13 insertions, 0 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 151eb69ab4ae..a95e546b7744 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c @@ -1842,6 +1842,18 @@ u32 xe_gt_sriov_pf_config_get_threshold(struct xe_gt *gt, unsigned int vfid, return value; } +static void pf_reset_config_thresholds(struct xe_gt *gt, struct xe_gt_sriov_config *config) +{ + lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt)); + +#define reset_threshold_config(TAG, ...) ({ \ + config->thresholds[MAKE_XE_GUC_KLV_THRESHOLD_INDEX(TAG)] = 0; \ +}); + + MAKE_XE_GUC_KLV_THRESHOLDS_SET(reset_threshold_config); +#undef reset_threshold_config +} + static void pf_release_vf_config(struct xe_gt *gt, unsigned int vfid) { struct xe_gt_sriov_config *config = pf_pick_vf_config(gt, vfid); @@ -1857,6 +1869,7 @@ static void pf_release_vf_config(struct xe_gt *gt, unsigned int vfid) pf_release_config_ctxs(gt, config); pf_release_config_dbs(gt, config); pf_reset_config_sched(gt, config); + pf_reset_config_thresholds(gt, config); } /** |