Skip to content

Commit 3eeb803

Browse files
committed
fix mellanox_firmware device mapping
remove subvendor from lspci command to include all the devices using mcra command to validate that devices are supported some devices are not matching 0000:08: format, this fix is resolving the format issue
1 parent 6b4289b commit 3eeb803

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sos/report/plugins/mellanox_firmware.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def check_enabled(self):
2929
We will only enable the plugin if there is a
3030
Mellanox Technologies network adapter
3131
"""
32-
lspci = self.exec_cmd("lspci -D -d 15b3::0200")
32+
lspci = self.exec_cmd("lspci -D -d 15b3::")
3333
return lspci['status'] == 0 and self.MLNX_STRING in lspci['output']
3434

3535
def collect(self):
@@ -67,7 +67,7 @@ def collect(self):
6767
def setup(self):
6868
# Get all devices which have the vendor Mellanox Technologies
6969
devices = []
70-
device_list = self.collect_cmd_output('lspci -D -d 15b3::0200')
70+
device_list = self.collect_cmd_output('lspci -D -d 15b3::')
7171
# Will return a string of the following format:
7272
# 0000:08:00.0 Ethernet controller: Mellanox Technologies MT2892 Family
7373
if device_list['status'] != 0:
@@ -79,10 +79,14 @@ def setup(self):
7979
# from the following string
8080
# 0000:08:00.0 Ethernet controller: Mellanox Technologies MT2892
8181
# Family
82-
devices.append(line[0:8]+'00.0')
82+
devices.append(line.split()[0])
8383

8484
devices = set(devices)
8585

86+
# check if devices supported by mlx commands
87+
devices = [device for device in devices
88+
if self.exec_cmd(f'mcra {device} 0xf0014')['status'] == 0]
89+
8690
# Mft package is present if OFED is installed
8791
# mstflint package is part of the distro and can be installed.
8892
commands = []

0 commit comments

Comments
 (0)