Lines Matching refs:ifobj_rx
335 static void parse_command_line(struct ifobject *ifobj_tx, struct ifobject *ifobj_rx, int argc, in parse_command_line() argument
354 ifobj = ifobj_rx; in parse_command_line()
372 ifobj_rx->busy_poll = true; in parse_command_line()
382 struct ifobject *ifobj_rx) in __test_spec_init() argument
387 struct ifobject *ifobj = i ? ifobj_rx : ifobj_tx; in __test_spec_init()
417 test->ifobj_rx = ifobj_rx; in __test_spec_init()
423 test->xdp_prog_rx = ifobj_rx->xdp_progs->progs.xsk_def_prog; in __test_spec_init()
424 test->xskmap_rx = ifobj_rx->xdp_progs->maps.xsk; in __test_spec_init()
430 struct ifobject *ifobj_rx, enum test_mode mode) in test_spec_init() argument
443 struct ifobject *ifobj = i ? ifobj_rx : ifobj_tx; in test_spec_init()
453 __test_spec_init(test, ifobj_tx, ifobj_rx); in test_spec_init()
458 __test_spec_init(test, test->ifobj_tx, test->ifobj_rx); in test_spec_reset()
480 if (test->ifobj_rx->mtu != mtu) { in test_spec_set_mtu()
481 err = xsk_set_mtu(test->ifobj_rx->ifindex, mtu); in test_spec_set_mtu()
484 test->ifobj_rx->mtu = mtu; in test_spec_set_mtu()
530 struct pkt_stream *rx_pkt_stream = test->ifobj_rx->pkt_stream; in pkt_stream_restore_default()
538 pkt_stream_delete(test->ifobj_rx->pkt_stream); in pkt_stream_restore_default()
539 test->ifobj_rx->pkt_stream = test->rx_pkt_stream_default; in pkt_stream_restore_default()
647 pkt_stream = pkt_stream_generate(test->ifobj_rx->umem, nb_pkts, pkt_len); in pkt_stream_replace()
648 test->ifobj_rx->pkt_stream = pkt_stream; in pkt_stream_replace()
668 __pkt_stream_replace_half(test->ifobj_rx, pkt_len, offset); in pkt_stream_replace_half()
673 struct xsk_umem_info *umem = test->ifobj_rx->umem; in pkt_stream_receive_half()
677 test->ifobj_rx->pkt_stream = pkt_stream_generate(umem, pkt_stream->nb_pkts, in pkt_stream_receive_half()
679 pkt_stream = test->ifobj_rx->pkt_stream; in pkt_stream_receive_half()
767 pkt_stream = __pkt_stream_generate_custom(test->ifobj_rx, pkts, nb_pkts, false); in pkt_stream_generate_custom()
768 test->ifobj_rx->pkt_stream = pkt_stream; in pkt_stream_generate_custom()
970 struct pkt_stream *pkt_stream = test->ifobj_rx->pkt_stream; in receive_pkts()
971 struct xsk_socket_info *xsk = test->ifobj_rx->xsk; in receive_pkts()
973 struct ifobject *ifobj = test->ifobj_rx; in receive_pkts()
1219 bool timeout = !is_umem_valid(test->ifobj_rx); in send_pkts()
1378 xsk_configure_socket(test, ifobject, test->ifobj_rx->umem, true); in thread_common_ops_tx()
1380 ifobject->xskmap = test->ifobj_rx->xskmap; in thread_common_ops_tx()
1381 memcpy(ifobject->umem, test->ifobj_rx->umem, sizeof(struct xsk_umem_info)); in thread_common_ops_tx()
1493 struct ifobject *ifobject = test->ifobj_rx; in worker_testapp_validate_rx()
1547 struct ifobject *ifobj = test->ifobj_rx; in xdp_prog_changed_rx()
1582 static void xsk_attach_xdp_progs(struct test_spec *test, struct ifobject *ifobj_rx, in xsk_attach_xdp_progs() argument
1586 xsk_reattach_xdp(ifobj_rx, test->xdp_prog_rx, test->xskmap_rx, test->mode); in xsk_attach_xdp_progs()
1663 struct ifobject *ifobj_rx = test->ifobj_rx; in testapp_validate_traffic() local
1666 if ((ifobj_rx->umem->unaligned_mode && !ifobj_rx->unaligned_supp) || in testapp_validate_traffic()
1672 xsk_attach_xdp_progs(test, ifobj_rx, ifobj_tx); in testapp_validate_traffic()
1673 return __testapp_validate_traffic(test, ifobj_rx, ifobj_tx); in testapp_validate_traffic()
1713 test->ifobj_rx->tx_on = true; in testapp_bidi()
1719 swap_directions(&test->ifobj_rx, &test->ifobj_tx); in testapp_bidi()
1720 res = __testapp_validate_traffic(test, test->ifobj_rx, test->ifobj_tx); in testapp_bidi()
1722 swap_directions(&test->ifobj_rx, &test->ifobj_tx); in testapp_bidi()
1726 static void swap_xsk_resources(struct ifobject *ifobj_tx, struct ifobject *ifobj_rx) in swap_xsk_resources() argument
1731 xsk_socket__delete(ifobj_rx->xsk->xsk); in swap_xsk_resources()
1733 ifobj_rx->xsk = &ifobj_rx->xsk_arr[1]; in swap_xsk_resources()
1735 ret = xsk_update_xskmap(ifobj_rx->xskmap, ifobj_rx->xsk->xsk); in swap_xsk_resources()
1748 swap_xsk_resources(test->ifobj_tx, test->ifobj_rx); in testapp_bpf_res()
1755 test->ifobj_rx->umem->frame_headroom = UMEM_HEADROOM_TEST_SIZE; in testapp_headroom()
1768 test->ifobj_rx->umem->frame_headroom = test->ifobj_rx->umem->frame_size - in testapp_stats_rx_dropped()
1771 test->ifobj_rx->validation_func = validate_rx_dropped; in testapp_stats_rx_dropped()
1787 test->ifobj_rx->pkt_stream = pkt_stream_generate(test->ifobj_rx->umem, in testapp_stats_rx_full()
1790 test->ifobj_rx->xsk->rxqsize = DEFAULT_UMEM_BUFFERS; in testapp_stats_rx_full()
1791 test->ifobj_rx->release_rx = false; in testapp_stats_rx_full()
1792 test->ifobj_rx->validation_func = validate_rx_full; in testapp_stats_rx_full()
1800 test->ifobj_rx->pkt_stream = pkt_stream_generate(test->ifobj_rx->umem, in testapp_stats_fill_empty()
1803 test->ifobj_rx->use_fill_ring = false; in testapp_stats_fill_empty()
1804 test->ifobj_rx->validation_func = validate_fill_empty; in testapp_stats_fill_empty()
1812 test->ifobj_rx->umem->unaligned_mode = true; in testapp_unaligned()
1824 test->ifobj_rx->umem->unaligned_mode = true; in testapp_unaligned_mb()
1933 struct xsk_xdp_progs *skel_rx = test->ifobj_rx->xdp_progs; in testapp_xdp_drop()
1946 struct xsk_xdp_progs *skel_rx = test->ifobj_rx->xdp_progs; in testapp_xdp_metadata_count()
1955 test->ifobj_rx->use_metadata = true; in testapp_xdp_metadata_count()
1981 test->ifobj_rx->use_poll = true; in testapp_poll_rxq_tmout()
1982 return testapp_validate_traffic_single_thread(test, test->ifobj_rx); in testapp_poll_rxq_tmout()
2134 test->ifobj_rx->umem->frame_size = 2048; in run_pkt_test()
2139 test->ifobj_rx->use_poll = true; in run_pkt_test()
2161 test->ifobj_rx->umem->frame_size = 2048; in run_pkt_test()
2167 test->ifobj_rx->umem->unaligned_mode = true; in run_pkt_test()
2176 test->ifobj_rx->umem->frame_size = 4001; in run_pkt_test()
2178 test->ifobj_rx->umem->unaligned_mode = true; in run_pkt_test()
2196 test->ifobj_rx->umem->unaligned_mode = true; in run_pkt_test()
2297 struct ifobject *ifobj_tx, *ifobj_rx; in main() local
2309 ifobj_rx = ifobject_create(); in main()
2310 if (!ifobj_rx) in main()
2315 parse_command_line(ifobj_tx, ifobj_rx, argc, argv); in main()
2317 shared_netdev = (ifobj_tx->ifindex == ifobj_rx->ifindex); in main()
2319 ifobj_rx->shared_umem = shared_netdev; in main()
2321 if (!validate_interface(ifobj_tx) || !validate_interface(ifobj_rx)) { in main()
2332 init_iface(ifobj_rx, MAC1, MAC2, worker_testapp_validate_rx); in main()
2335 test_spec_init(&test, ifobj_tx, ifobj_rx, 0); in main()
2337 rx_pkt_stream_default = pkt_stream_generate(ifobj_rx->umem, DEFAULT_PKT_CNT, MIN_PKT_SIZE); in main()
2347 test_spec_init(&test, ifobj_tx, ifobj_rx, i); in main()
2359 xsk_unload_xdp_programs(ifobj_rx); in main()
2361 ifobject_delete(ifobj_rx); in main()