Lines Matching +full:tp +full:- +full:link
1 // SPDX-License-Identifier: GPL-2.0
34 #define PARENT_CGROUP "/test-bpf-sock-fields"
35 #define CHILD_CGROUP "/test-bpf-sock-fields/child"
53 if (!ASSERT_OK(system("ip link set dev lo up"), "bring up lo")) in create_netns()
64 inet_ntop(AF_INET, &sk->src_ip4, src_ip4, sizeof(src_ip4)); in print_sk()
65 inet_ntop(AF_INET6, &sk->src_ip6, src_ip6, sizeof(src_ip6)); in print_sk()
66 inet_ntop(AF_INET, &sk->dst_ip4, dst_ip4, sizeof(dst_ip4)); in print_sk()
67 inet_ntop(AF_INET6, &sk->dst_ip6, dst_ip6, sizeof(dst_ip6)); in print_sk()
73 sk->state, sk->bound_dev_if, sk->family, sk->type, sk->protocol, in print_sk()
74 sk->mark, sk->priority, in print_sk()
75 sk->src_ip4, src_ip4, in print_sk()
76 sk->src_ip6[0], sk->src_ip6[1], sk->src_ip6[2], sk->src_ip6[3], in print_sk()
77 src_ip6, sk->src_port, in print_sk()
78 sk->dst_ip4, dst_ip4, in print_sk()
79 sk->dst_ip6[0], sk->dst_ip6[1], sk->dst_ip6[2], sk->dst_ip6[3], in print_sk()
80 dst_ip6, ntohs(sk->dst_port)); in print_sk()
83 static void print_tp(const struct bpf_tcp_sock *tp, const char *prefix) in print_tp() argument
92 tp->snd_cwnd, tp->srtt_us, tp->rtt_min, tp->snd_ssthresh, in print_tp()
93 tp->rcv_nxt, tp->snd_nxt, tp->snd_una, tp->mss_cache, in print_tp()
94 tp->ecn_flags, tp->rate_delivered, tp->rate_interval_us, in print_tp()
95 tp->packets_out, tp->retrans_out, tp->total_retrans, in print_tp()
96 tp->segs_in, tp->data_segs_in, tp->segs_out, in print_tp()
97 tp->data_segs_out, tp->lost_out, tp->sacked_out, in print_tp()
98 tp->bytes_received, tp->bytes_acked); in print_tp()
123 memcpy(&srv_sk, &skel->bss->srv_sk, sizeof(srv_sk)); in check_result()
124 memcpy(&srv_tp, &skel->bss->srv_tp, sizeof(srv_tp)); in check_result()
125 memcpy(&cli_sk, &skel->bss->cli_sk, sizeof(cli_sk)); in check_result()
126 memcpy(&cli_tp, &skel->bss->cli_tp, sizeof(cli_tp)); in check_result()
127 memcpy(&listen_sk, &skel->bss->listen_sk, sizeof(listen_sk)); in check_result()
128 memcpy(&listen_tp, &skel->bss->listen_tp, sizeof(listen_tp)); in check_result()
163 CHECK(!skel->bss->lsndtime, "srv_tp", "Unexpected lsndtime:0\n"); in check_result()
202 CHECK(skel->bss->parent_cg_id != parent_cg_id, in check_result()
204 (size_t)skel->bss->parent_cg_id, (size_t)parent_cg_id); in check_result()
206 CHECK(skel->bss->child_cg_id != child_cg_id, in check_result()
208 (size_t)skel->bss->child_cg_id, (size_t)child_cg_id); in check_result()
276 int listen_fd = -1, cli_fd = -1, accept_fd = -1, err, i; in test()
283 if (CHECK_FAIL(listen_fd == -1)) in test()
290 memcpy(&skel->bss->srv_sa6, &srv_sa6, sizeof(srv_sa6)); in test()
293 if (CHECK_FAIL(cli_fd == -1)) in test()
302 if (CHECK(accept_fd == -1, "accept(listen_fd)", in test()
339 if (accept_fd != -1) in test()
341 if (cli_fd != -1) in test()
343 if (listen_fd != -1) in test()
349 int parent_cg_fd = -1, child_cg_fd = -1; in serial_test_sock_fields()
350 struct bpf_link *link; in serial_test_sock_fields() local
375 link = bpf_program__attach_cgroup(skel->progs.egress_read_sock_fields, child_cg_fd); in serial_test_sock_fields()
376 if (!ASSERT_OK_PTR(link, "attach_cgroup(egress_read_sock_fields)")) in serial_test_sock_fields()
378 skel->links.egress_read_sock_fields = link; in serial_test_sock_fields()
380 link = bpf_program__attach_cgroup(skel->progs.ingress_read_sock_fields, child_cg_fd); in serial_test_sock_fields()
381 if (!ASSERT_OK_PTR(link, "attach_cgroup(ingress_read_sock_fields)")) in serial_test_sock_fields()
383 skel->links.ingress_read_sock_fields = link; in serial_test_sock_fields()
385 link = bpf_program__attach_cgroup(skel->progs.read_sk_dst_port, child_cg_fd); in serial_test_sock_fields()
386 if (!ASSERT_OK_PTR(link, "attach_cgroup(read_sk_dst_port")) in serial_test_sock_fields()
388 skel->links.read_sk_dst_port = link; in serial_test_sock_fields()
390 linum_map_fd = bpf_map__fd(skel->maps.linum_map); in serial_test_sock_fields()
391 sk_pkt_out_cnt_fd = bpf_map__fd(skel->maps.sk_pkt_out_cnt); in serial_test_sock_fields()
392 sk_pkt_out_cnt10_fd = bpf_map__fd(skel->maps.sk_pkt_out_cnt10); in serial_test_sock_fields()