Lines Matching +full:multi +full:- +full:function
2 # SPDX-License-Identifier: GPL-2.0
72 rx_udp_cmd = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport STDOUT"
73 tx_udp_cmd = f"echo -n {test_string} | socat -t 2 -u STDIN UDP:{cfg.baddr}:{port},shut-none"
123 xdp_info = ip(f"-d link show dev {cfg.ifname}", json=True)[0]
206 Tests the XDP_PASS action for a multi-buff size.
245 Tests the XDP_DROP action for a signle-buff case.
261 Tests the XDP_DROP action for a multi-buff case.
296 rx_udp = f"socat -{cfg.addr_ipver} -T 2 " + \
297 f"-u UDP-RECV:{port},reuseport STDOUT"
300 # but with the shut-null flag socat generates a zero sized packet
302 tx_cmd_suffix = ",shut-null" if payload_len == 0 else ",shut-none"
303 tx_udp = f"echo -n {test_string} | socat -t 2 " + \
304 f"-u STDIN UDP:{cfg.baddr}:{port}{tx_cmd_suffix}"
321 Tests the XDP_TX action for a single-buff case.
334 _test_xdp_native_tx(cfg, bpf_info, [0, 1500 // 2, 1500 - pkt_hdr_len])
340 Tests the XDP_TX action for a multi-buff case.
351 # And the subsequent 0-sized packet ensures the driver
376 prev_offset = offset_lst[tmp_idx - 1]
379 prev_pkt_sz = pkt_sz_lst[tmp_idx - 1]
409 # snapshot. An easier way is to simply check for non-zero length of received string.
424 This function loads the appropriate XDP program based on the provided
520 offset_lst = [-16, -32, -64, -128, -256]
545 rings = ethnl.rings_get({'header': {'dev-index': cfg.ifindex}})
546 if 'hds-thresh' not in rings:
547 ksft_pr(f'hds-thresh not supported. Using default: {hds_thresh}')
549 hds_thresh = rings['hds-thresh']
558 Tests the XDP head adjustment action for a multi-buffer case.
562 ethnl: Network namespace or link object (not used in this function).
564 This function sets up the packet size and offset lists, then performs
579 # after we eat into it. We send large-enough packets, but if HDS
581 # more than 28 bytes (UDPv4 + eth hdr left: (14 + 20 + 8) - 14)
611 expected_data = chr(int(tag, 16)) * (0 - offset) + test_str
635 This function sets up the packet size and offset lists, then calls the
636 _test_xdp_native_head_adjst_mb function to perform the actual test. The
645 offset_lst = [-16, -32, -64, -128, -256]
660 This function sets up the packet size and offset lists, then calls the
661 _test_xdp_native_head_adjst_mb function to perform the actual test. The
706 rx_udp = f"socat -{cfg.addr_ipver} -T 2 -u UDP-RECV:{port},reuseport " + \
715 "exec 5>&-; done"
731 ksft_ge(after['rx-packets'] - before['rx-packets'], expected_pkts)
733 ksft_ge(after['tx-packets'] - before['tx-packets'], expected_pkts)
742 chans = cfg.ethnl.channels_get({'header': {'dev-index': cfg.ifindex}})
743 if chans.get('combined-count', 0) > 1:
744 cfg.ethnl.channels_set({'header': {'dev-index': cfg.ifindex},
745 'combined-count': 1})
746 cfg.ethnl.channels_set({'header': {'dev-index': cfg.ifindex},
747 'combined-count': chans['combined-count']})
751 ksft_ge(after['rx-packets'], before['rx-packets'])
753 ksft_ge(after['tx-packets'], before['tx-packets'])
758 Test multi-buf to single-buf replacement with jumbo MTU.
768 raise KsftSkipEx(f"device supports single-buffer XDP with mtu {mtu}")
773 raise KsftSkipEx("device does not support multi-buffer XDP")
775 # Verify updating mb -> mb program works.
776 cmd(f"ip -force link set dev {cfg.ifname} xdpdrv obj {obj} sec xdp.frags")
778 # Verify updating mb -> sb program does not work.
779 update = cmd(f"ip -force link set dev {cfg.ifname} xdpdrv obj {obj} sec xdp", fail=False)
781 raise KsftFailEx("device unexpectedly updates non-multi-buffer XDP")
786 Main function to execute the XDP tests.
788 This function runs a series of tests to validate the XDP support for
789 both the single and multi-buffer. It uses the NetDrvEpEnv context
791 function to execute the tests.