Commit b4515324 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

[SET_CPU_AFFINITY] Improve Mellanox IRQ and Ethtool decoding

parent 0f897192
......@@ -393,9 +393,11 @@ class NetDev:
klass.ProcIntRe = re.compile(re_str)
return klass.ProcIntRe
ProcIntNameRe = re.compile('((?P<type>[^_]+)_comp(?P<mlx_queue>[0-9]+)@'
'pci:(?P<pci>[0-9:.]+)|'
'(?P<name>[^-]+)-[TtRrXx]+-(?P<intel_queue>[0-9]+))')
ProcIntNameRe = re.compile('((?P<type>mlx[^_-]+)(_comp|-)'
'(?P<mlx_queue>[0-9]+)@'
'(pci:)?(?P<pci>[0-9A-Fa-f:.]+)|'
'(?P<name>[^-]+)-[TtRrXx]+-'
'(?P<intel_queue>[0-9]+))')
ProcIntCache = None
......@@ -405,6 +407,8 @@ class NetDev:
def __init__(self, name):
self.m_name = name
if not os.path.exists(self.getSysfsDir()):
raise ValueError(f'Unknown NetDev {name}')
def getSysfsDir(self):
return f'/sys/class/net/{self.m_name}'
......@@ -473,10 +477,10 @@ class NetDev:
def getActiveRxQueueList(self):
cmd = SystemCmd(['ethtool', '-S', self.getName()])
ethtool = cmd.doPopen(stdout=PIPE)
ethtool = cmd.doPopen(stdout=PIPE, text=True)
queue_list = []
for l in ethtool.stdout:
m = self.EthtoolPacketsRe.match(l.decode())
m = self.EthtoolPacketsRe.match(l)
if not m:
continue
if int(m['packets']) > 0:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment