Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-29 Thread Jason Wang
在 2022/1/24 下午5:20, Eugenio Perez Martin 写道: On Mon, Jan 24, 2022 at 5:33 AM Peter Xu wrote: On Fri, Jan 21, 2022 at 09:27:23PM +0100, Eugenio Pérez wrote: +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, I forgot to s/iova_tree_alloc/iova_tree_alloc_map/ here. +

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-27 Thread Jason Wang
在 2022/1/28 上午11:57, Peter Xu 写道: On Thu, Jan 27, 2022 at 10:24:27AM +0100, Eugenio Perez Martin wrote: On Thu, Jan 27, 2022 at 9:06 AM Peter Xu wrote: On Tue, Jan 25, 2022 at 10:40:01AM +0100, Eugenio Perez Martin wrote: So I think that the first step to remove complexity from the old one

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-27 Thread Peter Xu
On Thu, Jan 27, 2022 at 10:24:27AM +0100, Eugenio Perez Martin wrote: > On Thu, Jan 27, 2022 at 9:06 AM Peter Xu wrote: > > > > On Tue, Jan 25, 2022 at 10:40:01AM +0100, Eugenio Perez Martin wrote: > > > So I think that the first step to remove complexity from the old one > > > is to remove

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-27 Thread Peter Xu
On Tue, Jan 25, 2022 at 10:40:01AM +0100, Eugenio Perez Martin wrote: > So I think that the first step to remove complexity from the old one > is to remove iova_begin and iova_end. > > As Jason points out, removing iova_end is easier. It has the drawback > of having to traverse all the list

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-24 Thread Peter Xu
On Mon, Jan 24, 2022 at 10:20:55AM +0100, Eugenio Perez Martin wrote: > On Mon, Jan 24, 2022 at 5:33 AM Peter Xu wrote: > > > > On Fri, Jan 21, 2022 at 09:27:23PM +0100, Eugenio Pérez wrote: > > > +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, > > I forgot to

Re: [PATCH 21/31] util: Add iova_tree_alloc

2022-01-23 Thread Peter Xu
On Fri, Jan 21, 2022 at 09:27:23PM +0100, Eugenio Pérez wrote: > +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, > +hwaddr iova_last) > +{ > +const DMAMapInternal *last, *i; > + > +assert(iova_begin < iova_last); > + > +/* > + * Find a valid