Lines Matching refs:opt
154 void (*tester)(int cg_fd, struct sockmap_options *opt);
417 struct sockmap_options *opt) in msg_loop_sendpage() argument
419 bool drop = opt->drop_expected; in msg_loop_sendpage()
554 struct sockmap_options *opt) in msg_loop() argument
558 bool drop = opt->drop_expected; in msg_loop()
559 bool data = opt->data_test; in msg_loop()
562 if (!tx && opt->check_recved_len) in msg_loop()
642 if (opt->verbose) in msg_loop()
673 if (opt->check_recved_len && s->bytes_recvd > total_bytes) { in msg_loop()
681 int chunk_sz = opt->sendpage ? in msg_loop()
725 static int sendmsg_test(struct sockmap_options *opt) in sendmsg_test() argument
730 int iov_count = opt->iov_count; in sendmsg_test()
731 int iov_buf = opt->iov_length; in sendmsg_test()
733 int cnt = opt->rate; in sendmsg_test()
737 if (opt->base) in sendmsg_test()
748 err = sockmap_init_ktls(opt->verbose, rx_fd); in sendmsg_test()
752 err = sockmap_init_ktls(opt->verbose, c1); in sendmsg_test()
761 if (opt->drop_expected || txmsg_ktls_skb_drop) in sendmsg_test()
767 if (opt->sendpage) in sendmsg_test()
770 cnt, &s, false, opt); in sendmsg_test()
771 if (opt->verbose > 1) in sendmsg_test()
779 if (opt->verbose > 1) in sendmsg_test()
795 if (opt->sendpage) in sendmsg_test()
796 err = msg_loop_sendpage(c1, iov_buf, cnt, &s, opt); in sendmsg_test()
799 cnt, &s, true, opt); in sendmsg_test()
809 if (opt->verbose > 1) in sendmsg_test()
838 static int forever_ping_pong(int rate, struct sockmap_options *opt) in forever_ping_pong() argument
903 if (opt->verbose) { in forever_ping_pong()
1345 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1351 opt->sendpage = true; in __test_exec()
1353 opt->sendpage = false; in __test_exec()
1356 opt->drop_expected = true; in __test_exec()
1358 opt->drop_expected = false; in __test_exec()
1362 if (opt->verbose) { in __test_exec()
1365 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1369 err = run_options(opt, cgrp, test); in __test_exec()
1370 if (opt->verbose) in __test_exec()
1378 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1380 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1385 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1390 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1396 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1398 opt->iov_length = 1; in test_send_one()
1399 opt->iov_count = 1; in test_send_one()
1400 opt->rate = 1; in test_send_one()
1401 test_exec(cgrp, opt); in test_send_one()
1403 opt->iov_length = 1; in test_send_one()
1404 opt->iov_count = 1024; in test_send_one()
1405 opt->rate = 1; in test_send_one()
1406 test_exec(cgrp, opt); in test_send_one()
1408 opt->iov_length = 1024; in test_send_one()
1409 opt->iov_count = 1; in test_send_one()
1410 opt->rate = 1; in test_send_one()
1411 test_exec(cgrp, opt); in test_send_one()
1415 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1417 opt->iov_length = 3; in test_send_many()
1418 opt->iov_count = 1; in test_send_many()
1419 opt->rate = 512; in test_send_many()
1420 test_exec(cgrp, opt); in test_send_many()
1422 opt->rate = 100; in test_send_many()
1423 opt->iov_count = 1; in test_send_many()
1424 opt->iov_length = 5; in test_send_many()
1425 test_exec(cgrp, opt); in test_send_many()
1428 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1430 opt->iov_length = 256; in test_send_large()
1431 opt->iov_count = 1024; in test_send_large()
1432 opt->rate = 2; in test_send_large()
1433 test_exec(cgrp, opt); in test_send_large()
1436 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1438 test_send_one(opt, cgrp); in test_send()
1439 test_send_many(opt, cgrp); in test_send()
1440 test_send_large(opt, cgrp); in test_send()
1444 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1448 test_send(opt, cgrp); in test_txmsg_pass()
1451 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1454 test_send(opt, cgrp); in test_txmsg_redir()
1457 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1460 test_send(opt, cgrp); in test_txmsg_drop()
1463 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1467 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1470 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1472 bool data = opt->data_test; in test_txmsg_skb()
1475 opt->data_test = true; in test_txmsg_skb()
1487 opt->iov_length = 100; in test_txmsg_skb()
1488 opt->iov_count = 1; in test_txmsg_skb()
1489 opt->rate = 1; in test_txmsg_skb()
1490 test_exec(cgrp, opt); in test_txmsg_skb()
1493 test_exec(cgrp, opt); in test_txmsg_skb()
1497 test_exec(cgrp, opt); in test_txmsg_skb()
1504 test_exec(cgrp, opt); in test_txmsg_skb()
1507 test_exec(cgrp, opt); in test_txmsg_skb()
1511 test_exec(cgrp, opt); in test_txmsg_skb()
1514 test_exec(cgrp, opt); in test_txmsg_skb()
1517 opt->data_test = data; in test_txmsg_skb()
1528 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1534 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1540 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1546 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1549 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1554 test_send(opt, cgrp); in test_txmsg_pull()
1559 test_send_large(opt, cgrp); in test_txmsg_pull()
1565 test_send(opt, cgrp); in test_txmsg_pull()
1572 test_send_many(opt, cgrp); in test_txmsg_pull()
1579 test_send_many(opt, cgrp); in test_txmsg_pull()
1582 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1587 test_send_many(opt, cgrp); in test_txmsg_pop()
1592 test_send_large(opt, cgrp); in test_txmsg_pop()
1598 test_send_many(opt, cgrp); in test_txmsg_pop()
1605 test_send_many(opt, cgrp); in test_txmsg_pop()
1612 test_send_many(opt, cgrp); in test_txmsg_pop()
1615 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1620 test_send(opt, cgrp); in test_txmsg_push()
1625 test_send_large(opt, cgrp); in test_txmsg_push()
1631 test_send_many(opt, cgrp); in test_txmsg_push()
1638 test_send_many(opt, cgrp); in test_txmsg_push()
1641 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1647 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1650 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1656 test_send_one(opt, cgrp); in test_txmsg_apply()
1662 test_send_one(opt, cgrp); in test_txmsg_apply()
1668 test_send_large(opt, cgrp); in test_txmsg_apply()
1674 test_send_large(opt, cgrp); in test_txmsg_apply()
1677 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1683 test_send(opt, cgrp); in test_txmsg_cork()
1689 test_send(opt, cgrp); in test_txmsg_cork()
1692 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1698 opt->iov_length = 256; in test_txmsg_ingress_parser()
1699 opt->iov_count = 1; in test_txmsg_ingress_parser()
1700 opt->rate = 2; in test_txmsg_ingress_parser()
1701 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1704 static void test_txmsg_ingress_parser2(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser2() argument
1709 opt->iov_length = 20; in test_txmsg_ingress_parser2()
1710 opt->iov_count = 1; in test_txmsg_ingress_parser2()
1711 opt->rate = 1; in test_txmsg_ingress_parser2()
1712 opt->check_recved_len = true; in test_txmsg_ingress_parser2()
1713 test_exec(cgrp, opt); in test_txmsg_ingress_parser2()
1714 opt->check_recved_len = false; in test_txmsg_ingress_parser2()
1819 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1823 if (!opt->whitelist) in check_whitelist()
1825 ptr = strdup(opt->whitelist); in check_whitelist()
1830 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
1831 strstr(opt->map, entry) != 0 || in check_whitelist()
1839 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
1843 if (!opt->blacklist) in check_blacklist()
1845 ptr = strdup(opt->blacklist); in check_blacklist()
1850 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
1851 strstr(opt->map, entry) != 0 || in check_blacklist()
1859 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1863 err = populate_progs(opt->map); in __test_selftests()
1873 if (check_whitelist(&t, opt) != 0) in __test_selftests()
1875 if (check_blacklist(&t, opt) == 0) in __test_selftests()
1878 test_start_subtest(&t, opt); in __test_selftests()
1879 t.tester(cg_fd, opt); in __test_selftests()
1886 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1888 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
1889 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1892 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1894 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
1895 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1898 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
1900 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
1901 opt->prepend = "ktls"; in test_selftests_ktls()
1903 __test_selftests(cg_fd, opt); in test_selftests_ktls()
1907 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
1910 test_selftests_sockmap(cg_fd, opt); in test_selftest()
1911 test_selftests_sockhash(cg_fd, opt); in test_selftest()
1912 test_selftests_ktls(cg_fd, opt); in test_selftest()
1921 int opt, longindex, err, cg_fd = 0; in main() local
1926 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
1928 switch (opt) { in main()