Lines Matching +full:multi +full:- +full:port

2 # SPDX-License-Identifier: GPL-2.0
24 PORT = 1 # Port configuration to communicate with the remote host variable in TestConfig
56 def _exchg_udp(cfg, port, test_string): argument
62 port: Port number to use for the UDP communication.
70 rx_udp_cmd = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport STDOUT"
71 tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port}"
74 wait_port_listen(port, proto="udp")
80 def _test_udp(cfg, port, size=256): argument
86 port: Port number to use for the UDP communication.
93 recvd_str = _exchg_udp(cfg, port, test_str)
121 xdp_info = ip(f"-d link show dev {cfg.ifname}", json=True)[0]
151 Updates an XDP map with a given key-value pair using bpftool.
211 port = rand_port()
214 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
216 ksft_eq(_test_udp(cfg, port, msg_sz), True, "UDP packet exchange failed")
237 Tests the XDP_PASS action for a multi-buff size.
258 port = rand_port()
261 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
263 ksft_eq(_test_udp(cfg, port, msg_sz), False, "UDP packet exchange should fail")
272 Tests the XDP_DROP action for a signle-buff case.
284 Tests the XDP_DROP action for a multi-buff case.
305 port = rand_port()
308 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
316 rx_udp = f"socat -{cfg.addr_ipver} -T 2 " + \
317 f"-u UDP-RECV:{port},reuseport STDOUT"
320 # but with the shut-null flag socat generates a zero sized packet
322 tx_cmd_suffix = ",shut-null" if payload_len == 0 else ""
323 tx_udp = f"echo -n {test_string} | socat -t 2 " + \
324 f"-u STDIN UDP:{cfg.baddr}:{port}{tx_cmd_suffix}"
327 wait_port_listen(port, proto="udp", host=cfg.remote)
340 Tests the XDP_TX action for a single-buff case.
350 _test_xdp_native_tx(cfg, bpf_info, [0, 1500 // 2, 1500 - pkt_hdr_len])
355 Tests the XDP_TX action for a multi-buff case.
363 # And the subsequent 0-sized packet ensures the driver
388 prev_offset = offset_lst[tmp_idx - 1]
391 prev_pkt_sz = pkt_sz_lst[tmp_idx - 1]
421 # snapshot. An easier way is to simply check for non-zero length of received string.
450 port = rand_port()
457 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
468 recvd_str = _exchg_udp(cfg, port, test_str)
524 offset_lst = [-16, -32, -64, -128, -256]
549 rings = ethnl.rings_get({'header': {'dev-index': cfg.ifindex}})
550 if 'hds-thresh' not in rings:
551 ksft_pr(f'hds-thresh not supported. Using default: {hds_thresh}')
553 hds_thresh = rings['hds-thresh']
562 Tests the XDP head adjustment action for a multi-buffer case.
574 port = rand_port()
577 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
583 # after we eat into it. We send large-enough packets, but if HDS
585 # more than 28 bytes (UDPv4 + eth hdr left: (14 + 20 + 8) - 14)
603 recvd_str = _exchg_udp(cfg, port, test_str)
618 expected_data = chr(int(tag, 16)) * (0 - offset) + test_str
648 offset_lst = [-16, -32, -64, -128, -256]
680 port = rand_port()
683 _set_xdp_map("map_xdp_setup", TestConfig.PORT.value, port)
686 rx_udp = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport " + \
691 tx_udp = f"exec 5<>/dev/udp/{cfg.addr}/{port}; " \
692 "for i in `seq 2000`; do echo a >&5; done; exec 5>&-"
701 wait_port_listen(port, proto="udp", host=rx_host)
707 ksft_ge(after['rx-packets'] - before['rx-packets'], 2000)
709 ksft_ge(after['tx-packets'] - before['tx-packets'], 2000)
719 chans = cfg.ethnl.channels_get({'header': {'dev-index': cfg.ifindex}})
720 if chans.get('combined-count', 0) > 1:
721 cfg.ethnl.channels_set({'header': {'dev-index': cfg.ifindex},
722 'combined-count': 1})
723 cfg.ethnl.channels_set({'header': {'dev-index': cfg.ifindex},
724 'combined-count': chans['combined-count']})
728 ksft_ge(after['rx-packets'], before['rx-packets'])
730 ksft_ge(after['tx-packets'], before['tx-packets'])
762 both the single and multi-buffer. It uses the NetDrvEpEnv context