Lines Matching +full:2 +full:f

28     ksft_eq(bool(non_zero), True, comment=f"RSS key is all zero {data['rss-hash-key']}")
32 return ethtool(f"-x {cfg.ifname} context {context}", json=True)[0]
46 output = ethtool(f"{act} {cfg.ifname} {opts}").stdout
53 features = ethtool(f"-k {cfg.ifname}", json=True)[0]
90 ksft_ge(directed, 20000, f"traffic on {name}: " + str(cnts))
92 ksft_lt(sum(cnts[i] for i in params['noise']), directed / 2,
93 f"traffic on other queues ({name})':" + str(cnts))
96 f"traffic on inactive queues ({name}): " + str(cnts))
112 raise KsftFailEx(f"ethtool results empty for '{k}': {data[k]}")
119 ethtool(f"-X {cfg.ifname} hkey " + _rss_key_str(key))
126 ethtool(f"-X {cfg.ifname} equal 3 hkey " + _rss_key_str(key))
127 reset_indir = defer(ethtool, f"-X {cfg.ifname} default")
132 ksft_eq(2, max(data['rss-indirection-table']))
136 ethtool(f"-X {cfg.ifname} default hkey " + _rss_key_str(key))
143 ethtool(f"-X {cfg.ifname} equal 2")
148 # Check we only get traffic on the first 2 queues
152 # 2 queues, 20k packets, must be at least 5k per queue
153 ksft_ge(cnts[0], 5000, "traffic on main context (1/2): " + str(cnts))
154 ksft_ge(cnts[1], 5000, "traffic on main context (2/2): " + str(cnts))
156 ksft_eq(sum(cnts[2:]), 0, "traffic on unused queues: " + str(cnts))
165 ksft_lt(sum(cnts[:2]), sum(cnts[2:]), "traffic distributed: " + str(cnts))
183 ethtool(f"-L {cfg.ifname} combined 4")
184 defer(ethtool, f"-L {cfg.ifname} combined {qcnt}")
193 ctx_ref = f"context {ctx_id}"
194 defer(ethtool, f"-X {cfg.ifname} {ctx_ref} delete")
204 ethtool(f"-L {cfg.ifname} combined 5")
208 ethtool(f"-L {cfg.ifname} combined 4")
212 ethtool(f"-X {cfg.ifname} {ctx_ref} weight 1 0 0 1")
215 defer(ethtool, f"-X {cfg.ifname} default")
218 flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
220 defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
223 other_key: (1, 2) })
226 ethtool(f"-L {cfg.ifname} combined 5")
231 other_key: (1, 2, 4) })
235 ethtool(f"-L {cfg.ifname} combined 3")
239 … raise Exception(f"Driver didn't prevent us from deactivating a used queue (context {ctx_id})")
255 if ch_max < 2:
256 raise KsftSkipEx(f"Not enough queues for the test: {ch_max}")
258 ethtool(f"-L {cfg.ifname} combined 2")
259 defer(ethtool, f"-L {cfg.ifname} combined {qcnt}")
261 ethtool(f"-X {cfg.ifname} weight 1 7")
262 defer(ethtool, f"-X {cfg.ifname} default")
264 ethtool(f"-L {cfg.ifname} combined {ch_max}")
272 f"Table imbalance after resize: {data['rss-indirection-table']}")
294 ethtool(f"-X {cfg.ifname} hkey " + _rss_key_str(key))
321 ids.append(ethtool_create(cfg, "-X", f"context new"))
322 defer(ethtool, f"-X {cfg.ifname} context {ids[-1]} delete")
324 ids.append(ethtool_create(cfg, "-X", f"context new weight 1 1"))
325 defer(ethtool, f"-X {cfg.ifname} context {ids[-1]} delete")
327 ids.append(ethtool_create(cfg, "-X", f"context new hkey {key}"))
328 defer(ethtool, f"-X {cfg.ifname} context {ids[-1]} delete")
332 ksft_pr(f"Added only {len(ids)} out of 3 contexts")
352 if len(ids) > 2 and data.get('context') == ids[2]:
380 The queues will be allocated 2 for each context:
382 [0 1] [2 3] [4 5] [6 7] ...
391 if qcnt < 2 + 2 * ctx_cnt:
393 ksft_pr(f"Increasing queue count {qcnt} -> {2 + 2 * ctx_cnt}")
394 ethtool(f"-L {cfg.ifname} combined {2 + 2 * ctx_cnt}")
395 defer(ethtool, f"-L {cfg.ifname} combined {qcnt}")
402 ethtool(f"-X {cfg.ifname} equal 2")
403 defer(ethtool, f"-X {cfg.ifname} default")
406 want_cfg = f"start {2 + i * 2} equal 2"
410 ctx_id = ethtool_create(cfg, "-X", f"context new {create_cfg}")
411 defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
416 ksft_pr(f"Failed to create context {i + 1}, trying to test what we got")
423 ethtool(f"-X {cfg.ifname} context {ctx_id} {want_cfg}")
428 … ksft_eq(min(data['rss-indirection-table']), 2 + i * 2, "Unexpected context cfg: " + str(data))
429 … ksft_eq(max(data['rss-indirection-table']), 2 + i * 2 + 1, "Unexpected context cfg: " + str(data))
432 flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
434 defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
437 _send_traffic_check(cfg, ports[i], f"context {i}",
438 { 'target': (2+i*2, 3+i*2),
440 'empty': list(range(2, 2+i*2)) + list(range(4+i*2, 2+2*ctx_cnt)) })
443 raise KsftSkipEx(f"Tested only {ctx_cnt} contexts, wanted {requested_ctx_cnt}")
476 if qcnt < 2 + 2 * ctx_cnt:
478 ksft_pr(f"Increasing queue count {qcnt} -> {2 + 2 * ctx_cnt}")
479 ethtool(f"-L {cfg.ifname} combined {2 + 2 * ctx_cnt}")
480 defer(ethtool, f"-L {cfg.ifname} combined {qcnt}")
498 'target': (2+i*2, 3+i*2),
500 'empty': list(range(2, 2+i*2)) + list(range(4+i*2, 2+2*ctx_cnt))
505 'empty': range(2, 2+2*ctx_cnt)
508 _send_traffic_check(cfg, ports[i], f"context {i}", expected)
511 ethtool(f"-X {cfg.ifname} equal 2")
512 defer(ethtool, f"-X {cfg.ifname} default")
515 ctx_id = ethtool_create(cfg, "-X", f"context new start {2 + i * 2} equal 2")
516 ctx.append(defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete"))
519 flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
521 ntuple.append(defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}"))
526 remove_ctx(ctx_cnt // 2)
538 raise KsftSkipEx(f"Tested only {ctx_cnt} contexts, wanted {requested_ctx_cnt}")
544 Use 4 queues for the main context, but only queues 2 and 3 for context 1.
552 ksft_pr(f"Increasing queue count {queue_cnt} -> 4")
553 ethtool(f"-L {cfg.ifname} combined 4")
554 defer(ethtool, f"-L {cfg.ifname} combined {queue_cnt}")
559 ethtool(f"-X {cfg.ifname} equal 4")
560 defer(ethtool, f"-X {cfg.ifname} default")
563 ethtool(f"-X {cfg.ifname} context {other_ctx} equal 4")
564 defer(ethtool, f"-X {cfg.ifname} context {other_ctx} delete")
567 ethtool(f"-X {cfg.ifname} context {ctx_id} start 2 equal 2")
568 defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
572 flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {other_ctx}"
574 ntuple = defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
582 ksft_ge(sum(cnts[ :2]), 7000, "traffic on main context (1/2): " + str(cnts))
583 ksft_ge(sum(cnts[2:4]), 7000, "traffic on main context (2/2): " + str(cnts))
590 flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
592 defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
598 directed = sum(cnts[2:4])
599 ksft_lt(sum(cnts[ :2]), directed / 2, "traffic on main context: " + str(cnts))