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()
637 if (opt->verbose) in msg_loop()
669 int chunk_sz = opt->sendpage ? in msg_loop()
713 static int sendmsg_test(struct sockmap_options *opt) in sendmsg_test() argument
718 int iov_count = opt->iov_count; in sendmsg_test()
719 int iov_buf = opt->iov_length; in sendmsg_test()
721 int cnt = opt->rate; in sendmsg_test()
725 if (opt->base) in sendmsg_test()
736 err = sockmap_init_ktls(opt->verbose, rx_fd); in sendmsg_test()
740 err = sockmap_init_ktls(opt->verbose, c1); in sendmsg_test()
748 if (opt->drop_expected || txmsg_ktls_skb_drop) in sendmsg_test()
754 if (opt->sendpage) in sendmsg_test()
757 cnt, &s, false, opt); in sendmsg_test()
758 if (opt->verbose > 1) in sendmsg_test()
766 if (opt->verbose > 1) in sendmsg_test()
782 if (opt->sendpage) in sendmsg_test()
783 err = msg_loop_sendpage(c1, iov_buf, cnt, &s, opt); in sendmsg_test()
786 cnt, &s, true, opt); in sendmsg_test()
796 if (opt->verbose > 1) in sendmsg_test()
825 static int forever_ping_pong(int rate, struct sockmap_options *opt) in forever_ping_pong() argument
890 if (opt->verbose) { in forever_ping_pong()
1332 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1338 opt->sendpage = true; in __test_exec()
1340 opt->sendpage = false; in __test_exec()
1343 opt->drop_expected = true; in __test_exec()
1345 opt->drop_expected = false; in __test_exec()
1349 if (opt->verbose) { in __test_exec()
1352 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1356 err = run_options(opt, cgrp, test); in __test_exec()
1357 if (opt->verbose) in __test_exec()
1365 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1367 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1372 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1377 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1383 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1385 opt->iov_length = 1; in test_send_one()
1386 opt->iov_count = 1; in test_send_one()
1387 opt->rate = 1; in test_send_one()
1388 test_exec(cgrp, opt); in test_send_one()
1390 opt->iov_length = 1; in test_send_one()
1391 opt->iov_count = 1024; in test_send_one()
1392 opt->rate = 1; in test_send_one()
1393 test_exec(cgrp, opt); in test_send_one()
1395 opt->iov_length = 1024; in test_send_one()
1396 opt->iov_count = 1; in test_send_one()
1397 opt->rate = 1; in test_send_one()
1398 test_exec(cgrp, opt); in test_send_one()
1402 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1404 opt->iov_length = 3; in test_send_many()
1405 opt->iov_count = 1; in test_send_many()
1406 opt->rate = 512; in test_send_many()
1407 test_exec(cgrp, opt); in test_send_many()
1409 opt->rate = 100; in test_send_many()
1410 opt->iov_count = 1; in test_send_many()
1411 opt->iov_length = 5; in test_send_many()
1412 test_exec(cgrp, opt); in test_send_many()
1415 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1417 opt->iov_length = 256; in test_send_large()
1418 opt->iov_count = 1024; in test_send_large()
1419 opt->rate = 2; in test_send_large()
1420 test_exec(cgrp, opt); in test_send_large()
1423 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1425 test_send_one(opt, cgrp); in test_send()
1426 test_send_many(opt, cgrp); in test_send()
1427 test_send_large(opt, cgrp); in test_send()
1431 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1435 test_send(opt, cgrp); in test_txmsg_pass()
1438 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1441 test_send(opt, cgrp); in test_txmsg_redir()
1444 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1447 test_send(opt, cgrp); in test_txmsg_drop()
1450 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1454 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1457 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1459 bool data = opt->data_test; in test_txmsg_skb()
1462 opt->data_test = true; in test_txmsg_skb()
1474 opt->iov_length = 100; in test_txmsg_skb()
1475 opt->iov_count = 1; in test_txmsg_skb()
1476 opt->rate = 1; in test_txmsg_skb()
1477 test_exec(cgrp, opt); in test_txmsg_skb()
1480 test_exec(cgrp, opt); in test_txmsg_skb()
1484 test_exec(cgrp, opt); in test_txmsg_skb()
1491 test_exec(cgrp, opt); in test_txmsg_skb()
1494 test_exec(cgrp, opt); in test_txmsg_skb()
1498 test_exec(cgrp, opt); in test_txmsg_skb()
1501 test_exec(cgrp, opt); in test_txmsg_skb()
1504 opt->data_test = data; in test_txmsg_skb()
1515 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1521 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1527 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1533 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1536 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1541 test_send(opt, cgrp); in test_txmsg_pull()
1546 test_send_large(opt, cgrp); in test_txmsg_pull()
1552 test_send(opt, cgrp); in test_txmsg_pull()
1559 test_send_many(opt, cgrp); in test_txmsg_pull()
1566 test_send_many(opt, cgrp); in test_txmsg_pull()
1569 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1574 test_send_many(opt, cgrp); in test_txmsg_pop()
1579 test_send_large(opt, cgrp); in test_txmsg_pop()
1585 test_send_many(opt, cgrp); in test_txmsg_pop()
1592 test_send_many(opt, cgrp); in test_txmsg_pop()
1599 test_send_many(opt, cgrp); in test_txmsg_pop()
1602 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1607 test_send(opt, cgrp); in test_txmsg_push()
1612 test_send_large(opt, cgrp); in test_txmsg_push()
1618 test_send_many(opt, cgrp); in test_txmsg_push()
1625 test_send_many(opt, cgrp); in test_txmsg_push()
1628 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1634 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1637 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1643 test_send_one(opt, cgrp); in test_txmsg_apply()
1649 test_send_one(opt, cgrp); in test_txmsg_apply()
1655 test_send_large(opt, cgrp); in test_txmsg_apply()
1661 test_send_large(opt, cgrp); in test_txmsg_apply()
1664 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1670 test_send(opt, cgrp); in test_txmsg_cork()
1676 test_send(opt, cgrp); in test_txmsg_cork()
1679 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1683 opt->iov_length = 256; in test_txmsg_ingress_parser()
1684 opt->iov_count = 1; in test_txmsg_ingress_parser()
1685 opt->rate = 2; in test_txmsg_ingress_parser()
1686 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1790 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1794 if (!opt->whitelist) in check_whitelist()
1796 ptr = strdup(opt->whitelist); in check_whitelist()
1801 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
1802 strstr(opt->map, entry) != 0 || in check_whitelist()
1810 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
1814 if (!opt->blacklist) in check_blacklist()
1816 ptr = strdup(opt->blacklist); in check_blacklist()
1821 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
1822 strstr(opt->map, entry) != 0 || in check_blacklist()
1830 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1834 err = populate_progs(opt->map); in __test_selftests()
1844 if (check_whitelist(&t, opt) != 0) in __test_selftests()
1846 if (check_blacklist(&t, opt) == 0) in __test_selftests()
1849 test_start_subtest(&t, opt); in __test_selftests()
1850 t.tester(cg_fd, opt); in __test_selftests()
1857 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1859 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
1860 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1863 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1865 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
1866 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1869 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
1871 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
1872 opt->prepend = "ktls"; in test_selftests_ktls()
1874 __test_selftests(cg_fd, opt); in test_selftests_ktls()
1878 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
1881 test_selftests_sockmap(cg_fd, opt); in test_selftest()
1882 test_selftests_sockhash(cg_fd, opt); in test_selftest()
1883 test_selftests_ktls(cg_fd, opt); in test_selftest()
1892 int opt, longindex, err, cg_fd = 0; in main() local
1897 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
1899 switch (opt) { in main()