From mboxrd@z Thu Jan 1 00:00:00 1970 From: srikanth TS Subject: (unknown) Date: Tue, 25 Feb 2014 20:20:11 +0900 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1273758895620802496==" Return-path: Subject: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Will Deacon Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, sungjinn.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ts.srikanth-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org List-Id: iommu@lists.linux-foundation.org --===============1273758895620802496== Content-Type: multipart/alternative; boundary=089e0111bbd67c2e5b04f339457a --089e0111bbd67c2e5b04f339457a Content-Type: text/plain; charset=ISO-8859-1 On Feb 25, 2014 2:28 AM, "Will Deacon" wrote: > > On Mon, Feb 24, 2014 at 03:12:21PM +0000, srikanth TS wrote: > > Hi Will Deacon, > > Hello, > > > Currently SMMU driver expecting all stream ID used by respective master > > should be defined in the DT. > > > > We want to know how to handle in the case of virtual functions dynamically > > created and destroyed. > > > > Is PCI driver responsible for creating stream ID respective BDand > > requesting SMMU to add to the mapping table[stream Id to context mapping > > table]? > > > > Or is there any right way of doing it? > > Correct, the driver currently doesn't support dynamic mappings (mainly > because I didn't want to try and invent something that I couldn't test). > > There are a couple of ways to solve this: > > (1) Add a way for a PCI RC to dynamically allocate StreamIDs on an SMMU > within a fixed range. That would probably need some code in the bus > layer, so that a bus notifier can kick and call back to the relevant > SMMU. I think first way of solving seems to be better, because we don't know how many VF are used and i feel its not good idea to keep whole list of streamID [which is equal to max num vf] in DT. Again in this method we need to generate the stream ID dynamically whenever VF is added in pci iov driver side. And then pass that stream ID to SMMU. Is it ok this way? Or you prefer 2nd way which is simpler. > > (2) Describe the RID -> SID mapping in the device-tree. We probably want > to avoid an enormous table, so this would only work for simple `SID = > RID + offset' or 'SID = RID & mask' cases. > > How do your IDs map to each other? > > Will -srikanth ts --089e0111bbd67c2e5b04f339457a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Feb 25, 2014 2:28 AM, "Will Deacon" <will.deacon-5wv7dgnIgG8@public.gmane.org&g= t; wrote:
>
> On Mon, Feb 24, 2014 at 03:12:21PM +0000, srikanth TS wrote:> > Hi Will Deacon,
>
> Hello,
>
> > Cur= rently SMMU driver expecting all stream ID used by respective master
> > should be defined in the DT.
> >
> > We want to= know how to handle in the case of virtual functions dynamically
> &g= t; created and destroyed.
> >
> > Is PCI driver responsib= le for creating stream ID respective BDand
> > requesting SMMU to add to the mapping table[stream Id to context = mapping
> > table]?
> >
> > Or is there any righ= t way of doing it?
>
> Correct, the driver currently doesn'= t support dynamic mappings (mainly
> because I didn't want to try and invent something that I couldn= 9;t test).
>
> There are a couple of ways to solve this:
>= ;
> =A0 (1) Add a way for a PCI RC to dynamically allocate StreamIDs = on an SMMU
> =A0 =A0 =A0 within a fixed range. That would probably need some code i= n the bus
> =A0 =A0 =A0 layer, so that a bus notifier can kick and ca= ll back to the relevant
> =A0 =A0 =A0 SMMU.

I think first way of solving seems to be better, because we don't know = how many

VF are used and i feel its not good idea to keep whole list of stream= ID=A0[which is=A0

equal = to max num vf] in DT. Again in this method we need to generate the stream I= D

d= ynamically whenever VF is added in pci iov driver side. And then pass that= =A0

stream= ID to SMMU.

Is it ok this way? =A0Or you prefer 2nd way which is simpler.
= >
> =A0 (2) Describe the RID -> SID mapping in the device-tree. We prob= ably want
> =A0 =A0 =A0 to avoid an enormous table, so this would onl= y work for simple `SID =3D
> =A0 =A0 =A0 RID + offset' or 'SI= D =3D RID & mask' cases.
>
> How do your IDs map to each other?
>
> Will

-srikanth ts

--089e0111bbd67c2e5b04f339457a-- --===============1273758895620802496== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1273758895620802496==--