lshw HWPath priority — how to determine












2















I have a project here at work where I'm attempting to definitively map ethernet MAC addresses to physical ports (IE card 1 port 0 is eth0 (mac xx:xx:xx:xx:xx:xx) and a non-technical operator can look at that port descriptor and know exactly where a cable is plugged in on a box) for network devices in servers (arbitrary server vendors and models) using Linux, currently CentOS 6.6 without being required to crack the physical box.



The answer to this question probably lies in how Linux enumerates hardware, but I've neither found anything definitive asking the Googles nor been able to find anything definitive in man pages and the like. Finally, I don't believe in my skills at reading C to get the answer I need in the time I need it.



Using lshw:



root@E2APF77 (~)# lshw -c network -businfo
Bus info Device Class Description
====================================================
pci@0000:06:00.0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
pci@0000:06:00.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
pci@0000:16:00.0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
pci@0000:16:00.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
pci@0000:16:00.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
pci@0000:16:00.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
usb0 network Ethernet interface


which is interesting, but I prefer to see the hw path, so I run:



root@E2APF77 (~)# lshw -c network -short -businfo
H/W path Device Class Description
=======================================================
/0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
/0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
/0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/1 usb0 network Ethernet interface


Now this is interesting to me, but I'm not sure if I'm seeing the context I need. So, running the following gives me better context:



root@E2APF77 (~)# lshw -short -businfo -c bridge
H/W path Device Class Description
=======================================================
/0/100 bridge Xeon E5 v3/Core i7 DMI2
/0/100/1 bridge Xeon E5 v3/Core i7 PCI Express Root Port 1
/0/100/2 bridge Xeon E5 v3/Core i7 PCI Express Root Port 2
/0/100/3 bridge Xeon E5 v3/Core i7 PCI Express Root Port 3
/0/100/1c bridge C610/X99 series chipset PCI Express Root Port #1
/0/100/1c.3 bridge C610/X99 series chipset PCI Express Root Port #4
/0/100/1c.3/0 bridge Renesas Technology Corp.
/0/100/1c.3/0/0 bridge Renesas Technology Corp.
/0/100/1c.3/0/0/0 bridge Renesas Technology Corp.
/0/100/1c.3/0/1 bridge Renesas Technology Corp.
/0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
/0/100/1f bridge C610/X99 series chipset LPC Controller


OK. I like this. Now I see that the following:



/0/100/2                     bridge         Xeon E5 v3/Core i7 PCI Express Root Port 2
/0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
/0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2


/0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
/0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
/0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe


...where the first card is on port 2 of the Xeon E5 bridge and the second card is on port 1c.4 of the C610/X99 bridge (if I'm even using the correct naming of the nomenclature. Please forgive me if I'm not). I have no easy way of validating the locations of where the hardware is plugged in and I currently have no knowledge of the specifics of how these machines are built without reading documentation.



So, can one assert or assume that the way Linux is enumerating the hardware in the box is in some priority that we can use to determine the physical ports to an arbitrary number of arbitrary brand of network cards in arbitrary boxen? I'm assuming I'm barking up the right tree, but something isn't passing the smell test for me on this.










share|improve this question





























    2















    I have a project here at work where I'm attempting to definitively map ethernet MAC addresses to physical ports (IE card 1 port 0 is eth0 (mac xx:xx:xx:xx:xx:xx) and a non-technical operator can look at that port descriptor and know exactly where a cable is plugged in on a box) for network devices in servers (arbitrary server vendors and models) using Linux, currently CentOS 6.6 without being required to crack the physical box.



    The answer to this question probably lies in how Linux enumerates hardware, but I've neither found anything definitive asking the Googles nor been able to find anything definitive in man pages and the like. Finally, I don't believe in my skills at reading C to get the answer I need in the time I need it.



    Using lshw:



    root@E2APF77 (~)# lshw -c network -businfo
    Bus info Device Class Description
    ====================================================
    pci@0000:06:00.0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
    pci@0000:06:00.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
    pci@0000:16:00.0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    pci@0000:16:00.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    pci@0000:16:00.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    pci@0000:16:00.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    usb0 network Ethernet interface


    which is interesting, but I prefer to see the hw path, so I run:



    root@E2APF77 (~)# lshw -c network -short -businfo
    H/W path Device Class Description
    =======================================================
    /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
    /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
    /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /1 usb0 network Ethernet interface


    Now this is interesting to me, but I'm not sure if I'm seeing the context I need. So, running the following gives me better context:



    root@E2APF77 (~)# lshw -short -businfo -c bridge
    H/W path Device Class Description
    =======================================================
    /0/100 bridge Xeon E5 v3/Core i7 DMI2
    /0/100/1 bridge Xeon E5 v3/Core i7 PCI Express Root Port 1
    /0/100/2 bridge Xeon E5 v3/Core i7 PCI Express Root Port 2
    /0/100/3 bridge Xeon E5 v3/Core i7 PCI Express Root Port 3
    /0/100/1c bridge C610/X99 series chipset PCI Express Root Port #1
    /0/100/1c.3 bridge C610/X99 series chipset PCI Express Root Port #4
    /0/100/1c.3/0 bridge Renesas Technology Corp.
    /0/100/1c.3/0/0 bridge Renesas Technology Corp.
    /0/100/1c.3/0/0/0 bridge Renesas Technology Corp.
    /0/100/1c.3/0/1 bridge Renesas Technology Corp.
    /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
    /0/100/1f bridge C610/X99 series chipset LPC Controller


    OK. I like this. Now I see that the following:



    /0/100/2                     bridge         Xeon E5 v3/Core i7 PCI Express Root Port 2
    /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
    /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2


    /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
    /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
    /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe


    ...where the first card is on port 2 of the Xeon E5 bridge and the second card is on port 1c.4 of the C610/X99 bridge (if I'm even using the correct naming of the nomenclature. Please forgive me if I'm not). I have no easy way of validating the locations of where the hardware is plugged in and I currently have no knowledge of the specifics of how these machines are built without reading documentation.



    So, can one assert or assume that the way Linux is enumerating the hardware in the box is in some priority that we can use to determine the physical ports to an arbitrary number of arbitrary brand of network cards in arbitrary boxen? I'm assuming I'm barking up the right tree, but something isn't passing the smell test for me on this.










    share|improve this question



























      2












      2








      2








      I have a project here at work where I'm attempting to definitively map ethernet MAC addresses to physical ports (IE card 1 port 0 is eth0 (mac xx:xx:xx:xx:xx:xx) and a non-technical operator can look at that port descriptor and know exactly where a cable is plugged in on a box) for network devices in servers (arbitrary server vendors and models) using Linux, currently CentOS 6.6 without being required to crack the physical box.



      The answer to this question probably lies in how Linux enumerates hardware, but I've neither found anything definitive asking the Googles nor been able to find anything definitive in man pages and the like. Finally, I don't believe in my skills at reading C to get the answer I need in the time I need it.



      Using lshw:



      root@E2APF77 (~)# lshw -c network -businfo
      Bus info Device Class Description
      ====================================================
      pci@0000:06:00.0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      pci@0000:06:00.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
      pci@0000:16:00.0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      usb0 network Ethernet interface


      which is interesting, but I prefer to see the hw path, so I run:



      root@E2APF77 (~)# lshw -c network -short -businfo
      H/W path Device Class Description
      =======================================================
      /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /1 usb0 network Ethernet interface


      Now this is interesting to me, but I'm not sure if I'm seeing the context I need. So, running the following gives me better context:



      root@E2APF77 (~)# lshw -short -businfo -c bridge
      H/W path Device Class Description
      =======================================================
      /0/100 bridge Xeon E5 v3/Core i7 DMI2
      /0/100/1 bridge Xeon E5 v3/Core i7 PCI Express Root Port 1
      /0/100/2 bridge Xeon E5 v3/Core i7 PCI Express Root Port 2
      /0/100/3 bridge Xeon E5 v3/Core i7 PCI Express Root Port 3
      /0/100/1c bridge C610/X99 series chipset PCI Express Root Port #1
      /0/100/1c.3 bridge C610/X99 series chipset PCI Express Root Port #4
      /0/100/1c.3/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/0/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/1 bridge Renesas Technology Corp.
      /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
      /0/100/1f bridge C610/X99 series chipset LPC Controller


      OK. I like this. Now I see that the following:



      /0/100/2                     bridge         Xeon E5 v3/Core i7 PCI Express Root Port 2
      /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2


      /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
      /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe


      ...where the first card is on port 2 of the Xeon E5 bridge and the second card is on port 1c.4 of the C610/X99 bridge (if I'm even using the correct naming of the nomenclature. Please forgive me if I'm not). I have no easy way of validating the locations of where the hardware is plugged in and I currently have no knowledge of the specifics of how these machines are built without reading documentation.



      So, can one assert or assume that the way Linux is enumerating the hardware in the box is in some priority that we can use to determine the physical ports to an arbitrary number of arbitrary brand of network cards in arbitrary boxen? I'm assuming I'm barking up the right tree, but something isn't passing the smell test for me on this.










      share|improve this question
















      I have a project here at work where I'm attempting to definitively map ethernet MAC addresses to physical ports (IE card 1 port 0 is eth0 (mac xx:xx:xx:xx:xx:xx) and a non-technical operator can look at that port descriptor and know exactly where a cable is plugged in on a box) for network devices in servers (arbitrary server vendors and models) using Linux, currently CentOS 6.6 without being required to crack the physical box.



      The answer to this question probably lies in how Linux enumerates hardware, but I've neither found anything definitive asking the Googles nor been able to find anything definitive in man pages and the like. Finally, I don't believe in my skills at reading C to get the answer I need in the time I need it.



      Using lshw:



      root@E2APF77 (~)# lshw -c network -businfo
      Bus info Device Class Description
      ====================================================
      pci@0000:06:00.0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      pci@0000:06:00.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
      pci@0000:16:00.0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      pci@0000:16:00.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      usb0 network Ethernet interface


      which is interesting, but I prefer to see the hw path, so I run:



      root@E2APF77 (~)# lshw -c network -short -businfo
      H/W path Device Class Description
      =======================================================
      /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /1 usb0 network Ethernet interface


      Now this is interesting to me, but I'm not sure if I'm seeing the context I need. So, running the following gives me better context:



      root@E2APF77 (~)# lshw -short -businfo -c bridge
      H/W path Device Class Description
      =======================================================
      /0/100 bridge Xeon E5 v3/Core i7 DMI2
      /0/100/1 bridge Xeon E5 v3/Core i7 PCI Express Root Port 1
      /0/100/2 bridge Xeon E5 v3/Core i7 PCI Express Root Port 2
      /0/100/3 bridge Xeon E5 v3/Core i7 PCI Express Root Port 3
      /0/100/1c bridge C610/X99 series chipset PCI Express Root Port #1
      /0/100/1c.3 bridge C610/X99 series chipset PCI Express Root Port #4
      /0/100/1c.3/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/0/0 bridge Renesas Technology Corp.
      /0/100/1c.3/0/1 bridge Renesas Technology Corp.
      /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
      /0/100/1f bridge C610/X99 series chipset LPC Controller


      OK. I like this. Now I see that the following:



      /0/100/2                     bridge         Xeon E5 v3/Core i7 PCI Express Root Port 2
      /0/100/2/0 eth0 network Ethernet Controller 10-Gigabit X540-AT2
      /0/100/2/0.1 eth1 network Ethernet Controller 10-Gigabit X540-AT2


      /0/100/1c.4 bridge C610/X99 series chipset PCI Express Root Port #5
      /0/100/1c.4/0 eth2 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.1 eth3 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.2 eth4 network NetXtreme BCM5719 Gigabit Ethernet PCIe
      /0/100/1c.4/0.3 eth5 network NetXtreme BCM5719 Gigabit Ethernet PCIe


      ...where the first card is on port 2 of the Xeon E5 bridge and the second card is on port 1c.4 of the C610/X99 bridge (if I'm even using the correct naming of the nomenclature. Please forgive me if I'm not). I have no easy way of validating the locations of where the hardware is plugged in and I currently have no knowledge of the specifics of how these machines are built without reading documentation.



      So, can one assert or assume that the way Linux is enumerating the hardware in the box is in some priority that we can use to determine the physical ports to an arbitrary number of arbitrary brand of network cards in arbitrary boxen? I'm assuming I'm barking up the right tree, but something isn't passing the smell test for me on this.







      linux centos hardware ethernet






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Rui F Ribeiro

      41.5k1483140




      41.5k1483140










      asked Dec 14 '15 at 23:19









      JimJim

      3641411




      3641411






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f249393%2flshw-hwpath-priority-how-to-determine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f249393%2flshw-hwpath-priority-how-to-determine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          濃尾地震

          How to rewrite equation of hyperbola in standard form

          No ethernet ip address in my vocore2