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()
1322 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1328 opt->sendpage = true; in __test_exec()
1330 opt->sendpage = false; in __test_exec()
1333 opt->drop_expected = true; in __test_exec()
1335 opt->drop_expected = false; in __test_exec()
1339 if (opt->verbose) { in __test_exec()
1342 test_cnt, opt->rate, opt->iov_count, opt->iov_length, in __test_exec()
1346 err = run_options(opt, cgrp, test); in __test_exec()
1347 if (opt->verbose) in __test_exec()
1355 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1357 int type = strcmp(opt->map, BPF_SOCKMAP_FILENAME); in test_exec()
1362 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1367 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1373 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1375 opt->iov_length = 1; in test_send_one()
1376 opt->iov_count = 1; in test_send_one()
1377 opt->rate = 1; in test_send_one()
1378 test_exec(cgrp, opt); in test_send_one()
1380 opt->iov_length = 1; in test_send_one()
1381 opt->iov_count = 1024; in test_send_one()
1382 opt->rate = 1; in test_send_one()
1383 test_exec(cgrp, opt); in test_send_one()
1385 opt->iov_length = 1024; 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()
1392 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
1394 opt->iov_length = 3; in test_send_many()
1395 opt->iov_count = 1; in test_send_many()
1396 opt->rate = 512; in test_send_many()
1397 test_exec(cgrp, opt); in test_send_many()
1399 opt->rate = 100; in test_send_many()
1400 opt->iov_count = 1; in test_send_many()
1401 opt->iov_length = 5; in test_send_many()
1402 test_exec(cgrp, opt); in test_send_many()
1405 static void test_send_large(struct sockmap_options *opt, int cgrp) in test_send_large() argument
1407 opt->iov_length = 256; in test_send_large()
1408 opt->iov_count = 1024; in test_send_large()
1409 opt->rate = 2; in test_send_large()
1410 test_exec(cgrp, opt); in test_send_large()
1413 static void test_send(struct sockmap_options *opt, int cgrp) in test_send() argument
1415 test_send_one(opt, cgrp); in test_send()
1416 test_send_many(opt, cgrp); in test_send()
1417 test_send_large(opt, cgrp); in test_send()
1421 static void test_txmsg_pass(int cgrp, struct sockmap_options *opt) in test_txmsg_pass() argument
1425 test_send(opt, cgrp); in test_txmsg_pass()
1428 static void test_txmsg_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_redir() argument
1431 test_send(opt, cgrp); in test_txmsg_redir()
1434 static void test_txmsg_drop(int cgrp, struct sockmap_options *opt) in test_txmsg_drop() argument
1437 test_send(opt, cgrp); in test_txmsg_drop()
1440 static void test_txmsg_ingress_redir(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_redir() argument
1444 test_send(opt, cgrp); in test_txmsg_ingress_redir()
1447 static void test_txmsg_skb(int cgrp, struct sockmap_options *opt) in test_txmsg_skb() argument
1449 bool data = opt->data_test; in test_txmsg_skb()
1452 opt->data_test = true; in test_txmsg_skb()
1464 opt->iov_length = 100; in test_txmsg_skb()
1465 opt->iov_count = 1; in test_txmsg_skb()
1466 opt->rate = 1; in test_txmsg_skb()
1467 test_exec(cgrp, opt); in test_txmsg_skb()
1470 test_exec(cgrp, opt); in test_txmsg_skb()
1474 test_exec(cgrp, opt); in test_txmsg_skb()
1481 test_exec(cgrp, opt); in test_txmsg_skb()
1484 test_exec(cgrp, opt); in test_txmsg_skb()
1488 test_exec(cgrp, opt); in test_txmsg_skb()
1491 test_exec(cgrp, opt); in test_txmsg_skb()
1494 opt->data_test = data; in test_txmsg_skb()
1505 static void test_txmsg_cork_hangs(int cgrp, struct sockmap_options *opt) in test_txmsg_cork_hangs() argument
1511 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1517 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1523 test_send_large(opt, cgrp); in test_txmsg_cork_hangs()
1526 static void test_txmsg_pull(int cgrp, struct sockmap_options *opt) in test_txmsg_pull() argument
1531 test_send(opt, cgrp); in test_txmsg_pull()
1536 test_send_large(opt, cgrp); in test_txmsg_pull()
1542 test_send(opt, cgrp); in test_txmsg_pull()
1549 test_send_many(opt, cgrp); in test_txmsg_pull()
1556 test_send_many(opt, cgrp); in test_txmsg_pull()
1559 static void test_txmsg_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_pop() argument
1564 test_send_many(opt, cgrp); in test_txmsg_pop()
1569 test_send_large(opt, cgrp); in test_txmsg_pop()
1575 test_send_many(opt, cgrp); in test_txmsg_pop()
1582 test_send_many(opt, cgrp); in test_txmsg_pop()
1589 test_send_many(opt, cgrp); in test_txmsg_pop()
1592 static void test_txmsg_push(int cgrp, struct sockmap_options *opt) in test_txmsg_push() argument
1597 test_send(opt, cgrp); in test_txmsg_push()
1602 test_send_large(opt, cgrp); in test_txmsg_push()
1608 test_send_many(opt, cgrp); in test_txmsg_push()
1615 test_send_many(opt, cgrp); in test_txmsg_push()
1618 static void test_txmsg_push_pop(int cgrp, struct sockmap_options *opt) in test_txmsg_push_pop() argument
1624 test_send_large(opt, cgrp); in test_txmsg_push_pop()
1627 static void test_txmsg_apply(int cgrp, struct sockmap_options *opt) in test_txmsg_apply() argument
1633 test_send_one(opt, cgrp); in test_txmsg_apply()
1639 test_send_one(opt, cgrp); in test_txmsg_apply()
1645 test_send_large(opt, cgrp); in test_txmsg_apply()
1651 test_send_large(opt, cgrp); in test_txmsg_apply()
1654 static void test_txmsg_cork(int cgrp, struct sockmap_options *opt) in test_txmsg_cork() argument
1660 test_send(opt, cgrp); in test_txmsg_cork()
1666 test_send(opt, cgrp); in test_txmsg_cork()
1669 static void test_txmsg_ingress_parser(int cgrp, struct sockmap_options *opt) in test_txmsg_ingress_parser() argument
1673 opt->iov_length = 256; in test_txmsg_ingress_parser()
1674 opt->iov_count = 1; in test_txmsg_ingress_parser()
1675 opt->rate = 2; in test_txmsg_ingress_parser()
1676 test_exec(cgrp, opt); in test_txmsg_ingress_parser()
1780 static int check_whitelist(struct _test *t, struct sockmap_options *opt) in check_whitelist() argument
1784 if (!opt->whitelist) in check_whitelist()
1786 ptr = strdup(opt->whitelist); in check_whitelist()
1791 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_whitelist()
1792 strstr(opt->map, entry) != 0 || in check_whitelist()
1800 static int check_blacklist(struct _test *t, struct sockmap_options *opt) in check_blacklist() argument
1804 if (!opt->blacklist) in check_blacklist()
1806 ptr = strdup(opt->blacklist); in check_blacklist()
1811 if ((opt->prepend && strstr(opt->prepend, entry) != 0) || in check_blacklist()
1812 strstr(opt->map, entry) != 0 || in check_blacklist()
1820 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1824 err = populate_progs(opt->map); in __test_selftests()
1834 if (check_whitelist(&t, opt) != 0) in __test_selftests()
1836 if (check_blacklist(&t, opt) == 0) in __test_selftests()
1839 test_start_subtest(&t, opt); in __test_selftests()
1840 t.tester(cg_fd, opt); in __test_selftests()
1847 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1849 opt->map = BPF_SOCKMAP_FILENAME; in test_selftests_sockmap()
1850 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1853 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1855 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_sockhash()
1856 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1859 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt) in test_selftests_ktls() argument
1861 opt->map = BPF_SOCKHASH_FILENAME; in test_selftests_ktls()
1862 opt->prepend = "ktls"; in test_selftests_ktls()
1864 __test_selftests(cg_fd, opt); in test_selftests_ktls()
1868 static int test_selftest(int cg_fd, struct sockmap_options *opt) in test_selftest() argument
1871 test_selftests_sockmap(cg_fd, opt); in test_selftest()
1872 test_selftests_sockhash(cg_fd, opt); in test_selftest()
1873 test_selftests_ktls(cg_fd, opt); in test_selftest()
1882 int opt, longindex, err, cg_fd = 0; in main() local
1887 while ((opt = getopt_long(argc, argv, ":dhv:c:r:i:l:t:p:q:n:b:", in main()
1889 switch (opt) { in main()