Skip to content

Commit

Permalink
fix mellanox_firmware device mapping
Browse files Browse the repository at this point in the history
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
  • Loading branch information
filanov committed Sep 30, 2024
1 parent 6b4289b commit 3eeb803
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sos/report/plugins/mellanox_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def check_enabled(self):
We will only enable the plugin if there is a
Mellanox Technologies network adapter
"""
lspci = self.exec_cmd("lspci -D -d 15b3::0200")
lspci = self.exec_cmd("lspci -D -d 15b3::")
return lspci['status'] == 0 and self.MLNX_STRING in lspci['output']

def collect(self):
Expand Down Expand Up @@ -67,7 +67,7 @@ def collect(self):
def setup(self):
# Get all devices which have the vendor Mellanox Technologies
devices = []
device_list = self.collect_cmd_output('lspci -D -d 15b3::0200')
device_list = self.collect_cmd_output('lspci -D -d 15b3::')
# Will return a string of the following format:
# 0000:08:00.0 Ethernet controller: Mellanox Technologies MT2892 Family
if device_list['status'] != 0:
Expand All @@ -79,10 +79,14 @@ def setup(self):
# from the following string
# 0000:08:00.0 Ethernet controller: Mellanox Technologies MT2892
# Family
devices.append(line[0:8]+'00.0')
devices.append(line.split()[0])

devices = set(devices)

# check if devices supported by mlx commands
devices = [device for device in devices
if self.exec_cmd(f'mcra {device} 0xf0014')['status'] == 0]

# Mft package is present if OFED is installed
# mstflint package is part of the distro and can be installed.
commands = []
Expand Down

0 comments on commit 3eeb803

Please sign in to comment.