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()
583 if (opt->tx_wait_mem && errno == EACCES) { in msg_loop()
646 if (opt->verbose) in msg_loop()
653 if (opt->tx_wait_mem) { in msg_loop()
687 if (opt->check_recved_len && s->bytes_recvd > total_bytes) { in msg_loop()
695 int chunk_sz = opt->sendpage ? in msg_loop()
739 static int sendmsg_test(struct sockmap_options *opt) in sendmsg_test() argument
744 int iov_count = opt->iov_count; in sendmsg_test()
745 int iov_buf = opt->iov_length; in sendmsg_test()
747 int cnt = opt->rate; in sendmsg_test()
751 if (opt->base) in sendmsg_test()
762 err = sockmap_init_ktls(opt->verbose, rx_fd); in sendmsg_test()
766 err = sockmap_init_ktls(opt->verbose, c1); in sendmsg_test()
771 if (opt->tx_wait_mem) { in sendmsg_test()
791 if (opt->drop_expected || txmsg_ktls_skb_drop) in sendmsg_test()
797 if (opt->sendpage) in sendmsg_test()
800 cnt, &s, false, opt); in sendmsg_test()
801 if (opt->verbose > 1) in sendmsg_test()
809 if (opt->verbose > 1) in sendmsg_test()
823 if (opt->tx_wait_mem) in sendmsg_test()
828 if (opt->sendpage) in sendmsg_test()
829 err = msg_loop_sendpage(c1, iov_buf, cnt, &s, opt); in sendmsg_test()
832 cnt, &s, true, opt); in sendmsg_test()
842 if (opt->verbose > 1) in sendmsg_test()
871 static int forever_ping_pong(int rate, struct sockmap_options *opt) in forever_ping_pong() argument
936 if (opt->verbose) { in forever_ping_pong()
1374 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1380 opt->sendpage = true; in __test_exec()
1382 opt->sendpage = false; in __test_exec()
1385 opt->drop_expected = true; in __test_exec()
1387 opt->drop_expected = false; in __test_exec()
1391 if (opt->verbose) { in __test_exec()
1394 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1398 err = run_options(opt, cgrp, test); in __test_exec()
1399 if (opt->verbose) in __test_exec()
1407 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1409 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1414 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1419 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1425 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1427 opt->iov_length = 1; in test_send_one()
1428 opt->iov_count = 1; in test_send_one()
1429 opt->rate = 1; in test_send_one()
1430 test_exec(cgrp, opt); in test_send_one()
1432 opt->iov_length = 1; in test_send_one()
1433 opt->iov_count = 1024; in test_send_one()
1434 opt->rate = 1; in test_send_one()
1435 test_exec(cgrp, opt); in test_send_one()
1437 opt->iov_length = 1024; in test_send_one()
1438 opt->iov_count = 1; in test_send_one()
1439 opt->rate = 1; in test_send_one()
1440 test_exec(cgrp, opt); in test_send_one()
1444 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1446 opt->iov_length = 3; in test_send_many()
1447 opt->iov_count = 1; in test_send_many()
1448 opt->rate = 512; in test_send_many()
1449 test_exec(cgrp, opt); in test_send_many()
1451 opt->rate = 100; in test_send_many()
1452 opt->iov_count = 1; in test_send_many()
1453 opt->iov_length = 5; in test_send_many()
1454 test_exec(cgrp, opt); in test_send_many()
1457 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1459 opt->iov_length = 256; in test_send_large()
1460 opt->iov_count = 1024; in test_send_large()
1461 opt->rate = 2; in test_send_large()
1462 test_exec(cgrp, opt); in test_send_large()
1465 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1467 test_send_one(opt, cgrp); in test_send()
1468 test_send_many(opt, cgrp); in test_send()
1469 test_send_large(opt, cgrp); in test_send()
1473 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1477 test_send(opt, cgrp); in test_txmsg_pass()
1480 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1483 test_send(opt, cgrp); in test_txmsg_redir()
1486 static void test_txmsg_redir_wait_sndmem(int cgrp, struct sockmap_options *opt) in test_txmsg_redir_wait_sndmem() argument
1489 opt->tx_wait_mem = true; in test_txmsg_redir_wait_sndmem()
1490 test_send_large(opt, cgrp); in test_txmsg_redir_wait_sndmem()
1491 opt->tx_wait_mem = false; in test_txmsg_redir_wait_sndmem()
1494 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1497 test_send(opt, cgrp); in test_txmsg_drop()
1500 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1504 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1507 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1509 bool data = opt->data_test; in test_txmsg_skb()
1512 opt->data_test = true; in test_txmsg_skb()
1524 opt->iov_length = 100; in test_txmsg_skb()
1525 opt->iov_count = 1; in test_txmsg_skb()
1526 opt->rate = 1; in test_txmsg_skb()
1527 test_exec(cgrp, opt); in test_txmsg_skb()
1530 test_exec(cgrp, opt); in test_txmsg_skb()
1534 test_exec(cgrp, opt); in test_txmsg_skb()
1541 test_exec(cgrp, opt); in test_txmsg_skb()
1544 test_exec(cgrp, opt); in test_txmsg_skb()
1548 test_exec(cgrp, opt); in test_txmsg_skb()
1551 test_exec(cgrp, opt); in test_txmsg_skb()
1554 opt->data_test = data; in test_txmsg_skb()
1565 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1571 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1577 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1583 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1586 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1591 test_send(opt, cgrp); in test_txmsg_pull()
1596 test_send_large(opt, cgrp); in test_txmsg_pull()
1602 test_send(opt, cgrp); in test_txmsg_pull()
1609 test_send_many(opt, cgrp); in test_txmsg_pull()
1616 test_send_many(opt, cgrp); in test_txmsg_pull()
1619 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1624 test_send_many(opt, cgrp); in test_txmsg_pop()
1629 test_send_large(opt, cgrp); in test_txmsg_pop()
1635 test_send_many(opt, cgrp); in test_txmsg_pop()
1642 test_send_many(opt, cgrp); in test_txmsg_pop()
1649 test_send_many(opt, cgrp); in test_txmsg_pop()
1652 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1657 test_send(opt, cgrp); in test_txmsg_push()
1662 test_send_large(opt, cgrp); in test_txmsg_push()
1668 test_send_many(opt, cgrp); in test_txmsg_push()
1675 test_send_many(opt, cgrp); in test_txmsg_push()
1678 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1684 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1687 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1694 test_send_one(opt, cgrp); in test_txmsg_apply()
1701 test_send_one(opt, cgrp); in test_txmsg_apply()
1708 test_send_one(opt, cgrp); in test_txmsg_apply()
1715 test_send_large(opt, cgrp); in test_txmsg_apply()
1722 test_send_large(opt, cgrp); in test_txmsg_apply()
1729 test_send_large(opt, cgrp); in test_txmsg_apply()
1732 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1738 test_send(opt, cgrp); in test_txmsg_cork()
1744 test_send(opt, cgrp); in test_txmsg_cork()
1747 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1753 opt->iov_length = 256; in test_txmsg_ingress_parser()
1754 opt->iov_count = 1; in test_txmsg_ingress_parser()
1755 opt->rate = 2; in test_txmsg_ingress_parser()
1756 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1759 static void test_txmsg_ingress_parser2(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser2() argument
1764 opt->iov_length = 20; in test_txmsg_ingress_parser2()
1765 opt->iov_count = 1; in test_txmsg_ingress_parser2()
1766 opt->rate = 1; in test_txmsg_ingress_parser2()
1767 opt->check_recved_len = true; in test_txmsg_ingress_parser2()
1768 test_exec(cgrp, opt); in test_txmsg_ingress_parser2()
1769 opt->check_recved_len = false; in test_txmsg_ingress_parser2()
1843 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1847 if (!opt->whitelist) in check_whitelist()
1849 ptr = strdup(opt->whitelist); in check_whitelist()
1854 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
1855 strstr(opt->map, entry) != 0 || in check_whitelist()
1866 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
1870 if (!opt->blacklist) in check_blacklist()
1872 ptr = strdup(opt->blacklist); in check_blacklist()
1877 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
1878 strstr(opt->map, entry) != 0 || in check_blacklist()
1889 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1893 err = populate_progs(opt->map); in __test_selftests()
1903 if (check_whitelist(&t, opt) != 0) in __test_selftests()
1905 if (check_blacklist(&t, opt) == 0) in __test_selftests()
1908 test_start_subtest(&t, opt); in __test_selftests()
1909 t.tester(cg_fd, opt); in __test_selftests()
1916 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1918 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
1919 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1922 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1924 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
1925 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1928 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
1930 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
1931 opt->prepend = "ktls"; in test_selftests_ktls()
1933 __test_selftests(cg_fd, opt); in test_selftests_ktls()
1937 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
1939 test_selftests_sockmap(cg_fd, opt); in test_selftest()
1940 test_selftests_sockhash(cg_fd, opt); in test_selftest()
1941 test_selftests_ktls(cg_fd, opt); in test_selftest()
1950 int opt, longindex, err, cg_fd = 0; in main() local
1955 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
1957 switch (opt) { in main()