DPDK patches and discussions
 help / color / mirror / Atom feed
From: "François-Frédéric Ozog" <ff@ozog.com>
To: "'Benson, Bryan'" <bmbenson@amazon.com>, <dev@dpdk.org>
Subject: Re: [dpdk-dev] PCI device mapping to socket
Date: Wed, 18 Dec 2013 21:42:58 +0100	[thread overview]
Message-ID: <02e901cefc31$bcfda6a0$36f8f3e0$@com> (raw)
In-Reply-To: <A029A4295D154649BCC3E22A692B260238F04D@ex10-mbx-9002.ant.amazon.com>

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

      reply	other threads:[~2013-12-18 20:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 20:19 Benson, Bryan
2013-12-18 20:42 ` François-Frédéric Ozog [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='02e901cefc31$bcfda6a0$36f8f3e0$@com' \
    --to=ff@ozog.com \
    --cc=bmbenson@amazon.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).