Lines Matching full:cfg
11 def _get_current_settings(cfg): argument
12 output = ethtool(f"-g {cfg.ifname}", json=True, host=cfg.remote)[0]
16 def _get_combined_channels(cfg): argument
17 output = ethtool(f"-l {cfg.ifname}", host=cfg.remote).stdout
22 def _create_rss_ctx(cfg, chan): argument
23 output = ethtool(f"-X {cfg.ifname} context new start {chan} equal 1", host=cfg.remote).stdout
26 return (ctx_id, defer(ethtool, f"-X {cfg.ifname} delete context {ctx_id}", host=cfg.remote))
29 def _set_flow_rule(cfg, port, chan): argument
30 …output = ethtool(f"-N {cfg.ifname} flow-type tcp6 dst-port {port} action {chan}", host=cfg.remote)…
35 def _set_flow_rule_rss(cfg, port, ctx_id): argument
36 …output = ethtool(f"-N {cfg.ifname} flow-type tcp6 dst-port {port} context {ctx_id}", host=cfg.remo…
41 def test_zcrx(cfg) -> None: argument
42 cfg.require_ipver('6')
44 combined_chans = _get_combined_channels(cfg)
47 (rx_ring, hds_thresh) = _get_current_settings(cfg)
50 ethtool(f"-G {cfg.ifname} tcp-data-split on", host=cfg.remote)
51 defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto", host=cfg.remote)
53 ethtool(f"-G {cfg.ifname} hds-thresh 0", host=cfg.remote)
54 defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}", host=cfg.remote)
56 ethtool(f"-G {cfg.ifname} rx 64", host=cfg.remote)
57 defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}", host=cfg.remote)
59 ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}", host=cfg.remote)
60 defer(ethtool, f"-X {cfg.ifname} default", host=cfg.remote)
62 flow_rule_id = _set_flow_rule(cfg, port, combined_chans - 1)
63 defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}", host=cfg.remote)
65 rx_cmd = f"{cfg.bin_remote} -s -p {port} -i {cfg.ifname} -q {combined_chans - 1}"
66 tx_cmd = f"{cfg.bin_local} -c -h {cfg.remote_addr_v['6']} -p {port} -l 12840"
67 with bkg(rx_cmd, host=cfg.remote, exit_wait=True):
68 wait_port_listen(port, proto="tcp", host=cfg.remote)
72 def test_zcrx_oneshot(cfg) -> None: argument
73 cfg.require_ipver('6')
75 combined_chans = _get_combined_channels(cfg)
78 (rx_ring, hds_thresh) = _get_current_settings(cfg)
81 ethtool(f"-G {cfg.ifname} tcp-data-split on", host=cfg.remote)
82 defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto", host=cfg.remote)
84 ethtool(f"-G {cfg.ifname} hds-thresh 0", host=cfg.remote)
85 defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}", host=cfg.remote)
87 ethtool(f"-G {cfg.ifname} rx 64", host=cfg.remote)
88 defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}", host=cfg.remote)
90 ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}", host=cfg.remote)
91 defer(ethtool, f"-X {cfg.ifname} default", host=cfg.remote)
93 flow_rule_id = _set_flow_rule(cfg, port, combined_chans - 1)
94 defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}", host=cfg.remote)
96 rx_cmd = f"{cfg.bin_remote} -s -p {port} -i {cfg.ifname} -q {combined_chans - 1} -o 4"
97 tx_cmd = f"{cfg.bin_local} -c -h {cfg.remote_addr_v['6']} -p {port} -l 4096 -z 16384"
98 with bkg(rx_cmd, host=cfg.remote, exit_wait=True):
99 wait_port_listen(port, proto="tcp", host=cfg.remote)
103 def test_zcrx_rss(cfg) -> None: argument
104 cfg.require_ipver('6')
106 combined_chans = _get_combined_channels(cfg)
109 (rx_ring, hds_thresh) = _get_current_settings(cfg)
112 ethtool(f"-G {cfg.ifname} tcp-data-split on", host=cfg.remote)
113 defer(ethtool, f"-G {cfg.ifname} tcp-data-split auto", host=cfg.remote)
115 ethtool(f"-G {cfg.ifname} hds-thresh 0", host=cfg.remote)
116 defer(ethtool, f"-G {cfg.ifname} hds-thresh {hds_thresh}", host=cfg.remote)
118 ethtool(f"-G {cfg.ifname} rx 64", host=cfg.remote)
119 defer(ethtool, f"-G {cfg.ifname} rx {rx_ring}", host=cfg.remote)
121 ethtool(f"-X {cfg.ifname} equal {combined_chans - 1}", host=cfg.remote)
122 defer(ethtool, f"-X {cfg.ifname} default", host=cfg.remote)
124 (ctx_id, delete_ctx) = _create_rss_ctx(cfg, combined_chans - 1)
125 flow_rule_id = _set_flow_rule_rss(cfg, port, ctx_id)
126 defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}", host=cfg.remote)
128 rx_cmd = f"{cfg.bin_remote} -s -p {port} -i {cfg.ifname} -q {combined_chans - 1}"
129 tx_cmd = f"{cfg.bin_local} -c -h {cfg.remote_addr_v['6']} -p {port} -l 12840"
130 with bkg(rx_cmd, host=cfg.remote, exit_wait=True):
131 wait_port_listen(port, proto="tcp", host=cfg.remote)
136 with NetDrvEpEnv(__file__) as cfg:
137 cfg.bin_local = path.abspath(path.dirname(__file__) + "/../../../drivers/net/hw/iou-zcrx")
138 cfg.bin_remote = cfg.remote.deploy(cfg.bin_local)
140 ksft_run(globs=globals(), case_pfx={"test_"}, args=(cfg, ))