[dts] [PATCH v3 04/27] framework crb: Appending only 10G devices for cavium

Angela Czubak aczubak at caviumnetworks.com
Wed Apr 19 14:21:57 CEST 2017


When collecting pci devices info in
pci_devices_information_uncached_linux devices are checked if they are
from cavium and if so linkspeed is detected to append only 10Gb
interfaces

Signed-off-by: Angela Czubak <aczubak at caviumnetworks.com>
---
 framework/crb.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/crb.py b/framework/crb.py
index 9b41a0f..63c8093 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -268,7 +268,14 @@ class Crb(object):
         match = pattern.findall(out)
         self.pci_devices_info = []
         for i in range(len(match)):
-            self.pci_devices_info.append((match[i][0], match[i][1]))
+            #check if device is cavium and check its linkspeed, append only if it is 10G
+            if "177d:" in match[i][1]:
+                linkspeed = "10000"
+                nic_linkspeed = self.send_command("cat /sys/bus/pci/devices/%s/net/*/speed" % match[i][0])
+                if nic_linkspeed == linkspeed:
+                    self.pci_devices_info.append((match[i][0], match[i][1]))
+            else:
+                self.pci_devices_info.append((match[i][0], match[i][1]))
 
     def pci_devices_information_uncached_freebsd(self):
         """
-- 
2.7.4



More information about the dts mailing list