Lines Matching +full:bi +full:- +full:directional
1 // SPDX-License-Identifier: GPL-2.0
13 * a unique UMEM. It validates in-order packet delivery and packet content
17 * ------------------
22 * a. nopoll - soft-irq processing in run-to-completion mode
23 * b. poll - using poll() syscall
27 * d. Bi-directional sockets
28 * Configure sockets as bi-directional tx/rx sockets, sets up fill and
52 * j. If multi-buffer is supported, send 9k packets divided into 3 frames
53 * k. If multi-buffer and huge pages are supported, send 9k packets in a single frame
55 * l. If multi-buffer is supported, try various nasty combinations of descriptors to
59 * -----
60 * - Single process spawns two threads: Tx and Rx
61 * - Each of these two threads attach to a veth interface
62 * - Each thread creates one AF_XDP socket connected to a unique umem for each
64 * - Tx thread Transmits a number of packets from veth<xxxx> to veth<yyyy>
65 * - Rx thread verifies if all packets were received and delivered in-order,
69 * --------------------------
70 * To enable L2 - L4 headers and payload dump of each packet on STDOUT, add
71 * parameter -D to params array in test_xsk.sh, i.e. params=("-S" "-D")
129 bufs = mmap(NULL, umem_sz, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); in ifobj_zc_avail()
138 umem->frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE; in ifobj_zc_avail()
141 exit_with_error(-ret); in ifobj_zc_avail()
146 ifobject->bind_flags = XDP_USE_NEED_WAKEUP | XDP_ZEROCOPY; in ifobj_zc_avail()
147 ifobject->rx_on = true; in ifobj_zc_avail()
148 xsk->rxqsize = XSK_RING_CONS__DEFAULT_NUM_DESCS; in ifobj_zc_avail()
153 xsk_socket__delete(xsk->xsk); in ifobj_zc_avail()
156 munmap(umem->buffer, umem_sz); in ifobj_zc_avail()
157 xsk_umem__delete(umem->umem); in ifobj_zc_avail()
164 {"busy-poll", no_argument, 0, 'b'},
178 " -i, --interface Use interface\n" in print_usage()
179 " -v, --verbose Verbose output\n" in print_usage()
180 " -b, --busy-poll Enable busy poll\n" in print_usage()
181 " -m, --mode Run only mode skb, drv, or zc\n" in print_usage()
182 " -l, --list List all available tests\n" in print_usage()
183 " -t, --test Run a specific test. Enter number from -l option.\n" in print_usage()
184 " -h, --help Display this help and exit\n"; in print_usage()
192 if (!strcmp(ifobj->ifname, "")) in validate_interface()
208 if (c == -1) in parse_command_line()
220 memcpy(ifobj->ifname, optarg, in parse_command_line()
223 ifobj->ifindex = if_nametoindex(ifobj->ifname); in parse_command_line()
224 if (!ifobj->ifindex) in parse_command_line()
233 ifobj_tx->busy_poll = true; in parse_command_line()
234 ifobj_rx->busy_poll = true; in parse_command_line()
264 xsk_xdp_progs__destroy(ifobj->xdp_progs); in xsk_unload_xdp_programs()
271 ret = test->test_func(test); in run_pkt_test()
276 test->name); in run_pkt_test()
280 test->name); in run_pkt_test()
284 test->name); in run_pkt_test()
287 ksft_test_result_fail("FAIL: %s %s%s -- Unexpected returned value (%d)\n", in run_pkt_test()
288 mode_string(test), busy_poll_string(test), test->name, ret); in run_pkt_test()
330 printf("%u: %s\n", i, ci_skip_tests[i - ARRAY_SIZE(tests)].name); in print_tests()
368 shared_netdev = (ifobj_tx->ifindex == ifobj_rx->ifindex); in main()
369 ifobj_tx->shared_umem = shared_netdev; in main()
370 ifobj_rx->shared_umem = shared_netdev; in main()
375 if (is_xdp_supported(ifobj_tx->ifindex)) { in main()
381 ret = get_hw_ring_size(ifobj_tx->ifname, &ifobj_tx->ring); in main()
383 ifobj_tx->hw_ring_size_supp = true; in main()
384 ifobj_tx->set_ring.default_tx = ifobj_tx->ring.tx_pending; in main()
385 ifobj_tx->set_ring.default_rx = ifobj_tx->ring.rx_pending; in main()
414 ksft_print_msg("Error: zero-copy mode not supported.\n"); in main()
433 &ci_skip_tests[j - ARRAY_SIZE(tests)]); in main()
442 if (ifobj_tx->hw_ring_size_supp) in main()