Lines Matching full:opt

159 	void (*tester)(int cg_fd, struct sockmap_options *opt);
422 struct sockmap_options *opt) in msg_loop_sendpage() argument
424 bool drop = opt->drop_expected; in msg_loop_sendpage()
630 struct sockmap_options *opt) in msg_loop() argument
634 bool drop = opt->drop_expected; in msg_loop()
635 bool data = opt->data_test; in msg_loop()
638 if (!tx && opt->check_recved_len) in msg_loop()
659 if (opt->tx_wait_mem && errno == EACCES) { in msg_loop()
699 if (!opt->sendpage) in msg_loop()
736 if (opt->verbose) in msg_loop()
743 if (opt->tx_wait_mem) { in msg_loop()
777 if (opt->check_recved_len && s->bytes_recvd > total_bytes) { in msg_loop()
785 int chunk_sz = opt->sendpage ? in msg_loop()
834 static int sendmsg_test(struct sockmap_options *opt) in sendmsg_test() argument
839 int iov_count = opt->iov_count; in sendmsg_test()
840 int iov_buf = opt->iov_length; in sendmsg_test()
842 int cnt = opt->rate; in sendmsg_test()
846 if (opt->base) in sendmsg_test()
857 err = sockmap_init_ktls(opt->verbose, rx_fd); in sendmsg_test()
861 err = sockmap_init_ktls(opt->verbose, c1); in sendmsg_test()
866 if (opt->tx_wait_mem) { in sendmsg_test()
884 if (opt->drop_expected || txmsg_ktls_skb_drop) in sendmsg_test()
890 if (opt->sendpage) in sendmsg_test()
893 cnt, &s, false, opt); in sendmsg_test()
894 if (opt->verbose > 1) in sendmsg_test()
902 if (opt->verbose > 1) in sendmsg_test()
916 if (opt->tx_wait_mem) in sendmsg_test()
921 if (opt->sendpage) in sendmsg_test()
922 err = msg_loop_sendpage(c1, iov_buf, cnt, &s, opt); in sendmsg_test()
925 cnt, &s, true, opt); in sendmsg_test()
935 if (opt->verbose > 1) in sendmsg_test()
964 static int forever_ping_pong(int rate, struct sockmap_options *opt) in forever_ping_pong() argument
1029 if (opt->verbose) { in forever_ping_pong()
1471 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1477 opt->sendpage = true; in __test_exec()
1479 opt->sendpage = false; in __test_exec()
1482 opt->drop_expected = true; in __test_exec()
1484 opt->drop_expected = false; in __test_exec()
1488 if (opt->verbose) { in __test_exec()
1491 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1495 err = run_options(opt, cgrp, test); in __test_exec()
1496 if (opt->verbose) in __test_exec()
1504 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1506 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1511 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1516 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1522 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1524 opt->iov_length = 1; in test_send_one()
1525 opt->iov_count = 1; in test_send_one()
1526 opt->rate = 1; in test_send_one()
1527 test_exec(cgrp, opt); in test_send_one()
1529 opt->iov_length = 1; in test_send_one()
1530 opt->iov_count = 1024; in test_send_one()
1531 opt->rate = 1; in test_send_one()
1532 test_exec(cgrp, opt); in test_send_one()
1534 opt->iov_length = 1024; in test_send_one()
1535 opt->iov_count = 1; in test_send_one()
1536 opt->rate = 1; in test_send_one()
1537 test_exec(cgrp, opt); in test_send_one()
1541 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1543 opt->iov_length = 3; in test_send_many()
1544 opt->iov_count = 1; in test_send_many()
1545 opt->rate = 512; in test_send_many()
1546 test_exec(cgrp, opt); in test_send_many()
1548 opt->rate = 100; in test_send_many()
1549 opt->iov_count = 1; in test_send_many()
1550 opt->iov_length = 5; in test_send_many()
1551 test_exec(cgrp, opt); in test_send_many()
1554 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1556 opt->iov_length = 8192; in test_send_large()
1557 opt->iov_count = 32; in test_send_large()
1558 opt->rate = 2; in test_send_large()
1559 test_exec(cgrp, opt); in test_send_large()
1562 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1564 test_send_one(opt, cgrp); in test_send()
1565 test_send_many(opt, cgrp); in test_send()
1566 test_send_large(opt, cgrp); in test_send()
1570 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1574 test_send(opt, cgrp); in test_txmsg_pass()
1577 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1580 test_send(opt, cgrp); in test_txmsg_redir()
1583 static void test_txmsg_redir_wait_sndmem(int cgrp, struct sockmap_options *opt) in test_txmsg_redir_wait_sndmem() argument
1586 opt->tx_wait_mem = true; in test_txmsg_redir_wait_sndmem()
1587 test_send_large(opt, cgrp); in test_txmsg_redir_wait_sndmem()
1588 opt->tx_wait_mem = false; in test_txmsg_redir_wait_sndmem()
1591 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1594 test_send(opt, cgrp); in test_txmsg_drop()
1597 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1601 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1604 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1606 bool data = opt->data_test; in test_txmsg_skb()
1609 opt->data_test = true; in test_txmsg_skb()
1621 opt->iov_length = 100; in test_txmsg_skb()
1622 opt->iov_count = 1; in test_txmsg_skb()
1623 opt->rate = 1; in test_txmsg_skb()
1624 test_exec(cgrp, opt); in test_txmsg_skb()
1627 test_exec(cgrp, opt); in test_txmsg_skb()
1631 test_exec(cgrp, opt); in test_txmsg_skb()
1638 test_exec(cgrp, opt); in test_txmsg_skb()
1641 test_exec(cgrp, opt); in test_txmsg_skb()
1645 test_exec(cgrp, opt); in test_txmsg_skb()
1648 test_exec(cgrp, opt); in test_txmsg_skb()
1651 opt->data_test = data; in test_txmsg_skb()
1662 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1668 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1674 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1680 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1683 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1689 test_send(opt, cgrp); in test_txmsg_pull()
1695 test_send_large(opt, cgrp); in test_txmsg_pull()
1701 test_send(opt, cgrp); in test_txmsg_pull()
1708 test_send_many(opt, cgrp); in test_txmsg_pull()
1715 test_send_many(opt, cgrp); in test_txmsg_pull()
1718 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1720 bool data = opt->data_test; in test_txmsg_pop()
1726 test_send_many(opt, cgrp); in test_txmsg_pop()
1732 test_send_large(opt, cgrp); in test_txmsg_pop()
1738 test_send_many(opt, cgrp); in test_txmsg_pop()
1745 opt->data_test = false; in test_txmsg_pop()
1751 test_send_many(opt, cgrp); in test_txmsg_pop()
1758 test_send_many(opt, cgrp); in test_txmsg_pop()
1759 opt->data_test = data; in test_txmsg_pop()
1762 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1764 bool data = opt->data_test; in test_txmsg_push()
1770 test_send(opt, cgrp); in test_txmsg_push()
1776 test_send_large(opt, cgrp); in test_txmsg_push()
1782 test_send_many(opt, cgrp); in test_txmsg_push()
1789 opt->data_test = false; in test_txmsg_push()
1795 test_send_many(opt, cgrp); in test_txmsg_push()
1796 opt->data_test = data; in test_txmsg_push()
1799 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1806 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1809 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1816 test_send_one(opt, cgrp); in test_txmsg_apply()
1823 test_send_one(opt, cgrp); in test_txmsg_apply()
1830 test_send_one(opt, cgrp); in test_txmsg_apply()
1837 test_send_large(opt, cgrp); in test_txmsg_apply()
1844 test_send_large(opt, cgrp); in test_txmsg_apply()
1851 test_send_large(opt, cgrp); in test_txmsg_apply()
1854 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1860 test_send(opt, cgrp); in test_txmsg_cork()
1866 test_send(opt, cgrp); in test_txmsg_cork()
1869 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1875 opt->iov_length = 256; in test_txmsg_ingress_parser()
1876 opt->iov_count = 1; in test_txmsg_ingress_parser()
1877 opt->rate = 2; in test_txmsg_ingress_parser()
1878 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1881 static void test_txmsg_ingress_parser2(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser2() argument
1886 opt->iov_length = 20; in test_txmsg_ingress_parser2()
1887 opt->iov_count = 1; in test_txmsg_ingress_parser2()
1888 opt->rate = 1; in test_txmsg_ingress_parser2()
1889 opt->check_recved_len = true; in test_txmsg_ingress_parser2()
1890 test_exec(cgrp, opt); in test_txmsg_ingress_parser2()
1891 opt->check_recved_len = false; in test_txmsg_ingress_parser2()
1993 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1997 if (!opt->whitelist) in check_whitelist()
1999 ptr = strdup(opt->whitelist); in check_whitelist()
2004 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
2005 strstr(opt->map, entry) != 0 || in check_whitelist()
2013 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
2017 if (!opt->blacklist) in check_blacklist()
2019 ptr = strdup(opt->blacklist); in check_blacklist()
2024 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
2025 strstr(opt->map, entry) != 0 || in check_blacklist()
2033 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
2037 err = populate_progs(opt->map); in __test_selftests()
2047 if (check_whitelist(&t, opt) != 0) in __test_selftests()
2049 if (check_blacklist(&t, opt) == 0) in __test_selftests()
2052 test_start_subtest(&t, opt); in __test_selftests()
2053 t.tester(cg_fd, opt); in __test_selftests()
2060 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
2062 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
2063 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
2066 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
2068 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
2069 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
2072 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
2074 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
2075 opt->prepend = "ktls"; in test_selftests_ktls()
2077 __test_selftests(cg_fd, opt); in test_selftests_ktls()
2081 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
2084 test_selftests_sockmap(cg_fd, opt); in test_selftest()
2085 test_selftests_sockhash(cg_fd, opt); in test_selftest()
2086 test_selftests_ktls(cg_fd, opt); in test_selftest()
2095 int opt, longindex, err, cg_fd = 0; in main() local
2100 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
2102 switch (opt) { in main()