On 3/29/2023 5:12 AM, Simon Horman wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
On Mon, Mar 27, 2023 at 01:05:47PM -0700, Brett Creeley wrote:
Currently only Mellanox uses the combine_ranges function. The
new pds_vfio driver also needs this function. So, move it to
a common location for other vendor drivers to use.
Cc: Yishai Hadas <yishaih@xxxxxxxxxx>
Signed-off-by: Brett Creeley <brett.creeley@xxxxxxx>
Signed-off-by: Shannon Nelson <shannon.nelson@xxxxxxx>
Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
Hey Simon,
We really appreciate the reviews and I do have another small change that
I need to incorporate into one of the patches, so I will include all of
your feedback in v7.
I won't reply to each individual comment, but I looked through all of
them and they all make sense to me.
Thanks again for the review,
Brett
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c
index 43bd6b76e2b6..49f37c1b4932 100644
--- a/drivers/vfio/vfio_main.c
+++ b/drivers/vfio/vfio_main.c
@@ -864,6 +864,54 @@ static int vfio_ioctl_device_feature_migration(struct vfio_device *device,
return 0;
}
+void vfio_combine_iova_ranges(struct rb_root_cached *root, u32 cur_nodes,
+ u32 req_nodes)
+{
+ struct interval_tree_node *prev, *curr, *comb_start, *comb_end;
+ unsigned long min_gap;
+ unsigned long curr_gap;
I appreciate that this is just moving code from one place to another.
But if you end up respining this series for another reason
you may want to consider rearranging the above two lines so they are in
reverse xmas tree order - longest to shortest.
...