Ayuj and Jogarao you might also be interested to look at this one. On 1 December 2017 at 22:20, Radoslaw Biernacki < radoslaw.biernacki@linaro.org> wrote: > Asking for link speed for ThunderX Ethernet controller is not reliable > since driver report error when the link is down. In fact we dont need > to ask for link speed as Ethernet controllers can be easily identified > by device name from lspci. The mapping will fuhrer filter out the PF > and VF interfaces which does not have the interface name assigned. > > Fixes: 150716d93f5e ("framework crb: Appending only 10G devices for > cavium") > > Signed-off-by: Radoslaw Biernacki > --- > framework/crb.py | 11 ++--------- > 1 file changed, 2 insertions(+), 9 deletions(-) > > diff --git a/framework/crb.py b/framework/crb.py > index dd29a8b..36b1ffe 100644 > --- a/framework/crb.py > +++ b/framework/crb.py > @@ -268,20 +268,13 @@ class Crb(object): > Look for the NIC's information (PCI Id and card type). > """ > out = self.send_expect( > - "lspci -Dnn | grep -i eth", "# ", alt_session=True) > + "lspci -Dnn | grep -i 'Ethernet controller'", "# ", > alt_session=True) > rexp = r"([\da-f]{4}:[\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet > .*?([\da-f]{4}:[\da-f]{4})" > pattern = re.compile(rexp) > match = pattern.findall(out) > self.pci_devices_info = [] > for i in range(len(match)): > - #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])) > + self.pci_devices_info.append((match[i][0], match[i][1])) > > def pci_devices_information_uncached_freebsd(self): > """ > -- > 2.7.4 > >