test_spec
bool all_packets_received(struct test_spec *test, struct xsk_socket_info *xsk, u32 sock_num,
static int receive_pkts(struct test_spec *test)
bool all_packets_sent(struct test_spec *test, unsigned long *bitmap)
static int send_pkts(struct test_spec *test, struct ifobject *ifobject)
static int xsk_configure(struct test_spec *test, struct ifobject *ifobject,
static int thread_common_ops_tx(struct test_spec *test, struct ifobject *ifobject)
static int thread_common_ops(struct test_spec *test, struct ifobject *ifobject)
struct test_spec *test = (struct test_spec *)arg;
struct test_spec *test = (struct test_spec *)arg;
static bool xdp_prog_changed_rx(struct test_spec *test)
static bool xdp_prog_changed_tx(struct test_spec *test)
static int xsk_attach_xdp_progs(struct test_spec *test, struct ifobject *ifobj_rx,
static void clean_sockets(struct test_spec *test, struct ifobject *ifobj)
static void clean_umem(struct test_spec *test, struct ifobject *ifobj1, struct ifobject *ifobj2)
static int __testapp_validate_traffic(struct test_spec *test, struct ifobject *ifobj1,
static int testapp_validate_traffic(struct test_spec *test)
static int testapp_validate_traffic_single_thread(struct test_spec *test, struct ifobject *ifobj)
int testapp_teardown(struct test_spec *test)
int testapp_bidirectional(struct test_spec *test)
static int swap_xsk_resources(struct test_spec *test)
int testapp_xdp_prog_cleanup(struct test_spec *test)
int testapp_headroom(struct test_spec *test)
int testapp_stats_rx_dropped(struct test_spec *test)
int testapp_stats_tx_invalid_descs(struct test_spec *test)
int testapp_stats_rx_full(struct test_spec *test)
int testapp_stats_fill_empty(struct test_spec *test)
int testapp_send_receive_unaligned(struct test_spec *test)
int testapp_send_receive_unaligned_mb(struct test_spec *test)
int testapp_single_pkt(struct test_spec *test)
int testapp_send_receive_mb(struct test_spec *test)
int testapp_invalid_desc_mb(struct test_spec *test)
static void __test_spec_init(struct test_spec *test, struct ifobject *ifobj_tx,
int testapp_invalid_desc(struct test_spec *test)
int testapp_xdp_drop(struct test_spec *test)
int testapp_xdp_metadata_copy(struct test_spec *test)
int testapp_xdp_shared_umem(struct test_spec *test)
int testapp_poll_txq_tmout(struct test_spec *test)
int testapp_poll_rxq_tmout(struct test_spec *test)
int testapp_too_many_frags(struct test_spec *test)
int testapp_send_receive(struct test_spec *test)
int testapp_send_receive_2k_frame(struct test_spec *test)
int testapp_poll_rx(struct test_spec *test)
int testapp_poll_tx(struct test_spec *test)
int testapp_aligned_inv_desc(struct test_spec *test)
int testapp_aligned_inv_desc_2k_frame(struct test_spec *test)
int testapp_unaligned_inv_desc(struct test_spec *test)
int testapp_unaligned_inv_desc_4001_frame(struct test_spec *test)
int testapp_aligned_inv_desc_mb(struct test_spec *test)
int testapp_unaligned_inv_desc_mb(struct test_spec *test)
int testapp_xdp_metadata(struct test_spec *test)
int testapp_xdp_metadata_mb(struct test_spec *test)
int testapp_hw_sw_min_ring_size(struct test_spec *test)
int testapp_hw_sw_max_ring_size(struct test_spec *test)
static int testapp_xdp_adjust_tail(struct test_spec *test, int adjust_value)
static int testapp_adjust_tail(struct test_spec *test, u32 value, u32 pkt_len)
int testapp_adjust_tail_shrink(struct test_spec *test)
int testapp_adjust_tail_shrink_mb(struct test_spec *test)
int testapp_adjust_tail_grow(struct test_spec *test)
int testapp_adjust_tail_grow_mb(struct test_spec *test)
int testapp_tx_queue_consumer(struct test_spec *test)
void test_init(struct test_spec *test, struct ifobject *ifobj_tx,
const struct test_spec *test_to_run)
static void test_spec_reset(struct test_spec *test)
static void test_spec_set_xdp_prog(struct test_spec *test, struct bpf_program *xdp_prog_rx,
static int test_spec_set_mtu(struct test_spec *test, int mtu)
void pkt_stream_restore_default(struct test_spec *test)
static int pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
static int pkt_stream_replace_half(struct test_spec *test, u32 pkt_len, int offset)
static int pkt_stream_receive_half(struct test_spec *test)
static int pkt_stream_even_odd_sequence(struct test_spec *test)
static void release_even_odd_sequence(struct test_spec *test)
static int pkt_stream_generate_custom(struct test_spec *test, struct pkt *pkts, u32 nb_pkts)
static int __receive_pkts(struct test_spec *test, struct xsk_socket_info *xsk)
void pkt_stream_restore_default(struct test_spec *test);
static inline char *mode_string(struct test_spec *test)
void test_init(struct test_spec *test, struct ifobject *ifobj_tx,
const struct test_spec *test_to_run);
int testapp_adjust_tail_grow(struct test_spec *test);
int testapp_adjust_tail_grow_mb(struct test_spec *test);
int testapp_adjust_tail_shrink(struct test_spec *test);
int testapp_adjust_tail_shrink_mb(struct test_spec *test);
int testapp_aligned_inv_desc(struct test_spec *test);
int testapp_aligned_inv_desc_2k_frame(struct test_spec *test);
int testapp_aligned_inv_desc_mb(struct test_spec *test);
int testapp_bidirectional(struct test_spec *test);
int testapp_headroom(struct test_spec *test);
int testapp_hw_sw_max_ring_size(struct test_spec *test);
int testapp_hw_sw_min_ring_size(struct test_spec *test);
int testapp_poll_rx(struct test_spec *test);
int testapp_poll_rxq_tmout(struct test_spec *test);
int testapp_poll_tx(struct test_spec *test);
int testapp_poll_txq_tmout(struct test_spec *test);
int testapp_send_receive(struct test_spec *test);
int testapp_send_receive_2k_frame(struct test_spec *test);
int testapp_send_receive_mb(struct test_spec *test);
int testapp_send_receive_unaligned(struct test_spec *test);
int testapp_send_receive_unaligned_mb(struct test_spec *test);
int testapp_single_pkt(struct test_spec *test);
int testapp_stats_fill_empty(struct test_spec *test);
int testapp_stats_rx_dropped(struct test_spec *test);
int testapp_stats_tx_invalid_descs(struct test_spec *test);
int testapp_stats_rx_full(struct test_spec *test);
int testapp_teardown(struct test_spec *test);
int testapp_too_many_frags(struct test_spec *test);
int testapp_tx_queue_consumer(struct test_spec *test);
int testapp_unaligned_inv_desc(struct test_spec *test);
int testapp_unaligned_inv_desc_4001_frame(struct test_spec *test);
int testapp_unaligned_inv_desc_mb(struct test_spec *test);
int testapp_xdp_drop(struct test_spec *test);
int testapp_xdp_metadata(struct test_spec *test);
int testapp_xdp_metadata_mb(struct test_spec *test);
int testapp_xdp_prog_cleanup(struct test_spec *test);
int testapp_xdp_shared_umem(struct test_spec *test);
static const struct test_spec tests[] = {
static const struct test_spec ci_skip_tests[] = {
struct test_spec;
typedef int (*test_func_t)(struct test_spec *test);
static void test_xsk(const struct test_spec *test_to_run, enum test_mode mode)
struct test_spec test;
static bool should_do_test_run(struct test_spec *spec, struct test_subspec *subspec)
struct test_spec *specs,
struct test_spec *spec,
struct test_spec *spec_iter;
static void free_test_spec(struct test_spec *spec)
struct test_spec *specs = NULL;
specs = calloc(nr_progs, sizeof(struct test_spec));
struct test_spec *spec = &specs[i++];
struct test_spec *spec)
struct test_spec *spec,
static bool can_execute_unpriv(struct test_loader *tester, struct test_spec *spec)
char *test_spec,
subtest_str = strchr(test_spec, '/');
ext_test_str = malloc(strlen(test_spec) + glob_chars + 1);
sprintf(ext_test_str, pattern, test_spec);
char *input, *state = NULL, *test_spec;
while ((test_spec = strtok_r(cnt++ ? NULL : input, ",", &state))) {
err = insert_test(set, test_spec, is_glob_pattern);
static void run_pkt_test(struct test_spec *test)
struct test_spec test;