File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
tools/testing/selftests/drivers/net/hw Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 13
13
from lib .py import NetDrvEnv
14
14
15
15
16
+ def _require_2qs (cfg ):
17
+ qcnt = len (glob .glob (f"/sys/class/net/{ cfg .ifname } /queues/rx-*" ))
18
+ if qcnt < 2 :
19
+ raise KsftSkipEx (f"Local has only { qcnt } queues" )
20
+ return qcnt
21
+
22
+
16
23
def _ethtool_create (cfg , act , opts ):
17
24
output = ethtool (f"{ act } { cfg .ifname } { opts } " ).stdout
18
25
# Output will be something like: "New RSS context is 1" or
@@ -57,10 +64,7 @@ def test_rxfh_indir_ntf(cfg):
57
64
Check that Netlink notifications are generated when RSS indirection
58
65
table was modified.
59
66
"""
60
-
61
- qcnt = len (glob .glob (f"/sys/class/net/{ cfg .ifname } /queues/rx-*" ))
62
- if qcnt < 2 :
63
- raise KsftSkipEx (f"Local has only { qcnt } queues" )
67
+ _require_2qs (cfg )
64
68
65
69
ethnl = EthtoolFamily ()
66
70
ethnl .ntf_subscribe ("monitor" )
@@ -88,10 +92,7 @@ def test_rxfh_indir_ctx_ntf(cfg):
88
92
Check that Netlink notifications are generated when RSS indirection
89
93
table was modified on an additional RSS context.
90
94
"""
91
-
92
- qcnt = len (glob .glob (f"/sys/class/net/{ cfg .ifname } /queues/rx-*" ))
93
- if qcnt < 2 :
94
- raise KsftSkipEx (f"Local has only { qcnt } queues" )
95
+ _require_2qs (cfg )
95
96
96
97
ctx_id = _ethtool_create (cfg , "-X" , "context new" )
97
98
defer (ethtool , f"-X { cfg .ifname } context { ctx_id } delete" )
You can’t perform that action at this time.
0 commit comments