All of lore.kernel.org
 help / color / mirror / Atom feed
* View device <=> IOMMU mapping table
@ 2014-07-09  4:33 Ahmed A
  2014-07-09  8:18 ` Real Name
  0 siblings, 1 reply; 4+ messages in thread
From: Ahmed A @ 2014-07-09  4:33 UTC (permalink / raw)
  To: kernelnewbies

Hello,

I have a server, and on the motherboard there are two CPU sockets, with a CPU in each.? There is a x16 PCIe slot connected to each CPU socket.? There are two different cards in each PCIe slot.? Is there a utility or some kernel data structure I can look at to find the device to IOMMU (socket 0 or socket 1) mapping?

Thank you,
Ahmed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140708/232e54ac/attachment-0001.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* View device <=> IOMMU mapping table
  2014-07-09  4:33 View device <=> IOMMU mapping table Ahmed A
@ 2014-07-09  8:18 ` Real Name
  2014-07-09 12:12   ` Ahmed A
  0 siblings, 1 reply; 4+ messages in thread
From: Real Name @ 2014-07-09  8:18 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jul 08, 2014 at 09:33:40PM -0700, Ahmed A wrote:
> Hello,
> 
> I have a server, and on the motherboard there are two CPU sockets, with a CPU in each.? There is a x16 PCIe slot connected to each CPU socket.? There are two different cards in each PCIe slot.? Is there a utility or some kernel data structure I can look at to find the device to IOMMU (socket 0 or socket 1) mapping?

please try:
1) lspci -vs THE_PCI_ID
2) cat /proc/iomem

> 
> Thank you,
> Ahmed.

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 4+ messages in thread

* View device <=> IOMMU mapping table
  2014-07-09  8:18 ` Real Name
@ 2014-07-09 12:12   ` Ahmed A
  2014-07-09 15:08     ` Real Name
  0 siblings, 1 reply; 4+ messages in thread
From: Ahmed A @ 2014-07-09 12:12 UTC (permalink / raw)
  To: kernelnewbies

Hello,
I know the b:d.f? of my device.? However, I am not able to tell if this specific device is mapped to the right IOMMU.? In my specific system there are two IOMMU, right? ? If so, I am not sure how I can get the mapping info from the output of /proc/iomem.

Regards,
Ahmed.




On Wednesday, July 9, 2014 1:18 AM, Real Name <enjoymindful@gmail.com> wrote:
 


On Tue, Jul 08, 2014 at 09:33:40PM -0700, Ahmed A wrote:
> Hello,
> 
> I have a server, and on the motherboard there are two CPU sockets, with a CPU in each.? There is a x16 PCIe slot connected to each CPU socket.? There are two different cards in each PCIe slot.? Is there a utility or some kernel data structure I can look at to find the device to IOMMU (socket 0 or socket 1) mapping?

please try:
1) lspci -vs THE_PCI_ID
2) cat /proc/iomem


> 
> Thank you,
> Ahmed.

> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140709/28fb4a38/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* View device <=> IOMMU mapping table
  2014-07-09 12:12   ` Ahmed A
@ 2014-07-09 15:08     ` Real Name
  0 siblings, 0 replies; 4+ messages in thread
From: Real Name @ 2014-07-09 15:08 UTC (permalink / raw)
  To: kernelnewbies

On Wed, Jul 09, 2014 at 05:12:18AM -0700, Ahmed A wrote:
> Hello,
> I know the b:d.f? of my device.? However, I am not able to tell if this specific device is mapped to the right IOMMU.? In my specific system there are two IOMMU, right? 

http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html

Why you think there are two IOMMU? Just because there are two socket?
If there is north bridge, the IOMMU is in the north bridge, not the
CPU/socket.

/proc/iomem list the bus space address range of the PCIe device. The bus space
to memory space mapping is dynamic. I insrumented the mlx4 infiniband
driver to trace the DMA mapping (on a 2-sockets x86_64 server).


[root at localhost mlx4]# lspci -vs 07:00.0
07:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
	Subsystem: Mellanox Technologies Device 0050
	Physical Slot: 2
	Flags: bus master, fast devsel, latency 0, IRQ 26
	Memory at f7f00000 (64-bit, non-prefetchable) [size=1M]
	Memory at f6000000 (64-bit, prefetchable) [size=8M]
	Capabilities: [40] Power Management version 3
	Capabilities: [48] Vital Product Data
	Capabilities: [9c] MSI-X: Enable+ Count=128 Masked-
	Capabilities: [60] Express Endpoint, MSI 00
	Capabilities: [100] Alternative Routing-ID Interpretation (ARI)
	Capabilities: [148] Device Serial Number 00-02-c9-03-00-b3-c7-c0
	Capabilities: [108] Single Root I/O Virtualization (SR-IOV)
	Capabilities: [154] Advanced Error Reporting
	Capabilities: [18c] #19
	Kernel driver in use: mlx4_core

[root at localhost mlx4]# 
[root at localhost mlx4]# dmesg 
[root at localhost mlx4]# ibv_rc_pingpong 
  local address:  LID 0x0002, QPN 0x000054, PSN 0x454e1a, GID ::
  remote address: LID 0x0001, QPN 0x000054, PSN 0x6e4596, GID ::
8192000 bytes in 0.00 seconds = 13799.96 Mbit/sec
1000 iters in 0.00 seconds = 4.75 usec/iter
[root at localhost mlx4]# dmesg 
[ 5474.650073] vma = ffff8804164460b8, vma->vm_start = 00002af33ba39000, pfn = 1007753, pva = 00000000f6089000, kva = ffff8800f6089000, n = 1
[ 5474.706424] vma = ffff880416446730, vma->vm_start = 00002af33ba3a000, pfn = 1007753, pva = 00000000f6089000, kva = ffff8800f6089000, n = 2
[root at localhost ~]#

As you see, pva (000f6089000) belong to this bus space address "Memory at f6000000 (64-bit, prefetchable) [size=8M]".

Hope this can be help.

>? If so, I am not sure how I can get the mapping info from the output of /proc/iomem.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-09 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-09  4:33 View device <=> IOMMU mapping table Ahmed A
2014-07-09  8:18 ` Real Name
2014-07-09 12:12   ` Ahmed A
2014-07-09 15:08     ` Real Name

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.