On Wed, Jun 15, 2011 at 04:11:42PM +0800, Xu, Andiry wrote: > > -----Original Message----- > > From: Sarah Sharp [mailto:sarah.a.sharp@xxxxxxxxxxxxxxx] > > Why only allocate one event ring when only MSI, not MSI-X is enabled? > > You should be able to use multiple event rings, but all the interrupts > > will be directed to the same CPU, correct? I think you could still > see > > performance gains if you have an MSI-only host but you could direct > > different types of USB traffic to different event rings with different > > interrupt modulation rates. > > > > I think this was something Matthew wanted for the UAS driver for the > > hosts that only supported MSI. For those hosts, could you register, > > say, 5 event rings with the same interrupter? Matthew, do you think > > that's enough, or do you want more? > > > > Are you sure one interrupter can has multiple event rings? As I know, > one > interrupter has one interrupter register set, and only has one event > ring. I asked the xHCI architect, and here was his response: "MSI can be configured so that each Interrupter (up to 32) generates a separate vector. The number of vectors that MSI interrupt can generate in an APIC is determined by "Multiple Message Capable" field of the MSI Capability Message Control register. See page 234 in the PCI 3.0 spec. If you set "Multiple Message Capable" to 0, then all the Interrupters/Event Rings are mapped to a single vector, no matter how many Interrupters are used. So yes, you can define multiple Event Rings with the same interrupt vector. And you can use multiple Event Rings (Interrupters) with MSI. Ideally you should adjust the value of the "Multiple Message Capable" register so that it is equal to the number of Interrupters you are using. That way you will get a separate vector for each Interrupter/Event Ring. The only difference between MSI and MSI-X is that all the MSI vectors can only target a single APIC (i.e. core) in a system, while each MSI-X vectors can be mapped to any vector on any APIC in a system, i.e. you can do core targeting of interrupts. So with MSI you still get multiple vectors, except that they can only be generated on one core." The issue is a bit complicated, because Linux doesn't allow you to allocate multiple vectors for MSI on x86. There's an implementation for MIPS, but I'm not sure if anyone will care about xHCI on MIPS? Jesse Barnes mentioned there was a patchset floating around to add this functionality to x86. Until that patchset gets merged, you can still allocate multiple event rings that are all mapped to the same MSI vector. I think that would still be a performance win to be able to have separate rings for bulk endpoints and periodic endpoints. Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html