All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Laguna <lukasz.laguna@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: marcin.bernatowicz@linux.intel.com, michal.wajdeczko@intel.com,
	michal.winiarski@intel.com, satyanarayana.k.v.p@intel.com,
	adam.miszczak@linux.intel.com, jakub1.kolakowski@intel.com,
	lukasz.laguna@intel.com
Subject: [PATCH i-g-t 1/4] lib/igt_sriov_device: Add helper to iterate over enabled VFs
Date: Thu, 17 Jul 2025 11:08:09 +0200	[thread overview]
Message-ID: <20250717090812.28628-2-lukasz.laguna@intel.com> (raw)
In-Reply-To: <20250717090812.28628-1-lukasz.laguna@intel.com>

Helper allows to iterate over enabled VFs.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
 lib/igt_sriov_device.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/igt_sriov_device.h b/lib/igt_sriov_device.h
index 912449086..930e97982 100644
--- a/lib/igt_sriov_device.h
+++ b/lib/igt_sriov_device.h
@@ -87,6 +87,18 @@ igt_sriov_random_vf_in_range(int pf_fd, unsigned int start, unsigned int end)
 	     ++__vf_num)
 #define for_each_sriov_num_vfs for_each_sriov_vf
 
+/**
+ * for_each_sriov_enabled_vf - Helper for running code on each enabled VF
+ * @__pf_fd: PF device file descriptor
+ * @__vf_num: VFs iterator
+ *
+ * For loop that iterates over all enabled VFs associated with given PF @__pf_fd.
+ */
+#define for_each_sriov_enabled_vf(__pf_fd, __vf_num) \
+	for (unsigned int __vf_num = 1, __enabled_vfs = igt_sriov_get_enabled_vfs(__pf_fd); \
+	     __vf_num <= __enabled_vfs; \
+	     ++__vf_num)
+
 /**
  * for_each_sriov_vf_in_range - Iterate over VFs in a specified range
  * @__pf_fd: PF device file descriptor
-- 
2.40.0


  reply	other threads:[~2025-07-17  9:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  9:08 [PATCH i-g-t 0/4] Validate VF accesses to VRAM via BAR Lukasz Laguna
2025-07-17  9:08 ` Lukasz Laguna [this message]
2025-07-21 10:05   ` [PATCH i-g-t 1/4] lib/igt_sriov_device: Add helper to iterate over enabled VFs Piotr Piórkowski
2025-07-17  9:08 ` [PATCH i-g-t 2/4] lib/intel_vram: Add library for VRAM accesses Lukasz Laguna
2025-08-21 20:26   ` Bernatowicz, Marcin
2025-07-17  9:08 ` [PATCH i-g-t 3/4] tests/intel/xe_sriov_flr: Use VRAM access helpers from intel_vram library Lukasz Laguna
2025-08-21 20:30   ` Bernatowicz, Marcin
2025-07-17  9:08 ` [PATCH i-g-t 4/4] tests/intel/xe_sriov_vram: Add test checking VF access to VRAM Lukasz Laguna
2025-07-31  8:29   ` Piotr Piórkowski
2025-08-01 12:43     ` Laguna, Lukasz
2025-08-21 16:53   ` Bernatowicz, Marcin
2025-08-27 13:16     ` Laguna, Lukasz
2025-07-17 12:42 ` ✓ i915.CI.BAT: success for Validate VF accesses to VRAM via BAR Patchwork
2025-07-17 13:56 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-18  1:23 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-18 19:07 ` ✗ 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=20250717090812.28628-2-lukasz.laguna@intel.com \
    --to=lukasz.laguna@intel.com \
    --cc=adam.miszczak@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jakub1.kolakowski@intel.com \
    --cc=marcin.bernatowicz@linux.intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=michal.winiarski@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 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.