Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-Launcher
Commits
b4515324
Commit
b4515324
authored
Jan 27, 2022
by
Alejandro Homs Puron
Browse files
[SET_CPU_AFFINITY] Improve Mellanox IRQ and Ethtool decoding
parent
0f897192
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/set_cpu_affinity
View file @
b4515324
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment