Package: lshw
Version: 02.17-1
Severity: important
Tags: patch

On HP Moonshot cartridges (ARM and x86) that have PCI-attached
Mellanox controllers, lshw reports only one of the two physical NICs,
and with the wrong MAC address.

This appears to be due to some code intended to avoid duplicates - it
checks to see if both NICs have the same PCI address and merges them
if so. This controller actually does expose multiple NICs on the same
PCI function, so this test is a false positive.

This is ticket #665 upstream, resolved there with the attached patch.

Using important severity under the guise of hardware enablement.
>From 2a5f1a0151203e98d474c999cd69a31bc9ea0da8 Mon Sep 17 00:00:00 2001
From: lyonel <lyonel@811e2811-9fd9-0310-a116-b6e8ac943c8b>
Date: Mon, 27 Oct 2014 18:26:01 +0000
Subject: [PATCH] Do not brutally merge NICs in the same PCI function (#665)

git-svn-id: http://www.ezix.org/source/packages/lshw/development@2552 811e2811-9fd9-0310-a116-b6e8ac943c8b
---
 src/core/network.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/core/network.cc b/src/core/network.cc
index 0252ddd..c636514 100644
--- a/src/core/network.cc
+++ b/src/core/network.cc
@@ -326,6 +326,7 @@ bool scan_network(hwNode & n)
 
     for (unsigned int i = 0; i < interfaces.size(); i++)
     {
+      hwNode *existing;
       hwNode interface("network",
         hw::network);
 
@@ -532,7 +533,10 @@ bool scan_network(hwNode & n)
       if(sysfs::entry::byClass("net", interface.getLogicalName()).hassubdir("bridge"))
         interface.addCapability("logical", _("Logical interface"));
 
-      if (hwNode * existing = n.findChildByBusInfo(interface.getBusInfo()))
+      existing = n.findChildByBusInfo(interface.getBusInfo());
+      // Multiple NICs can exist on one PCI function.
+      // Only merge if MACs also match.
+      if (existing && (existing->getSerial() == "" || interface.getSerial() == existing->getSerial()))
       {
         existing->merge(interface);
         if(interface.getDescription()!="")
-- 
2.1.1

Reply via email to