Lines Matching full:query

2463 	const size_t attr_size = offsetofend(union bpf_attr, query);  in test_tc_opts_query_target()
2529 /* Test 1: Double query via libbpf API */ in test_tc_opts_query_target()
2555 /* Test 2: Double query via bpf_attr & bpf(2) directly */ in test_tc_opts_query_target()
2557 attr.query.target_ifindex = loopback; in test_tc_opts_query_target()
2558 attr.query.attach_type = target; in test_tc_opts_query_target()
2564 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2565 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2566 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2567 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2568 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2569 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2570 ASSERT_EQ(attr.query.prog_ids, 0, "prog_ids"); in test_tc_opts_query_target()
2571 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2572 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2573 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); in test_tc_opts_query_target()
2576 attr.query.prog_ids = ptr_to_u64(prog_ids); in test_tc_opts_query_target()
2582 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2583 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2584 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2585 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2586 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2587 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2588 ASSERT_EQ(attr.query.prog_ids, ptr_to_u64(prog_ids), "prog_ids"); in test_tc_opts_query_target()
2594 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2595 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2596 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); in test_tc_opts_query_target()
2598 /* Test 3: Query with smaller prog_ids array */ in test_tc_opts_query_target()
2600 attr.query.target_ifindex = loopback; in test_tc_opts_query_target()
2601 attr.query.attach_type = target; in test_tc_opts_query_target()
2604 attr.query.prog_ids = ptr_to_u64(prog_ids); in test_tc_opts_query_target()
2605 attr.query.count = 2; in test_tc_opts_query_target()
2611 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2612 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2613 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2614 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2615 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2616 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2617 ASSERT_EQ(attr.query.prog_ids, ptr_to_u64(prog_ids), "prog_ids"); in test_tc_opts_query_target()
2623 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2624 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2625 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); in test_tc_opts_query_target()
2627 /* Test 4: Query with larger prog_ids array */ in test_tc_opts_query_target()
2629 attr.query.target_ifindex = loopback; in test_tc_opts_query_target()
2630 attr.query.attach_type = target; in test_tc_opts_query_target()
2633 attr.query.prog_ids = ptr_to_u64(prog_ids); in test_tc_opts_query_target()
2634 attr.query.count = 10; in test_tc_opts_query_target()
2640 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2641 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2642 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2643 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2644 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2645 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2646 ASSERT_EQ(attr.query.prog_ids, ptr_to_u64(prog_ids), "prog_ids"); in test_tc_opts_query_target()
2652 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2653 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2654 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); in test_tc_opts_query_target()
2656 /* Test 5: Query with NULL prog_ids array but with count > 0 */ in test_tc_opts_query_target()
2658 attr.query.target_ifindex = loopback; in test_tc_opts_query_target()
2659 attr.query.attach_type = target; in test_tc_opts_query_target()
2662 attr.query.count = sizeof(prog_ids); in test_tc_opts_query_target()
2668 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2669 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2670 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2671 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2672 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2673 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2679 ASSERT_EQ(attr.query.prog_ids, 0, "prog_ids"); in test_tc_opts_query_target()
2680 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2681 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2682 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); 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()
2686 attr.query.target_ifindex = loopback; in test_tc_opts_query_target()
2687 attr.query.attach_type = target; in test_tc_opts_query_target()
2690 attr.query.prog_ids = ptr_to_u64(prog_ids); in test_tc_opts_query_target()
2696 ASSERT_EQ(attr.query.count, 4, "count"); in test_tc_opts_query_target()
2697 ASSERT_EQ(attr.query.revision, 5, "revision"); in test_tc_opts_query_target()
2698 ASSERT_EQ(attr.query.query_flags, 0, "query_flags"); in test_tc_opts_query_target()
2699 ASSERT_EQ(attr.query.attach_flags, 0, "attach_flags"); in test_tc_opts_query_target()
2700 ASSERT_EQ(attr.query.target_ifindex, loopback, "target_ifindex"); in test_tc_opts_query_target()
2701 ASSERT_EQ(attr.query.attach_type, target, "attach_type"); in test_tc_opts_query_target()
2707 ASSERT_EQ(attr.query.prog_ids, ptr_to_u64(prog_ids), "prog_ids"); in test_tc_opts_query_target()
2708 ASSERT_EQ(attr.query.prog_attach_flags, 0, "prog_attach_flags"); in test_tc_opts_query_target()
2709 ASSERT_EQ(attr.query.link_ids, 0, "link_ids"); in test_tc_opts_query_target()
2710 ASSERT_EQ(attr.query.link_attach_flags, 0, "link_attach_flags"); in test_tc_opts_query_target()
2712 /* Test 7: Query with invalid flags */ in test_tc_opts_query_target()
2713 attr.query.attach_flags = 0; in test_tc_opts_query_target()
2714 attr.query.query_flags = 1; in test_tc_opts_query_target()
2720 attr.query.attach_flags = 1; in test_tc_opts_query_target()
2721 attr.query.query_flags = 0; in test_tc_opts_query_target()