/tools/testing/selftests/bpf/progs/ |
D | test_tc_tunnel.c | 72 static __always_inline int encap_ipv4(struct __sk_buff *skb, __u8 encap_proto, in encap_ipv4() argument 97 if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph6_inner, in encap_ipv4() 114 if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph_inner, in encap_ipv4() 125 if (bpf_skb_load_bytes(skb, ETH_HLEN + tcp_off, in encap_ipv4() 179 if (bpf_skb_load_bytes(skb, 0, (__u8 *)&h_outer + olen, in encap_ipv4() 187 if (bpf_skb_adjust_room(skb, olen, BPF_ADJ_ROOM_MAC, flags)) in encap_ipv4() 199 if (bpf_skb_store_bytes(skb, ETH_HLEN, &h_outer, olen, in encap_ipv4() 207 if (bpf_skb_load_bytes(skb, 0, ð, sizeof(eth)) < 0) in encap_ipv4() 210 if (bpf_skb_store_bytes(skb, 0, ð, sizeof(eth), 0) < 0) in encap_ipv4() 217 static __always_inline int encap_ipv6(struct __sk_buff *skb, __u8 encap_proto, in encap_ipv6() argument [all …]
|
D | bpf_flow.c | 91 static __always_inline void *bpf_flow_dissect_get_header(struct __sk_buff *skb, in bpf_flow_dissect_get_header() argument 95 void *data_end = (void *)(long)skb->data_end; in bpf_flow_dissect_get_header() 96 void *data = (void *)(long)skb->data; in bpf_flow_dissect_get_header() 97 __u16 thoff = skb->flow_keys->thoff; in bpf_flow_dissect_get_header() 108 if (bpf_skb_load_bytes(skb, thoff, buffer, hdr_size)) in bpf_flow_dissect_get_header() 115 static __always_inline int parse_eth_proto(struct __sk_buff *skb, __be16 proto) in parse_eth_proto() argument 117 struct bpf_flow_keys *keys = skb->flow_keys; in parse_eth_proto() 121 bpf_tail_call(skb, &jmp_table, IP); in parse_eth_proto() 124 bpf_tail_call(skb, &jmp_table, IPV6); in parse_eth_proto() 128 bpf_tail_call(skb, &jmp_table, MPLS); in parse_eth_proto() [all …]
|
D | test_tc_edt.c | 27 static inline int throttle_flow(struct __sk_buff *skb) in throttle_flow() argument 31 uint64_t delay_ns = ((uint64_t)skb->len) * NS_PER_SEC / in throttle_flow() 39 tstamp = skb->tstamp; in throttle_flow() 56 bpf_skb_ecn_set_ce(skb); in throttle_flow() 60 skb->tstamp = next_tstamp; in throttle_flow() 65 static inline int handle_tcp(struct __sk_buff *skb, struct tcphdr *tcp) in handle_tcp() argument 67 void *data_end = (void *)(long)skb->data_end; in handle_tcp() 74 return throttle_flow(skb); in handle_tcp() 79 static inline int handle_ipv4(struct __sk_buff *skb) in handle_ipv4() argument 81 void *data_end = (void *)(long)skb->data_end; in handle_ipv4() [all …]
|
D | test_sk_lookup_kern.c | 57 int bpf_sk_lookup_test0(struct __sk_buff *skb) in bpf_sk_lookup_test0() argument 59 void *data_end = (void *)(long)skb->data_end; in bpf_sk_lookup_test0() 60 void *data = (void *)(long)skb->data; in bpf_sk_lookup_test0() 75 sk = bpf_sk_lookup_tcp(skb, tuple, tuple_len, BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_test0() 82 int bpf_sk_lookup_test1(struct __sk_buff *skb) in bpf_sk_lookup_test1() argument 87 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_test1() 94 int bpf_sk_lookup_uaf(struct __sk_buff *skb) in bpf_sk_lookup_uaf() argument 100 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_uaf() 109 int bpf_sk_lookup_modptr(struct __sk_buff *skb) in bpf_sk_lookup_modptr() argument 115 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); in bpf_sk_lookup_modptr() [all …]
|
D | sockmap_parse_prog.c | 8 int bpf_prog1(struct __sk_buff *skb) in bpf_prog1() argument 10 void *data_end = (void *)(long) skb->data_end; in bpf_prog1() 11 void *data = (void *)(long) skb->data; in bpf_prog1() 12 __u32 lport = skb->local_port; in bpf_prog1() 13 __u32 rport = skb->remote_port; in bpf_prog1() 19 err = bpf_skb_pull_data(skb, 10); in bpf_prog1() 23 data_end = (void *)(long)skb->data_end; in bpf_prog1() 24 data = (void *)(long)skb->data; in bpf_prog1() 35 return skb->len; in bpf_prog1()
|
D | test_tunnel_kern.c | 46 int _gre_set_tunnel(struct __sk_buff *skb) in _gre_set_tunnel() argument 57 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _gre_set_tunnel() 68 int _gre_get_tunnel(struct __sk_buff *skb) in _gre_get_tunnel() argument 74 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); in _gre_get_tunnel() 85 int _ip6gretap_set_tunnel(struct __sk_buff *skb) in _ip6gretap_set_tunnel() argument 97 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _ip6gretap_set_tunnel() 109 int _ip6gretap_get_tunnel(struct __sk_buff *skb) in _ip6gretap_get_tunnel() argument 115 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), in _ip6gretap_get_tunnel() 129 int _erspan_set_tunnel(struct __sk_buff *skb) in _erspan_set_tunnel() argument 141 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in _erspan_set_tunnel() [all …]
|
D | test_lwt_seg6local.c | 53 static __always_inline struct ip6_srh_t *get_srh(struct __sk_buff *skb) in get_srh() argument 60 data_end = (void *)(long)skb->data_end; in get_srh() 61 cursor = (void *)(long)skb->data; in get_srh() 88 int update_tlv_pad(struct __sk_buff *skb, uint32_t new_pad, in update_tlv_pad() argument 94 err = bpf_lwt_seg6_adjust_srh(skb, pad_off, in update_tlv_pad() 108 err = bpf_lwt_seg6_store_bytes(skb, pad_off, in update_tlv_pad() 118 int is_valid_tlv_boundary(struct __sk_buff *skb, struct ip6_srh_t *srh, in is_valid_tlv_boundary() argument 126 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary() 144 err = bpf_skb_load_bytes(skb, cur_off, &tlv, sizeof(tlv)); in is_valid_tlv_boundary() 177 int add_tlv(struct __sk_buff *skb, struct ip6_srh_t *srh, uint32_t tlv_off, in add_tlv() argument [all …]
|
D | test_skb_cgroup_id_kern.c | 20 static __always_inline void log_nth_level(struct __sk_buff *skb, __u32 level) in log_nth_level() argument 27 id = bpf_skb_ancestor_cgroup_id(skb, level); in log_nth_level() 32 int log_cgroup_id(struct __sk_buff *skb) in log_cgroup_id() argument 37 log_nth_level(skb, 0); in log_cgroup_id() 38 log_nth_level(skb, 1); in log_cgroup_id() 39 log_nth_level(skb, 2); in log_cgroup_id() 40 log_nth_level(skb, 3); in log_cgroup_id()
|
D | test_seg6_loop.c | 53 static __always_inline struct ip6_srh_t *get_srh(struct __sk_buff *skb) in get_srh() argument 60 data_end = (void *)(long)skb->data_end; in get_srh() 61 cursor = (void *)(long)skb->data; in get_srh() 87 static __always_inline int update_tlv_pad(struct __sk_buff *skb, in update_tlv_pad() argument 94 err = bpf_lwt_seg6_adjust_srh(skb, pad_off, in update_tlv_pad() 108 err = bpf_lwt_seg6_store_bytes(skb, pad_off, in update_tlv_pad() 117 static __always_inline int is_valid_tlv_boundary(struct __sk_buff *skb, in is_valid_tlv_boundary() argument 127 srh_off = (char *)srh - (char *)(long)skb->data; in is_valid_tlv_boundary() 147 err = bpf_skb_load_bytes(skb, cur_off, &tlv, sizeof(tlv)); in is_valid_tlv_boundary() 179 static __always_inline int add_tlv(struct __sk_buff *skb, in add_tlv() argument [all …]
|
D | sockmap_verdict_prog.c | 36 int bpf_prog2(struct __sk_buff *skb) in bpf_prog2() argument 38 void *data_end = (void *)(long) skb->data_end; in bpf_prog2() 39 void *data = (void *)(long) skb->data; in bpf_prog2() 40 __u32 lport = skb->local_port; in bpf_prog2() 41 __u32 rport = skb->remote_port; in bpf_prog2() 61 return bpf_sk_redirect_map(skb, &sock_map_rx, sk, 0); in bpf_prog2() 62 return bpf_sk_redirect_map(skb, &sock_map_tx, sk, 0); in bpf_prog2()
|
D | test_pkt_md_access.c | 15 TYPE tmp = *(volatile TYPE *)&skb->FIELD; \ 16 if (tmp != ((*(volatile __u32 *)&skb->FIELD) & MASK)) \ 23 TYPE tmp = *((volatile TYPE *)&skb->FIELD + \ 24 TEST_FIELD_OFFSET(skb->FIELD, TYPE)); \ 25 if (tmp != ((*(volatile __u32 *)&skb->FIELD) & MASK)) \ 31 int process(struct __sk_buff *skb) in process() argument
|
D | test_lwt_ip_encap.c | 16 int bpf_lwt_encap_gre(struct __sk_buff *skb) in bpf_lwt_encap_gre() argument 39 hdr.iph.tot_len = bpf_htons(skb->len + sizeof(struct encap_hdr)); in bpf_lwt_encap_gre() 41 hdr.greh.protocol = skb->protocol; in bpf_lwt_encap_gre() 43 err = bpf_lwt_push_encap(skb, BPF_LWT_ENCAP_IP, &hdr, in bpf_lwt_encap_gre() 52 int bpf_lwt_encap_gre6(struct __sk_buff *skb) in bpf_lwt_encap_gre6() argument 63 hdr.ip6hdr.payload_len = bpf_htons(skb->len + sizeof(struct grehdr)); in bpf_lwt_encap_gre6() 75 hdr.greh.protocol = skb->protocol; in bpf_lwt_encap_gre6() 77 err = bpf_lwt_push_encap(skb, BPF_LWT_ENCAP_IP, &hdr, in bpf_lwt_encap_gre6()
|
D | test_skb_ctx.c | 10 int process(struct __sk_buff *skb) in process() argument 14 if (skb->cb[i] != i + 1) in process() 16 skb->cb[i]++; in process() 18 skb->priority++; in process()
|
D | loop4.c | 9 int combinations(volatile struct __sk_buff* skb) in combinations() argument 15 if (skb->len) in combinations()
|
D | test_pkt_access.c | 21 int process(struct __sk_buff *skb) in process() argument 23 void *data_end = (void *)(long)skb->data_end; in process() 24 void *data = (void *)(long)skb->data; in process()
|
D | loop5.c | 10 int while_true(volatile struct __sk_buff* skb) in while_true() argument 15 if (skb->len) in while_true()
|
D | test_tcp_check_syncookie_kern.c | 152 int check_syncookie_clsact(struct __sk_buff *skb) in check_syncookie_clsact() argument 154 check_syncookie(skb, (void *)(long)skb->data, in check_syncookie_clsact() 155 (void *)(long)skb->data_end); in check_syncookie_clsact()
|
D | netcnt_prog.c | 26 int bpf_nextcnt(struct __sk_buff *skb) in bpf_nextcnt() argument 38 percpu_cnt->bytes += skb->len; in bpf_nextcnt()
|
D | test_obj_id.c | 24 int test_obj_id(struct __sk_buff *skb) in test_obj_id() argument
|
/tools/testing/selftests/bpf/prog_tests/ |
D | skb_ctx.c | 6 struct __sk_buff skb = { in test_skb_ctx() local 17 .ctx_in = &skb, in test_skb_ctx() 18 .ctx_size_in = sizeof(skb), in test_skb_ctx() 19 .ctx_out = &skb, in test_skb_ctx() 20 .ctx_size_out = sizeof(skb), in test_skb_ctx() 36 tattr.ctx_size_in = sizeof(skb); in test_skb_ctx() 43 tattr.ctx_size_out = sizeof(skb); in test_skb_ctx() 47 skb.len = 1; in test_skb_ctx() 50 skb.len = 0; in test_skb_ctx() 52 skb.tc_index = 1; in test_skb_ctx() [all …]
|
/tools/perf/scripts/python/bin/ |
D | netdev-times-record | 4 -e skb:consume_skb -e skb:kfree_skb \ 5 -e skb:skb_copy_datagram_iovec -e napi:napi_poll \
|
D | net_dropmonitor-record | 2 perf record -e skb:kfree_skb $@
|
/tools/testing/selftests/bpf/ |
D | test_queue_stack_map.h | 30 int _test(struct __sk_buff *skb) in _test() argument 32 void *data_end = (void *)(long)skb->data_end; in _test() 33 void *data = (void *)(long)skb->data; in _test()
|
D | test_sockmap_kern.h | 88 int bpf_prog1(struct __sk_buff *skb) in bpf_prog1() argument 90 return skb->len; in bpf_prog1() 94 int bpf_prog2(struct __sk_buff *skb) in bpf_prog2() argument 96 __u32 lport = skb->local_port; in bpf_prog2() 97 __u32 rport = skb->remote_port; in bpf_prog2() 106 len = (__u32)skb->data_end - (__u32)skb->data; in bpf_prog2() 116 return bpf_sk_redirect_map(skb, &sock_map, ret, flags); in bpf_prog2() 118 return bpf_sk_redirect_hash(skb, &sock_map, &ret, flags); in bpf_prog2()
|
/tools/perf/scripts/python/ |
D | netdev-times.py | 408 skb = {'dev':dev_name, 'skbaddr':skbaddr, 'len':skblen, 'queue_t':time} 409 tx_queue_list.insert(0, skb) 421 skb = tx_queue_list[i] 422 if skb['skbaddr'] == skbaddr: 423 skb['xmit_t'] = time 424 tx_xmit_list.insert(0, skb) 435 skb = tx_queue_list[i] 436 if skb['skbaddr'] == skbaddr: 440 skb = tx_xmit_list[i] 441 if skb['skbaddr'] == skbaddr: [all …]
|