Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-15 Thread Auger Eric
Hi Peter, On 1/15/20 3:59 PM, Peter Xu wrote: > On Wed, Jan 15, 2020 at 02:00:22PM +0100, Auger Eric wrote: >> Hi Peter, >> >> >> On 1/14/20 7:07 PM, Peter Xu wrote: >>> On Tue, Jan 14, 2020 at 09:51:59AM +0100, Auger Eric wrote: Hi Peter, >>> >>> Hi, Eric, >>> >>> [...] >>> > >> +{ >

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-15 Thread Peter Xu
On Wed, Jan 15, 2020 at 02:00:22PM +0100, Auger Eric wrote: > Hi Peter, > > > On 1/14/20 7:07 PM, Peter Xu wrote: > > On Tue, Jan 14, 2020 at 09:51:59AM +0100, Auger Eric wrote: > >> Hi Peter, > > > > Hi, Eric, > > > > [...] > > > >>> > +{ > +VirtIOIOMMUEndpoint *ep; > + > >

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-15 Thread Auger Eric
Hi Peter, On 1/14/20 7:07 PM, Peter Xu wrote: > On Tue, Jan 14, 2020 at 09:51:59AM +0100, Auger Eric wrote: >> Hi Peter, > > Hi, Eric, > > [...] > >>> +{ +VirtIOIOMMUEndpoint *ep; + +ep = g_tree_lookup(s->endpoints, GUINT_TO_POINTER(ep_id)); +if (ep) { +

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-15 Thread Auger Eric
Hi Peter, On 1/14/20 7:07 PM, Peter Xu wrote: > On Tue, Jan 14, 2020 at 09:51:59AM +0100, Auger Eric wrote: >> Hi Peter, > > Hi, Eric, > > [...] > >>> +{ +VirtIOIOMMUEndpoint *ep; + +ep = g_tree_lookup(s->endpoints, GUINT_TO_POINTER(ep_id)); +if (ep) {

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-14 Thread Peter Xu
On Tue, Jan 14, 2020 at 09:51:59AM +0100, Auger Eric wrote: > Hi Peter, Hi, Eric, [...] > > > >> +{ > >> +VirtIOIOMMUEndpoint *ep; > >> + > >> +ep = g_tree_lookup(s->endpoints, GUINT_TO_POINTER(ep_id)); > >> +if (ep) { > >> +return ep; > >> +} > >> +if (!virtio_iommu

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-14 Thread Auger Eric
Hi Peter, On 1/13/20 9:23 PM, Peter Xu wrote: > On Thu, Jan 09, 2020 at 03:43:11PM +0100, Eric Auger wrote: > > [...] > >> +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t >> ep_id); >> +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t >> ep_id) >

Re: [PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-13 Thread Peter Xu
On Thu, Jan 09, 2020 at 03:43:11PM +0100, Eric Auger wrote: [...] > +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t > ep_id); > +VirtIOIOMMUEndpoint *virtio_iommu_get_endpoint(VirtIOIOMMU *s, uint32_t > ep_id) Is the extra definition trying to workaround the compiler w

[PATCH v12 05/13] virtio-iommu: Endpoint and domains structs and helpers

2020-01-09 Thread Eric Auger
This patch introduce domain and endpoint internal datatypes. Both are stored in RB trees. The domain owns a list of endpoints attached to it. Helpers to get/put end points and domains are introduced. get() helpers will become static in subsequent patches. Signed-off-by: Eric Auger --- v11 -> v