DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] PCI device mapping to socket
@ 2013-12-18 20:19 Benson, Bryan
  2013-12-18 20:42 ` François-Frédéric Ozog
  0 siblings, 1 reply; 2+ messages in thread
From: Benson, Bryan @ 2013-12-18 20:19 UTC (permalink / raw)
  To: dev

All,
Does anyone know of a way I can find out which socket a PCI device/bridge is tied up to?  I have looked into dmidecode and lspci to no avail, but I may be missing something.  We are looking at putting multiple NICs into a single dual socket server.

This is so that I can tie specific NIC ports to the proper socket to take advantage of DDIO.

Thank you,
Bryan Benson
Amazon Web Services

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

* Re: [dpdk-dev] PCI device mapping to socket
  2013-12-18 20:19 [dpdk-dev] PCI device mapping to socket Benson, Bryan
@ 2013-12-18 20:42 ` François-Frédéric Ozog
  0 siblings, 0 replies; 2+ messages in thread
From: François-Frédéric Ozog @ 2013-12-18 20:42 UTC (permalink / raw)
  To: 'Benson, Bryan', dev

Hi,

It depends on the kernel version. For the latests ones you can use:
cat /sys/class/net/<interface name>/device/numa_node

in all other case, you can use lspci fallback (in case even no driver is yet
loaded).

lspci | grep Ethernet
09:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network
Connection (rev 01)
09:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network
Connection (rev 01)

lspci -t
\-[0000:00]-+-00.0
             +-01.0-[01-03]----00.0-[02-03]----08.0-[03]--+-00.0
             |                                            +-00.3
             .
             .
             +-1c.0-[09-0a]--+-00.0
             |               +-00.1
             |               +-00.2
             |               \-00.3

So the PCI bus is 0.

Now transform this to socket number:

Space=0x100/<nbsocket>

On a dual socket space=0x80, bus(0*space=0) is socket 0, bus(1*space=0x80)
is socket1.

On a quad socket space=0x40, bus(0*space=0) is socket 0, bus(1*space=0x40)
is socket1, bus(2*space=0x80) is socket2, bus(3*space=0xc0) is socket3 .

François-Frédéric


> -----Message d'origine-----
> De : dev [mailto:dev-bounces@dpdk.org] De la part de Benson, Bryan
> Envoyé : mercredi 18 décembre 2013 21:20
> À : dev@dpdk.org
> Objet : [dpdk-dev] PCI device mapping to socket
> 
> All,
> Does anyone know of a way I can find out which socket a PCI device/bridge
> is tied up to?  I have looked into dmidecode and lspci to no avail, but I
> may be missing something.  We are looking at putting multiple NICs into a
> single dual socket server.
> 
> This is so that I can tie specific NIC ports to the proper socket to take
> advantage of DDIO.
> 
> Thank you,
> Bryan Benson
> Amazon Web Services

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

end of thread, other threads:[~2013-12-18 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-18 20:19 [dpdk-dev] PCI device mapping to socket Benson, Bryan
2013-12-18 20:42 ` François-Frédéric Ozog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).