Lines Matching +full:revision +full:- +full:id1
1 // SPDX-License-Identifier: GPL-2.0
8 #define ping_cmd "ping -q -c1 -w1 127.0.0.1 > /dev/null"
18 __u32 fd1, fd2, id1, id2; in serial_test_tc_opts_basic() local
27 fd1 = bpf_program__fd(skel->progs.tc1); in serial_test_tc_opts_basic()
28 fd2 = bpf_program__fd(skel->progs.tc2); in serial_test_tc_opts_basic()
30 id1 = id_from_prog_fd(fd1); in serial_test_tc_opts_basic()
33 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in serial_test_tc_opts_basic()
38 ASSERT_EQ(skel->bss->seen_tc1, false, "seen_tc1"); in serial_test_tc_opts_basic()
39 ASSERT_EQ(skel->bss->seen_tc2, false, "seen_tc2"); in serial_test_tc_opts_basic()
58 ASSERT_EQ(optq.revision, 2, "revision"); in serial_test_tc_opts_basic()
59 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in serial_test_tc_opts_basic()
65 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in serial_test_tc_opts_basic()
66 ASSERT_EQ(skel->bss->seen_tc2, false, "seen_tc2"); in serial_test_tc_opts_basic()
83 ASSERT_EQ(optq.revision, 2, "revision"); in serial_test_tc_opts_basic()
90 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in serial_test_tc_opts_basic()
91 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in serial_test_tc_opts_basic()
116 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_before_target() local
125 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_before_target()
126 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_before_target()
127 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_before_target()
128 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_before_target()
130 id1 = id_from_prog_fd(fd1); in test_tc_opts_before_target()
135 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_before_target()
163 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_before_target()
164 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_before_target()
171 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_before_target()
172 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_before_target()
173 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_before_target()
174 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_opts_before_target()
193 ASSERT_EQ(optq.revision, 4, "revision"); in test_tc_opts_before_target()
194 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_before_target()
201 .relative_id = id1, in test_tc_opts_before_target()
218 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_before_target()
220 ASSERT_EQ(optq.prog_ids[1], id1, "prog_ids[1]"); in test_tc_opts_before_target()
228 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_before_target()
229 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_before_target()
230 ASSERT_EQ(skel->bss->seen_tc3, true, "seen_tc3"); in test_tc_opts_before_target()
231 ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4"); in test_tc_opts_before_target()
268 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_after_target() local
277 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_after_target()
278 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_after_target()
279 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_after_target()
280 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_after_target()
282 id1 = id_from_prog_fd(fd1); in test_tc_opts_after_target()
287 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_after_target()
315 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_after_target()
316 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
323 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_after_target()
324 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_after_target()
325 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_after_target()
326 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_opts_after_target()
345 ASSERT_EQ(optq.revision, 4, "revision"); in test_tc_opts_after_target()
346 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
370 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_after_target()
371 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
380 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_after_target()
381 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_after_target()
382 ASSERT_EQ(skel->bss->seen_tc3, true, "seen_tc3"); in test_tc_opts_after_target()
383 ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4"); in test_tc_opts_after_target()
398 ASSERT_EQ(optq.revision, 6, "revision"); in test_tc_opts_after_target()
399 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
417 ASSERT_EQ(optq.revision, 7, "revision"); in test_tc_opts_after_target()
418 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
435 ASSERT_EQ(optq.revision, 8, "revision"); in test_tc_opts_after_target()
436 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_after_target()
459 __u32 fd1, fd2, id1, id2; in test_tc_opts_revision_target() local
468 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_revision_target()
469 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_revision_target()
471 id1 = id_from_prog_fd(fd1); in test_tc_opts_revision_target()
474 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_revision_target()
493 if (!ASSERT_EQ(err, -ESTALE, "prog_attach")) in test_tc_opts_revision_target()
518 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_revision_target()
519 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_revision_target()
526 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_revision_target()
527 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_revision_target()
534 ASSERT_EQ(err, -ESTALE, "prog_detach"); in test_tc_opts_revision_target()
570 __u32 fd1, fd2, fd3, id1, id2, id3; in test_tc_chain_classic() local
578 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_chain_classic()
579 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_chain_classic()
580 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_chain_classic()
582 id1 = id_from_prog_fd(fd1); in test_tc_chain_classic()
586 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_chain_classic()
597 err = err == -EEXIST ? 0 : err; in test_tc_chain_classic()
621 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_chain_classic()
622 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_chain_classic()
623 ASSERT_EQ(skel->bss->seen_tc3, chain_tc_old, "seen_tc3"); in test_tc_chain_classic()
634 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_chain_classic()
635 ASSERT_EQ(skel->bss->seen_tc2, false, "seen_tc2"); in test_tc_chain_classic()
636 ASSERT_EQ(skel->bss->seen_tc3, chain_tc_old, "seen_tc3"); in test_tc_chain_classic()
671 __u32 fd1, fd2, fd3, id1, id2, id3, detach_fd; in test_tc_opts_replace_target() local
680 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_replace_target()
681 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_replace_target()
682 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_replace_target()
684 id1 = id_from_prog_fd(fd1); in test_tc_opts_replace_target()
688 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_replace_target()
705 .relative_id = id1, in test_tc_opts_replace_target()
729 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_replace_target()
731 ASSERT_EQ(optq.prog_ids[1], id1, "prog_ids[1]"); in test_tc_opts_replace_target()
741 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_replace_target()
742 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_replace_target()
743 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_replace_target()
767 ASSERT_EQ(optq.revision, 4, "revision"); in test_tc_opts_replace_target()
769 ASSERT_EQ(optq.prog_ids[1], id1, "prog_ids[1]"); in test_tc_opts_replace_target()
775 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_replace_target()
776 ASSERT_EQ(skel->bss->seen_tc2, false, "seen_tc2"); in test_tc_opts_replace_target()
777 ASSERT_EQ(skel->bss->seen_tc3, true, "seen_tc3"); in test_tc_opts_replace_target()
802 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_replace_target()
804 ASSERT_EQ(optq.prog_ids[1], id1, "prog_ids[1]"); in test_tc_opts_replace_target()
810 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_replace_target()
811 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_replace_target()
812 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_replace_target()
820 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_replace_target()
831 ASSERT_EQ(err, -ERANGE, "prog_attach"); in test_tc_opts_replace_target()
842 ASSERT_EQ(err, -ERANGE, "prog_attach"); in test_tc_opts_replace_target()
847 .relative_id = id1, in test_tc_opts_replace_target()
877 __u32 fd1, fd2, id1, id2; in test_tc_opts_invalid_target() local
885 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_invalid_target()
886 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_invalid_target()
888 id1 = id_from_prog_fd(fd1); in test_tc_opts_invalid_target()
891 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_invalid_target()
900 ASSERT_EQ(err, -ERANGE, "prog_attach"); in test_tc_opts_invalid_target()
908 ASSERT_EQ(err, -ENOENT, "prog_attach"); in test_tc_opts_invalid_target()
916 ASSERT_EQ(err, -ENOENT, "prog_attach"); in test_tc_opts_invalid_target()
924 ASSERT_EQ(err, -EINVAL, "prog_attach"); in test_tc_opts_invalid_target()
933 ASSERT_EQ(err, -ENOENT, "prog_attach"); in test_tc_opts_invalid_target()
942 ASSERT_EQ(err, -EINVAL, "prog_attach"); in test_tc_opts_invalid_target()
951 ASSERT_EQ(err, -ENOENT, "prog_attach"); in test_tc_opts_invalid_target()
960 ASSERT_EQ(err, -ENOENT, "prog_attach"); in test_tc_opts_invalid_target()
974 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_invalid_target()
983 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_invalid_target()
992 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_invalid_target()
1001 ASSERT_EQ(err, -EINVAL, "prog_attach_x1"); in test_tc_opts_invalid_target()
1010 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_invalid_target()
1031 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_prepend_target() local
1040 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_prepend_target()
1041 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_prepend_target()
1042 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_prepend_target()
1043 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_prepend_target()
1045 id1 = id_from_prog_fd(fd1); in test_tc_opts_prepend_target()
1050 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_prepend_target()
1082 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_prepend_target()
1084 ASSERT_EQ(optq.prog_ids[1], id1, "prog_ids[1]"); in test_tc_opts_prepend_target()
1090 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_prepend_target()
1091 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_prepend_target()
1092 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_prepend_target()
1093 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_opts_prepend_target()
1121 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_prepend_target()
1125 ASSERT_EQ(optq.prog_ids[3], id1, "prog_ids[3]"); in test_tc_opts_prepend_target()
1131 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_prepend_target()
1132 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_prepend_target()
1133 ASSERT_EQ(skel->bss->seen_tc3, true, "seen_tc3"); in test_tc_opts_prepend_target()
1134 ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4"); in test_tc_opts_prepend_target()
1171 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_append_target() local
1180 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_append_target()
1181 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_append_target()
1182 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_append_target()
1183 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_append_target()
1185 id1 = id_from_prog_fd(fd1); in test_tc_opts_append_target()
1190 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_append_target()
1222 ASSERT_EQ(optq.revision, 3, "revision"); in test_tc_opts_append_target()
1223 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_append_target()
1230 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_append_target()
1231 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_append_target()
1232 ASSERT_EQ(skel->bss->seen_tc3, false, "seen_tc3"); in test_tc_opts_append_target()
1233 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_opts_append_target()
1261 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_append_target()
1262 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_append_target()
1271 ASSERT_EQ(skel->bss->seen_tc1, true, "seen_tc1"); in test_tc_opts_append_target()
1272 ASSERT_EQ(skel->bss->seen_tc2, true, "seen_tc2"); in test_tc_opts_append_target()
1273 ASSERT_EQ(skel->bss->seen_tc3, true, "seen_tc3"); in test_tc_opts_append_target()
1274 ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4"); in test_tc_opts_append_target()
1311 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_dev_cleanup_target() local
1323 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_dev_cleanup_target()
1324 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_dev_cleanup_target()
1325 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_dev_cleanup_target()
1326 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_dev_cleanup_target()
1328 id1 = id_from_prog_fd(fd1); in test_tc_opts_dev_cleanup_target()
1333 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_dev_cleanup_target()
1413 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc1, target), in test_tc_opts_mixed_target()
1415 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc2, target), in test_tc_opts_mixed_target()
1417 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc3, target), in test_tc_opts_mixed_target()
1419 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc4, target), in test_tc_opts_mixed_target()
1426 pid1 = id_from_prog_fd(bpf_program__fd(skel->progs.tc1)); in test_tc_opts_mixed_target()
1427 pid2 = id_from_prog_fd(bpf_program__fd(skel->progs.tc2)); in test_tc_opts_mixed_target()
1428 pid3 = id_from_prog_fd(bpf_program__fd(skel->progs.tc3)); in test_tc_opts_mixed_target()
1429 pid4 = id_from_prog_fd(bpf_program__fd(skel->progs.tc4)); in test_tc_opts_mixed_target()
1437 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc1), in test_tc_opts_mixed_target()
1442 detach_fd = bpf_program__fd(skel->progs.tc1); in test_tc_opts_mixed_target()
1446 link = bpf_program__attach_tcx(skel->progs.tc2, loopback, &optl); in test_tc_opts_mixed_target()
1449 skel->links.tc2 = link; in test_tc_opts_mixed_target()
1451 lid2 = id_from_link_fd(bpf_link__fd(skel->links.tc2)); in test_tc_opts_mixed_target()
1457 .replace_prog_fd = bpf_program__fd(skel->progs.tc1), in test_tc_opts_mixed_target()
1460 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc2), in test_tc_opts_mixed_target()
1462 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_mixed_target()
1468 .replace_prog_fd = bpf_program__fd(skel->progs.tc2), in test_tc_opts_mixed_target()
1471 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc1), in test_tc_opts_mixed_target()
1473 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_mixed_target()
1479 .replace_prog_fd = bpf_program__fd(skel->progs.tc2), in test_tc_opts_mixed_target()
1482 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc3), in test_tc_opts_mixed_target()
1484 ASSERT_EQ(err, -EBUSY, "prog_attach"); in test_tc_opts_mixed_target()
1490 .replace_prog_fd = bpf_program__fd(skel->progs.tc1), in test_tc_opts_mixed_target()
1493 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc3), in test_tc_opts_mixed_target()
1498 detach_fd = bpf_program__fd(skel->progs.tc3); in test_tc_opts_mixed_target()
1502 link = bpf_program__attach_tcx(skel->progs.tc4, loopback, &optl); in test_tc_opts_mixed_target()
1505 skel->links.tc4 = link; in test_tc_opts_mixed_target()
1507 lid4 = id_from_link_fd(bpf_link__fd(skel->links.tc4)); in test_tc_opts_mixed_target()
1513 .replace_prog_fd = bpf_program__fd(skel->progs.tc4), in test_tc_opts_mixed_target()
1516 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc2), in test_tc_opts_mixed_target()
1518 ASSERT_EQ(err, -EEXIST, "prog_attach"); in test_tc_opts_mixed_target()
1536 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_mixed_target()
1586 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc1, target), in test_tc_opts_demixed_target()
1588 ASSERT_EQ(bpf_program__set_expected_attach_type(skel->progs.tc2, target), in test_tc_opts_demixed_target()
1595 pid1 = id_from_prog_fd(bpf_program__fd(skel->progs.tc1)); in test_tc_opts_demixed_target()
1596 pid2 = id_from_prog_fd(bpf_program__fd(skel->progs.tc2)); in test_tc_opts_demixed_target()
1601 err = bpf_prog_attach_opts(bpf_program__fd(skel->progs.tc1), in test_tc_opts_demixed_target()
1608 link = bpf_program__attach_tcx(skel->progs.tc2, loopback, &optl); in test_tc_opts_demixed_target()
1611 skel->links.tc2 = link; in test_tc_opts_demixed_target()
1620 ASSERT_EQ(err, -EBUSY, "prog_detach"); in test_tc_opts_demixed_target()
1635 err = bpf_prog_detach_opts(bpf_program__fd(skel->progs.tc1), in test_tc_opts_demixed_target()
1656 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_detach_target() local
1665 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_detach_target()
1666 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_detach_target()
1667 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_detach_target()
1668 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_detach_target()
1670 id1 = id_from_prog_fd(fd1); in test_tc_opts_detach_target()
1675 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_detach_target()
1715 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_detach_target()
1716 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_target()
1739 ASSERT_EQ(optq.revision, 6, "revision"); in test_tc_opts_detach_target()
1762 ASSERT_EQ(optq.revision, 7, "revision"); in test_tc_opts_detach_target()
1782 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_detach_target()
1789 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_detach_target()
1827 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_detach_before_target() local
1836 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_detach_before_target()
1837 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_detach_before_target()
1838 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_detach_before_target()
1839 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_detach_before_target()
1841 id1 = id_from_prog_fd(fd1); in test_tc_opts_detach_before_target()
1846 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_detach_before_target()
1886 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_detach_before_target()
1887 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_before_target()
1911 ASSERT_EQ(optq.revision, 6, "revision"); in test_tc_opts_detach_before_target()
1923 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_detach_before_target()
1932 ASSERT_EQ(err, -ERANGE, "prog_detach"); in test_tc_opts_detach_before_target()
1941 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_detach_before_target()
1962 ASSERT_EQ(optq.revision, 7, "revision"); in test_tc_opts_detach_before_target()
1985 ASSERT_EQ(optq.revision, 8, "revision"); in test_tc_opts_detach_before_target()
2034 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_detach_after_target() local
2043 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_detach_after_target()
2044 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_detach_after_target()
2045 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_detach_after_target()
2046 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_detach_after_target()
2048 id1 = id_from_prog_fd(fd1); in test_tc_opts_detach_after_target()
2053 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_opts_detach_after_target()
2093 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_detach_after_target()
2094 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_after_target()
2118 ASSERT_EQ(optq.revision, 6, "revision"); in test_tc_opts_detach_after_target()
2119 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_after_target()
2130 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_detach_after_target()
2139 ASSERT_EQ(err, -ERANGE, "prog_detach"); in test_tc_opts_detach_after_target()
2148 ASSERT_EQ(err, -ERANGE, "prog_detach"); in test_tc_opts_detach_after_target()
2157 ASSERT_EQ(err, -ERANGE, "prog_detach"); in test_tc_opts_detach_after_target()
2178 ASSERT_EQ(optq.revision, 7, "revision"); in test_tc_opts_detach_after_target()
2179 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_after_target()
2201 ASSERT_EQ(optq.revision, 8, "revision"); in test_tc_opts_detach_after_target()
2202 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_detach_after_target()
2260 ASSERT_EQ(err, -ENOENT, "prog_detach"); in test_tc_opts_delete_empty()
2282 __u32 fd1, fd2, fd3, id1, id2, id3; in test_tc_chain_mixed() local
2290 fd1 = bpf_program__fd(skel->progs.tc4); in test_tc_chain_mixed()
2291 fd2 = bpf_program__fd(skel->progs.tc5); in test_tc_chain_mixed()
2292 fd3 = bpf_program__fd(skel->progs.tc6); in test_tc_chain_mixed()
2294 id1 = id_from_prog_fd(fd1); in test_tc_chain_mixed()
2298 ASSERT_NEQ(id1, id2, "prog_ids_1_2"); in test_tc_chain_mixed()
2306 err = err == -EEXIST ? 0 : err; in test_tc_chain_mixed()
2326 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_chain_mixed()
2327 ASSERT_EQ(skel->bss->seen_tc5, false, "seen_tc5"); in test_tc_chain_mixed()
2328 ASSERT_EQ(skel->bss->seen_tc6, true, "seen_tc6"); in test_tc_chain_mixed()
2346 ASSERT_EQ(skel->bss->seen_tc4, true, "seen_tc4"); in test_tc_chain_mixed()
2347 ASSERT_EQ(skel->bss->seen_tc5, true, "seen_tc5"); in test_tc_chain_mixed()
2348 ASSERT_EQ(skel->bss->seen_tc6, false, "seen_tc6"); in test_tc_chain_mixed()
2358 ASSERT_EQ(skel->bss->seen_tc4, false, "seen_tc4"); in test_tc_chain_mixed()
2359 ASSERT_EQ(skel->bss->seen_tc5, true, "seen_tc5"); in test_tc_chain_mixed()
2360 ASSERT_EQ(skel->bss->seen_tc6, false, "seen_tc6"); in test_tc_chain_mixed()
2391 int fd = -1; in generate_dummy_prog()
2407 int err, ifindex, i, prog_fd, last_fd = -1; in test_tc_opts_max_target()
2425 if (i == max_progs - 1 && relative) in test_tc_opts_max_target()
2438 ASSERT_EQ(err, -ERANGE, "prog_64_attach"); in test_tc_opts_max_target()
2467 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_query_target() local
2477 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_query_target()
2478 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_query_target()
2479 fd3 = bpf_program__fd(skel->progs.tc3); in test_tc_opts_query_target()
2480 fd4 = bpf_program__fd(skel->progs.tc4); in test_tc_opts_query_target()
2482 id1 = id_from_prog_fd(fd1); in test_tc_opts_query_target()
2535 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_query_target()
2547 ASSERT_EQ(optq.revision, 5, "revision"); in test_tc_opts_query_target()
2548 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_query_target()
2565 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2583 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2589 ASSERT_EQ(prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_query_target()
2608 ASSERT_EQ(err, -1, "prog_query_should_fail"); in test_tc_opts_query_target()
2612 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2618 ASSERT_EQ(prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_query_target()
2641 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2647 ASSERT_EQ(prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_query_target()
2669 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2684 /* Test 6: Query with non-NULL prog_ids array but with count == 0 */ in test_tc_opts_query_target()
2697 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2717 ASSERT_EQ(err, -1, "prog_query_should_fail"); in test_tc_opts_query_target()
2724 ASSERT_EQ(err, -1, "prog_query_should_fail"); in test_tc_opts_query_target()
2764 __u32 fd1, id1; in test_tc_opts_query_attach_target() local
2771 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_query_attach_target()
2772 id1 = id_from_prog_fd(fd1); in test_tc_opts_query_attach_target()
2779 ASSERT_EQ(optq.revision, 1, "revision"); in test_tc_opts_query_attach_target()
2782 .expected_revision = optq.revision, in test_tc_opts_query_attach_target()
2798 ASSERT_EQ(optq.revision, 2, "revision"); in test_tc_opts_query_attach_target()
2799 ASSERT_EQ(optq.prog_ids[0], id1, "prog_ids[0]"); in test_tc_opts_query_attach_target()