Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Marcin Bernatowicz" <marcin.bernatowicz@linux.intel.com>,
	"Adam Miszczak" <adam.miszczak@linux.intel.com>,
	"Jakub Kolakowski" <jakub1.kolakowski@intel.com>,
	"Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
	"Lukasz Laguna" <lukasz.laguna@intel.com>,
	"Piotr Piórkowski" <piotr.piorkowski@intel.com>,
	"Satyanarayana K V P" <satyanarayana.k.v.p@intel.com>
Subject: [PATCH i-g-t 2/2] tests/intel/xe_sriov_flr: Use xe_for_each_gt() for GT iteration
Date: Mon,  8 Sep 2025 18:07:23 +0200	[thread overview]
Message-ID: <20250908160723.1723178-3-marcin.bernatowicz@linux.intel.com> (raw)
In-Reply-To: <20250908160723.1723178-1-marcin.bernatowicz@linux.intel.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1613 bytes --]

Switch from indexing with num_gts to xe_for_each_gt(),
ensuring we use real GT IDs from gt_mask and not assume
sequential numbering.

Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Adam Miszczak <adam.miszczak@linux.intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Cc: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
---
 tests/intel/xe_sriov_flr.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_sriov_flr.c b/tests/intel/xe_sriov_flr.c
index 448b63521..2138debfe 100644
--- a/tests/intel/xe_sriov_flr.c
+++ b/tests/intel/xe_sriov_flr.c
@@ -1012,13 +1012,13 @@ static void clear_tests(int pf_fd, int num_vfs, flr_exec_strategy exec_strategy)
 	};
 	const unsigned int num_checks = num_gts + 3;
 	struct subcheck checks[num_checks];
-	int i;
+	int i = 0, gt_id;
 
 	memset(mmio, 0, sizeof(mmio));
 
-	for (i = 0; i < num_gts; ++i) {
+	xe_for_each_gt(pf_fd, gt_id) {
 		gdata[i] = (struct ggtt_data){
-			.base = { .pf_fd = pf_fd, .num_vfs = num_vfs, .gt = i },
+			.base = { .pf_fd = pf_fd, .num_vfs = num_vfs, .gt = gt_id },
 			.mmio = &xemmio
 		};
 		checks[i] = (struct subcheck){
@@ -1029,6 +1029,7 @@ static void clear_tests(int pf_fd, int num_vfs, flr_exec_strategy exec_strategy)
 			.verify_vf = ggtt_subcheck_verify_vf,
 			.cleanup = ggtt_subcheck_cleanup
 		};
+		i++;
 	}
 	checks[i++] = (struct subcheck) {
 		.data = (struct subcheck_data *)&ldata,
-- 
2.31.1


  parent reply	other threads:[~2025-09-08 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 16:07 [PATCH i-g-t 0/2] Don’t assume sequential GT IDs Marcin Bernatowicz
2025-09-08 16:07 ` [PATCH i-g-t 1/2] lib/xe/xe_query: Don’t assume sequential GT IDs in xe_gt_type() Marcin Bernatowicz
2025-09-09  8:23   ` Kamil Konieczny
2025-09-08 16:07 ` Marcin Bernatowicz [this message]
2025-09-09  8:26   ` [PATCH i-g-t 2/2] tests/intel/xe_sriov_flr: Use xe_for_each_gt() for GT iteration Kamil Konieczny
2025-09-09  2:38 ` ✓ i915.CI.BAT: success for Don’t assume sequential GT IDs Patchwork
2025-09-09  2:57 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-09 10:43 ` ✗ Xe.CI.Full: failure " Patchwork
2025-09-09 13:57   ` Bernatowicz, Marcin
2025-09-09 18:13 ` ✗ i915.CI.Full: " Patchwork
2025-09-10  7:45   ` Bernatowicz, Marcin

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=20250908160723.1723178-3-marcin.bernatowicz@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=adam.miszczak@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jakub1.kolakowski@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=lukasz.laguna@intel.com \
    --cc=piotr.piorkowski@intel.com \
    --cc=satyanarayana.k.v.p@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