Lines Matching defs:opt

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