[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZCQrOeX8WtQplYdZ@corigine.com>
Date: Wed, 29 Mar 2023 14:12:41 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Brett Creeley <brett.creeley@....com>
Cc: kvm@...r.kernel.org, netdev@...r.kernel.org,
alex.williamson@...hat.com, jgg@...dia.com, yishaih@...dia.com,
shameerali.kolothum.thodi@...wei.com, kevin.tian@...el.com,
shannon.nelson@....com, drivers@...sando.io
Subject: Re: [PATCH v6 vfio 1/7] vfio: Commonize combine_ranges for use in
other VFIO drivers
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@...dia.com>
> Signed-off-by: Brett Creeley <brett.creeley@....com>
> Signed-off-by: Shannon Nelson <shannon.nelson@....com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
> 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.
...
Powered by blists - more mailing lists