@@ -19,8 +19,8 @@ def _get_combined_channels(cfg):
19
19
return int (values [1 ])
20
20
21
21
22
- def _create_rss_ctx (cfg , chans ):
23
- output = ethtool (f"-X { cfg .ifname } context new start { chans - 1 } equal 1" , host = cfg .remote ).stdout
22
+ def _create_rss_ctx (cfg , chan ):
23
+ output = ethtool (f"-X { cfg .ifname } context new start { chan } equal 1" , host = cfg .remote ).stdout
24
24
values = re .search (r'New RSS context is (\d+)' , output ).group (1 )
25
25
ctx_id = int (values )
26
26
return (ctx_id , defer (ethtool , f"-X { cfg .ifname } delete context { ctx_id } " , host = cfg .remote ))
@@ -32,8 +32,8 @@ def _set_flow_rule(cfg, port, chan):
32
32
return int (values )
33
33
34
34
35
- def _set_flow_rule_rss (cfg , port , chan ):
36
- output = ethtool (f"-N { cfg .ifname } flow-type tcp6 dst-port { port } action { chan } " , host = cfg .remote ).stdout
35
+ def _set_flow_rule_rss (cfg , port , ctx_id ):
36
+ output = ethtool (f"-N { cfg .ifname } flow-type tcp6 dst-port { port } context { ctx_id } " , host = cfg .remote ).stdout
37
37
values = re .search (r'ID (\d+)' , output ).group (1 )
38
38
return int (values )
39
39
@@ -121,7 +121,7 @@ def test_zcrx_rss(cfg) -> None:
121
121
ethtool (f"-X { cfg .ifname } equal { combined_chans - 1 } " , host = cfg .remote )
122
122
defer (ethtool , f"-X { cfg .ifname } default" , host = cfg .remote )
123
123
124
- (ctx_id , delete_ctx ) = _create_rss_ctx (cfg , combined_chans )
124
+ (ctx_id , delete_ctx ) = _create_rss_ctx (cfg , combined_chans - 1 )
125
125
flow_rule_id = _set_flow_rule_rss (cfg , port , ctx_id )
126
126
defer (ethtool , f"-N { cfg .ifname } delete { flow_rule_id } " , host = cfg .remote )
127
127
0 commit comments