* [PATCH] iommu-groups: Add list_head for iommu groups
@ 2014-04-04 5:42 Ritesh Harjani
[not found] ` <CAD15agaN=ymK8JTPELNygF055r3zPyqmJ7bMVabL7pM8EusHjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Ritesh Harjani @ 2014-04-04 5:42 UTC (permalink / raw)
To: Joerg Roedel, David Woodhouse, Alex Williamson
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Hi All,
Please find the below patch and let me know your suggestions on this.
With this patch iommu groups can be linked and iommu driver will
get to know which all iommu groups belongs to a particular iommu device.
Each iommu device might have multiple iommu groups,
with each group populated with many devices. With
this configuration, iommu driver may require a list
of iommu groups belonging to each iommu device.
Add list_head struct entry in iommu_group.
Signed-off-by: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/iommu/iommu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index e5555fc..70588dc 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -36,6 +36,10 @@ static struct ida iommu_group_ida;
static struct mutex iommu_group_mutex;
struct iommu_group {
+ struct list_head list; /* lower level iommu driver structure
+ * may require list of iommu groups
+ * belonging to that iommu device.
+ */
struct kobject kobj;
struct kobject *devices_kobj;
struct list_head devices;
--
1.8.1.3
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <CAD15agaN=ymK8JTPELNygF055r3zPyqmJ7bMVabL7pM8EusHjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <CAD15agaN=ymK8JTPELNygF055r3zPyqmJ7bMVabL7pM8EusHjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-04-04 14:03 ` Alex Williamson [not found] ` <1396620219.3215.46.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Alex Williamson @ 2014-04-04 14:03 UTC (permalink / raw) To: Ritesh Harjani Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org On Fri, 2014-04-04 at 11:12 +0530, Ritesh Harjani wrote: > Hi All, > > Please find the below patch and let me know your suggestions on this. > > With this patch iommu groups can be linked and iommu driver will > get to know which all iommu groups belongs to a particular iommu device. > > > > Each iommu device might have multiple iommu groups, > with each group populated with many devices. With > this configuration, iommu driver may require a list > of iommu groups belonging to each iommu device. > > Add list_head struct entry in iommu_group. > > Signed-off-by: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > drivers/iommu/iommu.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index e5555fc..70588dc 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -36,6 +36,10 @@ static struct ida iommu_group_ida; > static struct mutex iommu_group_mutex; > > struct iommu_group { > + struct list_head list; /* lower level iommu driver structure > + * may require list of iommu groups > + * belonging to that iommu device. > + */ To have a list would require locking to manage that list, but you seem to imply that the iommu driver would be managing this list... but there might be multiple iommu drivers in a single system. Groups are currently independent of each other by design, trying to manage them in a list defeats that. There is also no example provided here of why we would need or even want to do this. Thanks, Alex > struct kobject kobj; > struct kobject *devices_kobj; > struct list_head devices; > -- > 1.8.1.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <1396620219.3215.46.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <1396620219.3215.46.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org> @ 2014-04-07 9:53 ` Ritesh Harjani [not found] ` <CAD15agZbUwvda+XG3hELJT5PQ_0j2Bya8Y9wOZcP5qg8binUzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Ritesh Harjani @ 2014-04-07 9:53 UTC (permalink / raw) To: Alex Williamson Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org On Fri, Apr 4, 2014 at 7:33 PM, Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > On Fri, 2014-04-04 at 11:12 +0530, Ritesh Harjani wrote: >> Hi All, >> >> Please find the below patch and let me know your suggestions on this. >> >> With this patch iommu groups can be linked and iommu driver will >> get to know which all iommu groups belongs to a particular iommu device. >> >> >> >> Each iommu device might have multiple iommu groups, >> with each group populated with many devices. With >> this configuration, iommu driver may require a list >> of iommu groups belonging to each iommu device. >> >> Add list_head struct entry in iommu_group. >> >> Signed-off-by: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> --- >> drivers/iommu/iommu.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c >> index e5555fc..70588dc 100644 >> --- a/drivers/iommu/iommu.c >> +++ b/drivers/iommu/iommu.c >> @@ -36,6 +36,10 @@ static struct ida iommu_group_ida; >> static struct mutex iommu_group_mutex; >> >> struct iommu_group { >> + struct list_head list; /* lower level iommu driver structure >> + * may require list of iommu groups >> + * belonging to that iommu device. >> + */ > > > To have a list would require locking to manage that list, but you seem > to imply that the iommu driver would be managing this list... but there > might be multiple iommu drivers in a single system. Groups are > currently independent of each other by design, trying to manage them in > a list defeats that. HOW ?? > There is also no example provided here of why we > would need or even want to do this. Thanks, Say multiple groups are linked to one iommu device. Each iommu_group maintains one iommu_data specific to their group. Now, if iommu driver of a iommu device wants to query all the iommu groups and thus all devices which belongs to this iommu hardware, then in that it will be nice if iommu_group struct provides a list_entry ? Thanks Ritesh > > Alex > >> struct kobject kobj; >> struct kobject *devices_kobj; >> struct list_head devices; >> -- >> 1.8.1.3 > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <CAD15agZbUwvda+XG3hELJT5PQ_0j2Bya8Y9wOZcP5qg8binUzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <CAD15agZbUwvda+XG3hELJT5PQ_0j2Bya8Y9wOZcP5qg8binUzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-04-07 14:14 ` Alex Williamson [not found] ` <1396880095.3215.89.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Alex Williamson @ 2014-04-07 14:14 UTC (permalink / raw) To: Ritesh Harjani Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org On Mon, 2014-04-07 at 15:23 +0530, Ritesh Harjani wrote: > On Fri, Apr 4, 2014 at 7:33 PM, Alex Williamson > <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > On Fri, 2014-04-04 at 11:12 +0530, Ritesh Harjani wrote: > >> Hi All, > >> > >> Please find the below patch and let me know your suggestions on this. > >> > >> With this patch iommu groups can be linked and iommu driver will > >> get to know which all iommu groups belongs to a particular iommu device. > >> > >> > >> > >> Each iommu device might have multiple iommu groups, > >> with each group populated with many devices. With > >> this configuration, iommu driver may require a list > >> of iommu groups belonging to each iommu device. > >> > >> Add list_head struct entry in iommu_group. > >> > >> Signed-off-by: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> --- > >> drivers/iommu/iommu.c | 4 ++++ > >> 1 file changed, 4 insertions(+) > >> > >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > >> index e5555fc..70588dc 100644 > >> --- a/drivers/iommu/iommu.c > >> +++ b/drivers/iommu/iommu.c > >> @@ -36,6 +36,10 @@ static struct ida iommu_group_ida; > >> static struct mutex iommu_group_mutex; > >> > >> struct iommu_group { > >> + struct list_head list; /* lower level iommu driver structure > >> + * may require list of iommu groups > >> + * belonging to that iommu device. > >> + */ > > > > > > To have a list would require locking to manage that list, but you seem > > to imply that the iommu driver would be managing this list... but there > > might be multiple iommu drivers in a single system. Groups are > > currently independent of each other by design, trying to manage them in > > a list defeats that. > > HOW ?? > > > There is also no example provided here of why we > > would need or even want to do this. Thanks, > > Say multiple groups are linked to one iommu device. Each iommu_group maintains > one iommu_data specific to their group. Now, if iommu driver of a > iommu device wants > to query all the iommu groups and thus all devices which belongs to > this iommu hardware, > then in that it will be nice if iommu_group struct provides a list_entry ? iommu_data is owned by the iommu driver, so if a driver wants to create such a list, why would it not do so there? What's being requested here is an extension to a private data structure with no concrete example of why this is needed. Current users don't seem to have any need for this. Furthermore struct iommu_group is intentionally opaque to everything outside of iommu.c, so without either relocating this structure to a header or adding a list service to the iommu group interfaces, the change is completely useless. Thanks, Alex ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <1396880095.3215.89.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <1396880095.3215.89.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org> @ 2014-04-07 16:24 ` Ritesh Harjani [not found] ` <CAD15agYF5TCNa-0COxx3Po+7h4aKa=EW2oou_gftacfOev6CJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Ritesh Harjani @ 2014-04-07 16:24 UTC (permalink / raw) To: Alex Williamson Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Yes, Alex. Thanks for the suggestions. Ritesh On Mon, Apr 7, 2014 at 7:44 PM, Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > On Mon, 2014-04-07 at 15:23 +0530, Ritesh Harjani wrote: >> On Fri, Apr 4, 2014 at 7:33 PM, Alex Williamson >> <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: >> > On Fri, 2014-04-04 at 11:12 +0530, Ritesh Harjani wrote: >> >> Hi All, >> >> >> >> Please find the below patch and let me know your suggestions on this. >> >> >> >> With this patch iommu groups can be linked and iommu driver will >> >> get to know which all iommu groups belongs to a particular iommu device. >> >> >> >> >> >> >> >> Each iommu device might have multiple iommu groups, >> >> with each group populated with many devices. With >> >> this configuration, iommu driver may require a list >> >> of iommu groups belonging to each iommu device. >> >> >> >> Add list_head struct entry in iommu_group. >> >> >> >> Signed-off-by: Ritesh Harjani <ritesh.harjani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> --- >> >> drivers/iommu/iommu.c | 4 ++++ >> >> 1 file changed, 4 insertions(+) >> >> >> >> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c >> >> index e5555fc..70588dc 100644 >> >> --- a/drivers/iommu/iommu.c >> >> +++ b/drivers/iommu/iommu.c >> >> @@ -36,6 +36,10 @@ static struct ida iommu_group_ida; >> >> static struct mutex iommu_group_mutex; >> >> >> >> struct iommu_group { >> >> + struct list_head list; /* lower level iommu driver structure >> >> + * may require list of iommu groups >> >> + * belonging to that iommu device. >> >> + */ >> > >> > >> > To have a list would require locking to manage that list, but you seem >> > to imply that the iommu driver would be managing this list... but there >> > might be multiple iommu drivers in a single system. Groups are >> > currently independent of each other by design, trying to manage them in >> > a list defeats that. >> >> HOW ?? >> >> > There is also no example provided here of why we >> > would need or even want to do this. Thanks, >> >> Say multiple groups are linked to one iommu device. Each iommu_group maintains >> one iommu_data specific to their group. Now, if iommu driver of a >> iommu device wants >> to query all the iommu groups and thus all devices which belongs to >> this iommu hardware, >> then in that it will be nice if iommu_group struct provides a list_entry ? > > iommu_data is owned by the iommu driver, so if a driver wants to create > such a list, why would it not do so there? What's being requested here > is an extension to a private data structure with no concrete example of > why this is needed. Current users don't seem to have any need for this. > Furthermore struct iommu_group is intentionally opaque to everything > outside of iommu.c, so without either relocating this structure to a > header or adding a list service to the iommu group interfaces, the > change is completely useless. Thanks, > > Alex > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <CAD15agYF5TCNa-0COxx3Po+7h4aKa=EW2oou_gftacfOev6CJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <CAD15agYF5TCNa-0COxx3Po+7h4aKa=EW2oou_gftacfOev6CJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2014-04-08 10:18 ` Joerg Roedel [not found] ` <20140408101800.GS13491-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Joerg Roedel @ 2014-04-08 10:18 UTC (permalink / raw) To: Ritesh Harjani Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org On Mon, Apr 07, 2014 at 09:54:54PM +0530, Ritesh Harjani wrote: > On Mon, Apr 7, 2014 at 7:44 PM, Alex Williamson > <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > > On Mon, 2014-04-07 at 15:23 +0530, Ritesh Harjani wrote: > >> Say multiple groups are linked to one iommu device. Each iommu_group maintains > >> one iommu_data specific to their group. Now, if iommu driver of a > >> iommu device wants > >> to query all the iommu groups and thus all devices which belongs to > >> this iommu hardware, > >> then in that it will be nice if iommu_group struct provides a list_entry ? > > > > iommu_data is owned by the iommu driver, so if a driver wants to create > > such a list, why would it not do so there? What's being requested here > > is an extension to a private data structure with no concrete example of > > why this is needed. Current users don't seem to have any need for this. > > Furthermore struct iommu_group is intentionally opaque to everything > > outside of iommu.c, so without either relocating this structure to a > > header or adding a list service to the iommu group interfaces, the > > change is completely useless. Thanks, I agree with Alex. Besides, when submitting such a change please also include the code that makes use of it. Only then we can see if the change is really necessary. Joerg ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20140408101800.GS13491-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] iommu-groups: Add list_head for iommu groups [not found] ` <20140408101800.GS13491-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> @ 2014-04-08 10:33 ` Ritesh Harjani 0 siblings, 0 replies; 7+ messages in thread From: Ritesh Harjani @ 2014-04-08 10:33 UTC (permalink / raw) To: Joerg Roedel Cc: David Woodhouse, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Sure Joerg, Thanks Ritesh On Tue, Apr 8, 2014 at 3:48 PM, Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> wrote: > On Mon, Apr 07, 2014 at 09:54:54PM +0530, Ritesh Harjani wrote: >> On Mon, Apr 7, 2014 at 7:44 PM, Alex Williamson >> <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: >> > On Mon, 2014-04-07 at 15:23 +0530, Ritesh Harjani wrote: >> >> Say multiple groups are linked to one iommu device. Each iommu_group maintains >> >> one iommu_data specific to their group. Now, if iommu driver of a >> >> iommu device wants >> >> to query all the iommu groups and thus all devices which belongs to >> >> this iommu hardware, >> >> then in that it will be nice if iommu_group struct provides a list_entry ? >> > >> > iommu_data is owned by the iommu driver, so if a driver wants to create >> > such a list, why would it not do so there? What's being requested here >> > is an extension to a private data structure with no concrete example of >> > why this is needed. Current users don't seem to have any need for this. >> > Furthermore struct iommu_group is intentionally opaque to everything >> > outside of iommu.c, so without either relocating this structure to a >> > header or adding a list service to the iommu group interfaces, the >> > change is completely useless. Thanks, > > I agree with Alex. Besides, when submitting such a change please also > include the code that makes use of it. Only then we can see if the > change is really necessary. > > > Joerg > > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-04-08 10:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04 5:42 [PATCH] iommu-groups: Add list_head for iommu groups Ritesh Harjani
[not found] ` <CAD15agaN=ymK8JTPELNygF055r3zPyqmJ7bMVabL7pM8EusHjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-04 14:03 ` Alex Williamson
[not found] ` <1396620219.3215.46.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-07 9:53 ` Ritesh Harjani
[not found] ` <CAD15agZbUwvda+XG3hELJT5PQ_0j2Bya8Y9wOZcP5qg8binUzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-07 14:14 ` Alex Williamson
[not found] ` <1396880095.3215.89.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-07 16:24 ` Ritesh Harjani
[not found] ` <CAD15agYF5TCNa-0COxx3Po+7h4aKa=EW2oou_gftacfOev6CJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-08 10:18 ` Joerg Roedel
[not found] ` <20140408101800.GS13491-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-04-08 10:33 ` Ritesh Harjani
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.