| /tools/testing/selftests/bpf/progs/ |
| A D | tcp_ca_kfunc.c | 33 bbr_init(sk); in BPF_PROG() 34 dctcp_init(sk); in BPF_PROG() 35 cubictcp_init(sk); in BPF_PROG() 47 bbr_main(sk, ack, flag, rs); in BPF_PROG() 65 bbr_undo_cwnd(sk); in BPF_PROG() 66 return dctcp_cwnd_undo(sk); in BPF_PROG() 72 bbr_cwnd_event(sk, event); in BPF_PROG() 80 bbr_ssthresh(sk); in BPF_PROG() 81 dctcp_ssthresh(sk); in BPF_PROG() 95 dctcp_state(sk, new_state); in BPF_PROG() [all …]
|
| A D | test_sk_lookup_kern.c | 62 struct bpf_sock *sk; in sk_lookup_success() local 76 if (sk) in sk_lookup_success() 77 bpf_sk_release(sk); in sk_lookup_success() 88 if (sk) in sk_lookup_success_simple() 101 if (sk) { in err_use_after_free() 115 if (sk) { in err_modify_sk_pointer() 116 sk += 1; in err_modify_sk_pointer() 129 sk += 1; in err_modify_sk_or_null_pointer() 130 if (sk) in err_modify_sk_or_null_pointer() 151 bpf_sk_release(sk); in err_release_twice() [all …]
|
| A D | sock_iter_batch.c | 40 if (!sk) in iter_tcp_soreuse() 44 sk = bpf_core_cast(sk, struct sock); in iter_tcp_soreuse() 45 if (sk->sk_family != sf || in iter_tcp_soreuse() 47 (sk->sk_family == AF_INET6 ? in iter_tcp_soreuse() 52 if (sk->sk_num == ports[0]) in iter_tcp_soreuse() 62 net = sk->sk_net.net; in iter_tcp_soreuse() 64 hash ^= sk->sk_num; in iter_tcp_soreuse() 104 if (!sk) in iter_udp_soreuse() 108 sk = bpf_core_cast(sk, struct sock); in iter_udp_soreuse() 109 if (sk->sk_family != sf || in iter_udp_soreuse() [all …]
|
| A D | bpf_cc_cubic.c | 49 const struct tcp_sock *tp = tcp_sk(sk); in tcp_update_pacing_rate() 73 sk->sk_pacing_rate = min(rate, sk->sk_max_pacing_rate); in tcp_update_pacing_rate() 79 struct tcp_sock *tp = tcp_sk(sk); in tcp_cwnd_reduction() 116 cubictcp_init(sk); in BPF_PROG() 122 cubictcp_cwnd_event(sk, event); in BPF_PROG() 129 struct tcp_sock *tp = tcp_sk(sk); in BPF_PROG() 150 tcp_update_pacing_rate(sk); in BPF_PROG() 156 return cubictcp_recalc_ssthresh(sk); in BPF_PROG() 162 cubictcp_state(sk, new_state); in BPF_PROG() 168 cubictcp_acked(sk, sample); in BPF_PROG() [all …]
|
| A D | test_sock_fields.c | 136 sk = skb->sk; in egress_read_sock_fields() 137 if (!sk) in egress_read_sock_fields() 143 if (sk->family != AF_INET6 || !is_loopback6(sk->src_ip6) || in egress_read_sock_fields() 161 sk = bpf_sk_fullsock(sk); in egress_read_sock_fields() 162 if (!sk) in egress_read_sock_fields() 229 sk = skb->sk; in ingress_read_sock_fields() 230 if (!sk) in ingress_read_sock_fields() 243 sk = bpf_sk_fullsock(sk); in ingress_read_sock_fields() 244 if (!sk) in ingress_read_sock_fields() 292 sk = skb->sk; in read_sk_dst_port() [all …]
|
| A D | bpf_dctcp.c | 70 const struct tcp_sock *tp = tcp_sk(sk); in BPF_PROG() 71 struct bpf_dctcp *ca = inet_csk_ca(sk); in BPF_PROG() 118 struct tcp_sock *tp = tcp_sk(sk); in BPF_PROG() 157 struct tcp_sock *tp = tcp_sk(sk); in dctcp_react_to_loss() 168 dctcp_react_to_loss(sk); in BPF_PROG() 176 struct tcp_sock *tp = tcp_sk(sk); in dctcp_ece_ack_cwr() 200 dctcp_ece_ack_cwr(sk, *ce_state); in dctcp_ece_ack_update() 205 *prior_rcv_nxt = tcp_sk(sk)->rcv_nxt; in dctcp_ece_ack_update() 207 dctcp_ece_ack_cwr(sk, new_ce_state); in dctcp_ece_ack_update() 221 dctcp_react_to_loss(sk); in BPF_PROG() [all …]
|
| A D | setget_sockopt.c | 83 struct sock *sk; member 209 struct sock *sk; in bpf_test_tcp_sockopt() local 220 sk = lc->sk; in bpf_test_tcp_sockopt() 259 struct loop_ctx lc = { .ctx = ctx, .sk = sk, }; in bpf_test_sockopt() 263 family = sk->sk_family; in bpf_test_sockopt() 361 struct sock *sk = sock->sk; in BPF_PROG() local 363 if (!sk) in BPF_PROG() 366 nr_socket_post_create += !bpf_test_sockopt(sk, sk); in BPF_PROG() 375 struct bpf_sock *sk = ctx->sk; in _getsockopt() local 394 struct sock *sk; in skops_sockopt() local [all …]
|
| A D | test_sk_lookup.c | 118 if (!sk) in redir_port() 141 if (!sk) in redir_ip4() 167 if (!sk) in redir_ip6() 182 if (!sk) in select_sock_a() 197 if (!sk) in select_sock_a_no_reuseport() 224 if (!sk) in sk_assign_eexist() 243 if (sk) in sk_assign_eexist() 275 if (sk) in sk_assign_replace_flag() 304 if (ctx->sk != sk) in sk_assign_null() 318 if (sk) in sk_assign_null() [all …]
|
| A D | cgrp_ls_attach_cgroup.c | 28 struct bpf_sock *sk; in set_cookie() local 33 sk = ctx->sk; in set_cookie() 34 if (!sk) in set_cookie() 37 tcp_sk = bpf_skc_to_tcp_sock(sk); in set_cookie() 42 tcp_sk->inet_conn.icsk_inet.sk.sk_cgrp_data.cgroup, 0, in set_cookie() 57 struct bpf_sock *sk; in update_cookie_sockops() local 62 sk = ctx->sk; in update_cookie_sockops() 63 if (!sk) in update_cookie_sockops() 66 tcp_sk = bpf_skc_to_tcp_sock(sk); in update_cookie_sockops() 71 tcp_sk->inet_conn.icsk_inet.sk.sk_cgrp_data.cgroup, 0, 0); in update_cookie_sockops() [all …]
|
| A D | verifier_sockmap_mutate.c | 18 struct sock *sk; member 48 if (sk) { in test_sockmap_update() 58 if (sk) { in test_sockmap_lookup_and_update() 59 test_sockmap_update(sk); in test_sockmap_lookup_and_update() 60 bpf_sk_release(sk); in test_sockmap_lookup_and_update() 67 test_sockmap_update(sk); in test_sockmap_mutate() 80 test_sockmap_mutate(skb->sk); in test_sched_act() 88 test_sockmap_mutate(skb->sk); in test_sched_cls() 112 test_sockmap_mutate(ctx->sk); in test_trace_iter() 136 test_sockmap_mutate(ctx->sk); in test_sk_lookup() [all …]
|
| A D | test_sk_storage_tracing.c | 41 stg = bpf_sk_storage_get(&sk_stg_map, sk, 0, in BPF_PROG() 48 bpf_sk_storage_delete(&del_sk_stg_map, sk); in BPF_PROG() 53 static void set_task_info(struct sock *sk) in set_task_info() argument 58 stg = bpf_sk_storage_get(&sk_stg_map, sk, 0, in set_task_info() 71 int BPF_PROG(trace_inet_csk_listen_start, struct sock *sk) in BPF_PROG() argument 73 set_task_info(sk); in BPF_PROG() 79 int BPF_PROG(trace_tcp_connect, struct sock *sk) in BPF_PROG() argument 81 set_task_info(sk); in BPF_PROG() 99 bpf_sk_storage_get(&sk_stg_map, sk, 0, 0); in BPF_PROG() 100 bpf_sk_storage_get(&sk_stg_map, req->sk, 0, 0); in BPF_PROG() [all …]
|
| A D | kfunc_call_test.c | 10 struct bpf_sock *sk = skb->sk; in kfunc_call_test4() local 13 if (!sk) in kfunc_call_test4() 16 sk = bpf_sk_fullsock(sk); in kfunc_call_test4() 17 if (!sk) in kfunc_call_test4() 27 struct bpf_sock *sk = skb->sk; in kfunc_call_test2() local 29 if (!sk) in kfunc_call_test2() 32 sk = bpf_sk_fullsock(sk); in kfunc_call_test2() 33 if (!sk) in kfunc_call_test2() 42 struct bpf_sock *sk = skb->sk; in kfunc_call_test1() local 46 if (!sk) in kfunc_call_test1() [all …]
|
| A D | tcp_ca_write_sk_pacing.c | 24 void BPF_PROG(write_sk_pacing_init, struct sock *sk) in BPF_PROG() argument 27 __sync_bool_compare_and_swap(&sk->sk_pacing_status, SK_PACING_NONE, in BPF_PROG() 30 sk->sk_pacing_status = SK_PACING_NEEDED; in BPF_PROG() 35 void BPF_PROG(write_sk_pacing_cong_control, struct sock *sk, in BPF_PROG() argument 38 struct tcp_sock *tp = tcp_sk(sk); in BPF_PROG() 42 sk->sk_pacing_rate = min(rate, sk->sk_max_pacing_rate); in BPF_PROG() 47 __u32 BPF_PROG(write_sk_pacing_ssthresh, struct sock *sk) in BPF_PROG() argument 49 return tcp_sk(sk)->snd_ssthresh; in BPF_PROG() 53 __u32 BPF_PROG(write_sk_pacing_undo_cwnd, struct sock *sk) in BPF_PROG() argument 55 return tcp_sk(sk)->snd_cwnd; in BPF_PROG()
|
| A D | kfunc_call_test_subprog.c | 11 struct bpf_sock *sk = skb->sk; in f1() local 14 if (!sk) in f1() 17 sk = bpf_sk_fullsock(sk); in f1() 18 if (!sk) in f1() 26 sk_state_res = bpf_kfunc_call_test3((struct sock *)sk)->__sk_common.skc_state; in f1() 28 return (__u32)bpf_kfunc_call_test1((struct sock *)sk, 1, 2, 3, 4); in f1()
|
| A D | sk_storage_omem_uncharge.c | 25 struct sock *sk; in BPF_PROG() local 30 sk = bpf_core_cast(sk_ptr, struct sock); in BPF_PROG() 31 if (sk->sk_cookie.counter != cookie) in BPF_PROG() 35 omem = sk->sk_omem_alloc.counter; in BPF_PROG() 42 int BPF_PROG(inet6_sock_destruct, struct sock *sk) in BPF_PROG() argument 46 if (!cookie || sk->sk_cookie.counter != cookie) in BPF_PROG() 49 value = bpf_sk_storage_get(&sk_storage, sk, 0, 0); in BPF_PROG() 52 sk_ptr = sk; in BPF_PROG() 53 local_storage_ptr = sk->sk_bpf_storage; in BPF_PROG()
|
| A D | summarization.c | 8 long changes_pkt_data(struct __sk_buff *sk) in changes_pkt_data() argument 10 return bpf_skb_pull_data(sk, 0); in changes_pkt_data() 14 long does_not_change_pkt_data(struct __sk_buff *sk) in does_not_change_pkt_data() argument 20 int main_changes_with_subprogs(struct __sk_buff *sk) in main_changes_with_subprogs() argument 22 changes_pkt_data(sk); in main_changes_with_subprogs() 23 does_not_change_pkt_data(sk); in main_changes_with_subprogs() 28 int main_changes(struct __sk_buff *sk) in main_changes() argument 30 bpf_skb_pull_data(sk, 0); in main_changes() 35 int main_does_not_change(struct __sk_buff *sk) in main_does_not_change() argument
|
| A D | net_timestamping.c | 103 const struct sock *sk) in bpf_test_access_bpf_calls() argument 105 if (bpf_test_access_sockopt(skops, sk)) in bpf_test_access_bpf_calls() 129 if (bpf_test_access_bpf_calls(skops, sk)) in bpf_test_delay() 194 u32 flag = sk->sk_bpf_cb_flags; in BPF_PROG() 213 struct bpf_sock *bpf_sk = skops->sk; in skops_sockopt() 214 const struct sock *sk; in skops_sockopt() local 220 if (!sk) in skops_sockopt() 228 if (bpf_test_delay(skops, sk)) in skops_sockopt() 232 if (bpf_test_delay(skops, sk)) in skops_sockopt() 236 if (bpf_test_delay(skops, sk)) in skops_sockopt() [all …]
|
| /tools/testing/selftests/net/tcp_ao/ |
| A D | setsockopt-closed.c | 80 close(sk); in __setsockopt_checked() 99 close(sk); in __setsockopt_checked() 181 return sk; in prepare_defs() 196 int sk; in test_extend() local 238 int sk; in test_optmem_limit() local 276 int sk; in test_einval_add_key() local 384 int sk; in test_einval_del_key() local 502 int sk; in test_einval_ao_info() local 604 int sk; in test_einval_get_keys() local 768 int sk; in duplicate_tests() local [all …]
|
| A D | rst.c | 82 close(sk); in close_forced() 89 int sk, lsk; in test_server_active_rst() local 102 if (sk < 0) in test_server_active_rst() 132 int sk, lsk; in test_server_passive_rst() local 145 if (sk < 0) in test_server_passive_rst() 165 close(sk); in test_server_passive_rst() 224 nfd = sk[i]; in test_wait_fds() 329 int sk, err; in test_client_passive_rst() local 332 if (sk < 0) in test_client_passive_rst() 390 if (sk < 0) in test_client_passive_rst() [all …]
|
| A D | self-connect.c | 43 int sk; in tcp_self_connect() local 48 if (sk < 0) in tcp_self_connect() 78 close(sk); in tcp_self_connect() 95 close(sk); in tcp_self_connect() 100 close(sk); in tcp_self_connect() 107 close(sk); in tcp_self_connect() 111 test_enable_repair(sk); in tcp_self_connect() 119 test_kill_sk(sk); in tcp_self_connect() 122 if (sk < 0) in tcp_self_connect() 144 close(sk); in tcp_self_connect() [all …]
|
| A D | key-management.c | 42 if (sk < 0) in prepare_sk() 53 return sk; in prepare_sk() 63 return sk; in prepare_lsk() 236 int sk; in check_closed_socket() local 583 int sk; in key_collection_socket() local 852 int sk; in try_server_run() local 865 int sk; in server_rotations() local 892 int sk; in run_client() local 1052 int sk; in check_current_back() local 1086 int sk; in roll_over_keys() local [all …]
|
| A D | seq-ext.c | 45 int sk; in test_sk_restore() local 48 if (sk < 0) in test_sk_restore() 62 return sk; in test_sk_restore() 73 int sk, lsk; in server_fn() local 86 if (sk < 0) in server_fn() 108 test_kill_sk(sk); in server_fn() 169 close(sk); in server_fn() 180 int sk; in client_fn() local 183 if (sk < 0) in client_fn() 205 test_kill_sk(sk); in client_fn() [all …]
|
| A D | restore.c | 23 int sk, lsk, dummy; in try_server_run() local 38 if (sk < 0) in try_server_run() 87 close(sk); in try_server_run() 113 int sk; in test_get_sk_checkpoint() local 116 if (sk < 0) in test_get_sk_checkpoint() 130 test_enable_repair(sk); in test_get_sk_checkpoint() 133 test_kill_sk(sk); in test_get_sk_checkpoint() 145 int sk, dummy; in test_sk_restore() local 152 if (sk < 0) in test_sk_restore() 155 test_enable_repair(sk); in test_sk_restore() [all …]
|
| /tools/testing/selftests/net/tcp_ao/lib/ |
| A D | repair.c | 90 if (ioctl(sk, SIOCOUTQ, &state->outq_len)) in __test_sock_checkpoint() 97 if (ioctl(sk, SIOCINQ, &state->inq_len)) in __test_sock_checkpoint() 150 ret = send(sk, buf + off, chunk, 0); in test_sock_restore_queue() 171 if (bind(sk, saddr, addr_size)) in __test_sock_restore() 174 flags = fcntl(sk, F_GETFL); in __test_sock_restore() 185 if (connect(sk, daddr, addr_size)) in __test_sock_restore() 234 void test_enable_repair(int sk) in test_enable_repair() argument 242 void test_disable_repair(int sk) in test_disable_repair() argument 250 void test_kill_sk(int sk) in test_kill_sk() argument 252 test_enable_repair(sk); in test_kill_sk() [all …]
|
| A D | sock.c | 16 if (sk < 0) in __test_listen_socket() 27 flags = fcntl(sk, F_GETFL); in __test_listen_socket() 31 if (listen(sk, backlog)) in __test_listen_socket() 34 return sk; in __test_listen_socket() 44 FD_SET(sk, &fds); in __test_wait_fd() 46 FD_SET(sk, &efds); in __test_wait_fd() 126 flags = fcntl(sk, F_GETFL); in __test_connect_socket() 136 return sk; in __test_connect_socket() 141 return sk; in __test_connect_socket() 144 close(sk); in __test_connect_socket() [all …]
|