• Home
  • Raw
  • Download

Lines Matching refs:opt

153 	void (*tester)(int cg_fd, struct sockmap_options *opt);
416 struct sockmap_options *opt) in msg_loop_sendpage() argument
418 bool drop = opt->drop_expected; in msg_loop_sendpage()
553 struct sockmap_options *opt) in msg_loop() argument
557 bool drop = opt->drop_expected; in msg_loop()
558 bool data = opt->data_test; in msg_loop()
561 if (!tx && opt->check_recved_len) in msg_loop()
582 if (opt->tx_wait_mem && errno == EACCES) { in msg_loop()
645 if (opt->verbose) in msg_loop()
652 if (opt->tx_wait_mem) { in msg_loop()
686 if (opt->check_recved_len && s->bytes_recvd > total_bytes) { in msg_loop()
694 int chunk_sz = opt->sendpage ? in msg_loop()
738 static int sendmsg_test(struct sockmap_options *opt) in sendmsg_test() argument
743 int iov_count = opt->iov_count; in sendmsg_test()
744 int iov_buf = opt->iov_length; in sendmsg_test()
746 int cnt = opt->rate; in sendmsg_test()
750 if (opt->base) in sendmsg_test()
761 err = sockmap_init_ktls(opt->verbose, rx_fd); in sendmsg_test()
765 err = sockmap_init_ktls(opt->verbose, c1); in sendmsg_test()
770 if (opt->tx_wait_mem) { in sendmsg_test()
790 if (opt->drop_expected || txmsg_ktls_skb_drop) in sendmsg_test()
796 if (opt->sendpage) in sendmsg_test()
799 cnt, &s, false, opt); in sendmsg_test()
800 if (opt->verbose > 1) in sendmsg_test()
808 if (opt->verbose > 1) in sendmsg_test()
822 if (opt->tx_wait_mem) in sendmsg_test()
827 if (opt->sendpage) in sendmsg_test()
828 err = msg_loop_sendpage(c1, iov_buf, cnt, &s, opt); in sendmsg_test()
831 cnt, &s, true, opt); in sendmsg_test()
841 if (opt->verbose > 1) in sendmsg_test()
870 static int forever_ping_pong(int rate, struct sockmap_options *opt) in forever_ping_pong() argument
935 if (opt->verbose) { in forever_ping_pong()
1377 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1383 opt->sendpage = true; in __test_exec()
1385 opt->sendpage = false; in __test_exec()
1388 opt->drop_expected = true; in __test_exec()
1390 opt->drop_expected = false; in __test_exec()
1394 if (opt->verbose) { in __test_exec()
1397 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1401 err = run_options(opt, cgrp, test); in __test_exec()
1402 if (opt->verbose) in __test_exec()
1410 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1412 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1417 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1422 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1428 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1430 opt->iov_length = 1; in test_send_one()
1431 opt->iov_count = 1; in test_send_one()
1432 opt->rate = 1; in test_send_one()
1433 test_exec(cgrp, opt); in test_send_one()
1435 opt->iov_length = 1; in test_send_one()
1436 opt->iov_count = 1024; in test_send_one()
1437 opt->rate = 1; in test_send_one()
1438 test_exec(cgrp, opt); in test_send_one()
1440 opt->iov_length = 1024; in test_send_one()
1441 opt->iov_count = 1; in test_send_one()
1442 opt->rate = 1; in test_send_one()
1443 test_exec(cgrp, opt); in test_send_one()
1447 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1449 opt->iov_length = 3; in test_send_many()
1450 opt->iov_count = 1; in test_send_many()
1451 opt->rate = 512; in test_send_many()
1452 test_exec(cgrp, opt); in test_send_many()
1454 opt->rate = 100; in test_send_many()
1455 opt->iov_count = 1; in test_send_many()
1456 opt->iov_length = 5; in test_send_many()
1457 test_exec(cgrp, opt); in test_send_many()
1460 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1462 opt->iov_length = 256; in test_send_large()
1463 opt->iov_count = 1024; in test_send_large()
1464 opt->rate = 2; in test_send_large()
1465 test_exec(cgrp, opt); in test_send_large()
1468 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1470 test_send_one(opt, cgrp); in test_send()
1471 test_send_many(opt, cgrp); in test_send()
1472 test_send_large(opt, cgrp); in test_send()
1476 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1480 test_send(opt, cgrp); in test_txmsg_pass()
1483 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1486 test_send(opt, cgrp); in test_txmsg_redir()
1489 static void test_txmsg_redir_wait_sndmem(int cgrp, struct sockmap_options *opt) in test_txmsg_redir_wait_sndmem() argument
1492 opt->tx_wait_mem = true; in test_txmsg_redir_wait_sndmem()
1493 test_send_large(opt, cgrp); in test_txmsg_redir_wait_sndmem()
1494 opt->tx_wait_mem = false; in test_txmsg_redir_wait_sndmem()
1497 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1500 test_send(opt, cgrp); in test_txmsg_drop()
1503 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1507 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1510 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1512 bool data = opt->data_test; in test_txmsg_skb()
1515 opt->data_test = true; in test_txmsg_skb()
1527 opt->iov_length = 100; in test_txmsg_skb()
1528 opt->iov_count = 1; in test_txmsg_skb()
1529 opt->rate = 1; in test_txmsg_skb()
1530 test_exec(cgrp, opt); in test_txmsg_skb()
1533 test_exec(cgrp, opt); in test_txmsg_skb()
1537 test_exec(cgrp, opt); in test_txmsg_skb()
1544 test_exec(cgrp, opt); in test_txmsg_skb()
1547 test_exec(cgrp, opt); in test_txmsg_skb()
1551 test_exec(cgrp, opt); in test_txmsg_skb()
1554 test_exec(cgrp, opt); in test_txmsg_skb()
1557 opt->data_test = data; in test_txmsg_skb()
1568 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1574 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1580 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1586 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1589 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1594 test_send(opt, cgrp); in test_txmsg_pull()
1599 test_send_large(opt, cgrp); in test_txmsg_pull()
1605 test_send(opt, cgrp); in test_txmsg_pull()
1612 test_send_many(opt, cgrp); in test_txmsg_pull()
1619 test_send_many(opt, cgrp); in test_txmsg_pull()
1622 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1627 test_send_many(opt, cgrp); in test_txmsg_pop()
1632 test_send_large(opt, cgrp); in test_txmsg_pop()
1638 test_send_many(opt, cgrp); in test_txmsg_pop()
1645 test_send_many(opt, cgrp); in test_txmsg_pop()
1652 test_send_many(opt, cgrp); in test_txmsg_pop()
1655 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1660 test_send(opt, cgrp); in test_txmsg_push()
1665 test_send_large(opt, cgrp); in test_txmsg_push()
1671 test_send_many(opt, cgrp); in test_txmsg_push()
1678 test_send_many(opt, cgrp); in test_txmsg_push()
1681 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1687 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1690 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1697 test_send_one(opt, cgrp); in test_txmsg_apply()
1704 test_send_one(opt, cgrp); in test_txmsg_apply()
1711 test_send_one(opt, cgrp); in test_txmsg_apply()
1718 test_send_large(opt, cgrp); in test_txmsg_apply()
1725 test_send_large(opt, cgrp); in test_txmsg_apply()
1732 test_send_large(opt, cgrp); in test_txmsg_apply()
1735 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1741 test_send(opt, cgrp); in test_txmsg_cork()
1747 test_send(opt, cgrp); in test_txmsg_cork()
1750 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1756 opt->iov_length = 256; in test_txmsg_ingress_parser()
1757 opt->iov_count = 1; in test_txmsg_ingress_parser()
1758 opt->rate = 2; in test_txmsg_ingress_parser()
1759 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1762 static void test_txmsg_ingress_parser2(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser2() argument
1767 opt->iov_length = 20; in test_txmsg_ingress_parser2()
1768 opt->iov_count = 1; in test_txmsg_ingress_parser2()
1769 opt->rate = 1; in test_txmsg_ingress_parser2()
1770 opt->check_recved_len = true; in test_txmsg_ingress_parser2()
1771 test_exec(cgrp, opt); in test_txmsg_ingress_parser2()
1772 opt->check_recved_len = false; in test_txmsg_ingress_parser2()
1874 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1878 if (!opt->whitelist) in check_whitelist()
1880 ptr = strdup(opt->whitelist); in check_whitelist()
1885 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
1886 strstr(opt->map, entry) != 0 || in check_whitelist()
1894 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
1898 if (!opt->blacklist) in check_blacklist()
1900 ptr = strdup(opt->blacklist); in check_blacklist()
1905 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
1906 strstr(opt->map, entry) != 0 || in check_blacklist()
1914 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1918 err = populate_progs(opt->map); in __test_selftests()
1928 if (check_whitelist(&t, opt) != 0) in __test_selftests()
1930 if (check_blacklist(&t, opt) == 0) in __test_selftests()
1933 test_start_subtest(&t, opt); in __test_selftests()
1934 t.tester(cg_fd, opt); in __test_selftests()
1941 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1943 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
1944 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1947 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1949 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
1950 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1953 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
1955 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
1956 opt->prepend = "ktls"; in test_selftests_ktls()
1958 __test_selftests(cg_fd, opt); in test_selftests_ktls()
1962 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
1965 test_selftests_sockmap(cg_fd, opt); in test_selftest()
1966 test_selftests_sockhash(cg_fd, opt); in test_selftest()
1967 test_selftests_ktls(cg_fd, opt); in test_selftest()
1976 int opt, longindex, err, cg_fd = 0; in main() local
1981 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
1983 switch (opt) { in main()