Home
last modified time | relevance | path

Searched refs:ifindex (Results 1 – 25 of 439) sorted by relevance

12345678910>>...18

/linux-6.6.21/security/selinux/
Dnetif.c52 static inline u32 sel_netif_hashfn(const struct net *ns, int ifindex) in sel_netif_hashfn() argument
54 return (((uintptr_t)ns + ifindex) & (SEL_NETIF_HASH_SIZE - 1)); in sel_netif_hashfn()
68 int ifindex) in sel_netif_find() argument
70 u32 idx = sel_netif_hashfn(ns, ifindex); in sel_netif_find()
75 netif->nsec.ifindex == ifindex) in sel_netif_find()
97 idx = sel_netif_hashfn(netif->nsec.ns, netif->nsec.ifindex); in sel_netif_insert()
132 static int sel_netif_sid_slow(struct net *ns, int ifindex, u32 *sid) in sel_netif_sid_slow() argument
142 dev = dev_get_by_index(ns, ifindex); in sel_netif_sid_slow()
145 __func__, ifindex); in sel_netif_sid_slow()
150 netif = sel_netif_find(ns, ifindex); in sel_netif_sid_slow()
[all …]
/linux-6.6.21/tools/testing/selftests/bpf/progs/
Dtest_check_mtu.c37 __u32 ifindex = 0; in xdp_use_helper() local
42 ifindex = GLOBAL_USER_IFINDEX; in xdp_use_helper()
44 if (bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0)) { in xdp_use_helper()
63 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_exceed_mtu() local
73 err = bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0); in xdp_exceed_mtu()
90 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_minus_delta() local
101 if (bpf_check_mtu(ctx, ifindex, &mtu_len, delta, 0)) in xdp_minus_delta()
114 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_input_len() local
125 if (bpf_check_mtu(ctx, ifindex, &mtu_len, 0, 0)) in xdp_input_len()
136 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_input_len_exceed() local
[all …]
Dkfree_skb.c28 int ifindex; member
52 int ifindex; member
84 meta.ifindex = _(dev->ifindex); in BPF_PROG()
99 meta.ifindex, data, pkt_data); in BPF_PROG()
102 if (users != 1 || pkt_data != bpf_htons(0x86dd) || meta.ifindex != 1) in BPF_PROG()
121 int len, ifindex; in BPF_PROG() local
125 ifindex = dev->ifindex; in BPF_PROG()
129 if (len != 74 || ifindex != 1) in BPF_PROG()
139 int len, ifindex; in BPF_PROG() local
143 ifindex = dev->ifindex; in BPF_PROG()
[all …]
Dempty_skb.c8 int ifindex; variable
14 ret = bpf_clone_redirect(skb, ifindex, BPF_F_INGRESS); in redirect_ingress()
21 ret = bpf_clone_redirect(skb, ifindex, 0); in redirect_egress()
28 ret = bpf_clone_redirect(skb, ifindex, BPF_F_INGRESS); in tc_redirect_ingress()
35 ret = bpf_clone_redirect(skb, ifindex, 0); in tc_redirect_egress()
/linux-6.6.21/tools/bpf/bpftool/
Dfeature.c144 static int get_vendor_id(int ifindex) in get_vendor_id() argument
150 if (!if_indextoname(ifindex, ifname)) in get_vendor_id()
520 __u32 ifindex) in probe_prog_load_ifindex() argument
526 .prog_ifindex = ifindex, in probe_prog_load_ifindex()
538 static bool probe_prog_type_ifindex(enum bpf_prog_type prog_type, __u32 ifindex) in probe_prog_type_ifindex() argument
547 NULL, 0, ifindex); in probe_prog_type_ifindex()
552 bool *supported_types, const char *define_prefix, __u32 ifindex) in probe_prog_type() argument
559 if (ifindex) { in probe_prog_type()
568 res = probe_prog_type_ifindex(prog_type, ifindex); in probe_prog_type()
597 static bool probe_map_type_ifindex(enum bpf_map_type map_type, __u32 ifindex) in probe_map_type_ifindex() argument
[all …]
Dnet.c33 int ifindex; member
58 int ifindex; member
220 static int netlink_get_class(int sock, unsigned int nl_pid, int ifindex, in netlink_get_class() argument
231 .t.tcm_ifindex = ifindex, in netlink_get_class()
259 static int netlink_get_qdisc(int sock, unsigned int nl_pid, int ifindex, in netlink_get_qdisc() argument
270 .t.tcm_ifindex = ifindex, in netlink_get_qdisc()
298 static int netlink_get_filter(int sock, unsigned int nl_pid, int ifindex, int handle, in netlink_get_filter() argument
309 .t.tcm_ifindex = ifindex, in netlink_get_filter()
376 netinfo->devices[netinfo->used_len].ifindex = ifinfo->ifi_index; in dump_link_nlmsg()
427 filter_info->devname, filter_info->ifindex); in dump_filter_nlmsg()
[all …]
/linux-6.6.21/include/net/
Dl3mdev.h67 int ifindex; in l3mdev_master_ifindex() local
70 ifindex = l3mdev_master_ifindex_rcu(dev); in l3mdev_master_ifindex()
73 return ifindex; in l3mdev_master_ifindex()
76 static inline int l3mdev_master_ifindex_by_index(struct net *net, int ifindex) in l3mdev_master_ifindex_by_index() argument
81 if (likely(ifindex)) { in l3mdev_master_ifindex_by_index()
84 dev = dev_get_by_index_rcu(net, ifindex); in l3mdev_master_ifindex_by_index()
119 int l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex);
121 int l3mdev_master_upper_ifindex_by_index(struct net *net, int ifindex) in l3mdev_master_upper_ifindex_by_index() argument
124 ifindex = l3mdev_master_upper_ifindex_by_index_rcu(net, ifindex); in l3mdev_master_upper_ifindex_by_index()
127 return ifindex; in l3mdev_master_upper_ifindex_by_index()
[all …]
/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/
Dtest_tunnel.c315 int key = 0, ifindex = -1; in test_vxlan_tunnel() local
330 ifindex = if_nametoindex(VXLAN_TUNL_DEV1); in test_vxlan_tunnel()
331 if (!ASSERT_NEQ(ifindex, 0, "vxlan11 ifindex")) in test_vxlan_tunnel()
333 tc_hook.ifindex = ifindex; in test_vxlan_tunnel()
344 ifindex = if_nametoindex("veth1"); in test_vxlan_tunnel()
345 if (!ASSERT_NEQ(ifindex, 0, "veth1 ifindex")) in test_vxlan_tunnel()
347 tc_hook.ifindex = ifindex; in test_vxlan_tunnel()
358 ifindex = if_nametoindex(VXLAN_TUNL_DEV0); in test_vxlan_tunnel()
359 if (!ASSERT_NEQ(ifindex, 0, "vxlan00 ifindex")) in test_vxlan_tunnel()
361 tc_hook.ifindex = ifindex; in test_vxlan_tunnel()
[all …]
Dxdp_dev_bound_only.c8 static int load_dummy_prog(char *name, __u32 ifindex, __u32 flags) in load_dummy_prog() argument
14 opts.prog_ifindex = ifindex; in load_dummy_prog()
28 __u32 ifindex; in test_xdp_dev_bound_only_offdev() local
37 ifindex = if_nametoindex("eth42"); in test_xdp_dev_bound_only_offdev()
38 if (!ASSERT_NEQ(ifindex, 0, "if_nametoindex")) { in test_xdp_dev_bound_only_offdev()
42 fd1 = load_dummy_prog("dummy1", ifindex, BPF_F_XDP_DEV_BOUND_ONLY); in test_xdp_dev_bound_only_offdev()
50 fd2 = load_dummy_prog("dummy2", ifindex, 0); in test_xdp_dev_bound_only_offdev()
Dempty_skb.c24 int *ifindex; in test_empty_skb() member
37 .ifindex = &veth_ifindex, in test_empty_skb()
45 .ifindex = &ipip_ifindex, in test_empty_skb()
59 .ifindex = &veth_ifindex, in test_empty_skb()
73 .ifindex = &ipip_ifindex, in test_empty_skb()
84 .ifindex = &veth_ifindex, in test_empty_skb()
91 .ifindex = &ipip_ifindex, in test_empty_skb()
126 bpf_obj->bss->ifindex = *tests[i].ifindex; in test_empty_skb()
/linux-6.6.21/samples/bpf/
Dtc_l2_redirect_kern.c65 int key = 0, *ifindex; in _l2_to_iptun_ingress_forward() local
72 ifindex = bpf_map_lookup_elem(&tun_iface, &key); in _l2_to_iptun_ingress_forward()
73 if (!ifindex) in _l2_to_iptun_ingress_forward()
86 bpf_trace_printk(fmt4, sizeof(fmt4), *ifindex, in _l2_to_iptun_ingress_forward()
88 return bpf_redirect(*ifindex, BPF_F_INGRESS); in _l2_to_iptun_ingress_forward()
100 bpf_trace_printk(fmt6, sizeof(fmt6), *ifindex, in _l2_to_iptun_ingress_forward()
103 return bpf_redirect(*ifindex, BPF_F_INGRESS); in _l2_to_iptun_ingress_forward()
116 int key = 0, *ifindex; in _l2_to_iptun_ingress_redirect() local
123 ifindex = bpf_map_lookup_elem(&tun_iface, &key); in _l2_to_iptun_ingress_redirect()
124 if (!ifindex) in _l2_to_iptun_ingress_redirect()
[all …]
Dxdp_adjust_tail_user.c27 static int ifindex = -1; variable
35 if (ifindex > -1) { in int_exit()
36 if (bpf_xdp_query_id(ifindex, xdp_flags, &curr_prog_id)) { in int_exit()
41 bpf_xdp_detach(ifindex, xdp_flags, NULL); in int_exit()
105 ifindex = if_nametoindex(optarg); in main()
106 if (!ifindex) in main()
107 ifindex = atoi(optarg); in main()
142 if (!ifindex) { in main()
182 if (bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL) < 0) { in main()
/linux-6.6.21/tools/net/ynl/samples/
Dnetdev.c24 if (!d->_present.ifindex) in netdev_print_device()
27 name = if_indextoname(d->ifindex, ifname); in netdev_print_device()
30 printf("[%d]\t", d->ifindex); in netdev_print_device()
55 int ifindex = 0; in main() local
58 ifindex = strtol(argv[1], NULL, 0); in main()
70 scanf("%d", &ifindex); in main()
72 if (ifindex > 0) { in main()
77 netdev_dev_get_req_set_ifindex(req, ifindex); in main()
86 } else if (!ifindex) { in main()
94 } else if (ifindex == -2) { in main()
/linux-6.6.21/net/can/
Dbcm.c104 int ifindex; member
128 int ifindex; member
175 static char *bcm_proc_getifname(struct net *net, char *result, int ifindex) in bcm_proc_getifname() argument
179 if (!ifindex) in bcm_proc_getifname()
183 dev = dev_get_by_index_rcu(net, ifindex); in bcm_proc_getifname()
205 seq_printf(m, " / bound %s", bcm_proc_getifname(net, ifname, bo->ifindex)); in bcm_proc_show()
217 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
246 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
280 if (!op->ifindex) in bcm_can_tx()
283 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx()
[all …]
/linux-6.6.21/net/ipv6/
Daddrlabel.c35 int ifindex; member
116 int addrtype, int ifindex) in __ip6addrlbl_match() argument
118 if (p->ifindex && p->ifindex != ifindex) in __ip6addrlbl_match()
129 int type, int ifindex) in __ipv6_addr_label() argument
134 if (__ip6addrlbl_match(p, addr, type, ifindex)) in __ipv6_addr_label()
141 const struct in6_addr *addr, int type, int ifindex) in ipv6_addr_label() argument
149 p = __ipv6_addr_label(net, addr, type, ifindex); in ipv6_addr_label()
154 __func__, addr, type, ifindex, label); in ipv6_addr_label()
161 int prefixlen, int ifindex, in ip6addrlbl_alloc() argument
168 __func__, prefix, prefixlen, ifindex, (unsigned int)label); in ip6addrlbl_alloc()
[all …]
/linux-6.6.21/net/l3mdev/
Dl3mdev.c81 int ifindex = -EINVAL; in l3mdev_ifindex_lookup_by_table_id() local
96 ifindex = lookup(net, table_id); in l3mdev_ifindex_lookup_by_table_id()
101 return ifindex; in l3mdev_ifindex_lookup_by_table_id()
112 int ifindex = 0; in l3mdev_master_ifindex_rcu() local
118 ifindex = dev->ifindex; in l3mdev_master_ifindex_rcu()
131 ifindex = master->ifindex; in l3mdev_master_ifindex_rcu()
134 return ifindex; in l3mdev_master_ifindex_rcu()
144 int l3mdev_master_upper_ifindex_by_index_rcu(struct net *net, int ifindex) in l3mdev_master_upper_ifindex_by_index_rcu() argument
148 dev = dev_get_by_index_rcu(net, ifindex); in l3mdev_master_upper_ifindex_by_index_rcu()
152 return dev ? dev->ifindex : 0; in l3mdev_master_upper_ifindex_by_index_rcu()
[all …]
/linux-6.6.21/tools/net/ynl/generated/
Dfou-user.h36 __u32 ifindex:1; member
47 __s32 ifindex; member
115 fou_add_req_set_ifindex(struct fou_add_req *req, __s32 ifindex) in fou_add_req_set_ifindex() argument
117 req->_present.ifindex = 1; in fou_add_req_set_ifindex()
118 req->ifindex = ifindex; in fou_add_req_set_ifindex()
131 __u32 ifindex:1; member
141 __s32 ifindex; member
162 fou_del_req_set_ifindex(struct fou_del_req *req, __s32 ifindex) in fou_del_req_set_ifindex() argument
164 req->_present.ifindex = 1; in fou_del_req_set_ifindex()
165 req->ifindex = ifindex; in fou_del_req_set_ifindex()
[all …]
Dnetdev-user.h27 __u32 ifindex:1; member
30 __u32 ifindex; member
40 netdev_dev_get_req_set_ifindex(struct netdev_dev_get_req *req, __u32 ifindex) in netdev_dev_get_req_set_ifindex() argument
42 req->_present.ifindex = 1; in netdev_dev_get_req_set_ifindex()
43 req->ifindex = ifindex; in netdev_dev_get_req_set_ifindex()
48 __u32 ifindex:1; member
53 __u32 ifindex; member
/linux-6.6.21/tools/testing/selftests/bpf/
Dxdp_redirect_multi.c45 static int get_mac_addr(unsigned int ifindex, void *mac_addr) in get_mac_addr() argument
55 if (!if_indextoname(ifindex, ifname)) in get_mac_addr()
93 unsigned int ifindex; in main() local
187 ifindex = ifaces[i]; in main()
190 ret = get_mac_addr(ifindex, mac_addr); in main()
192 printf("get interface %d mac failed\n", ifindex); in main()
195 ret = bpf_map_update_elem(mac_map, &ifindex, mac_addr, 0); in main()
203 devmap_val.ifindex = ifindex; in main()
205 ret = bpf_map_update_elem(group_all, &ifindex, &devmap_val, 0); in main()
212 ret = bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL); in main()
[all …]
Dxdp_synproxy.c19 static unsigned int ifindex; variable
34 .ifindex = ifindex, in cleanup()
49 err = bpf_xdp_attach(ifindex, -1, 0, NULL); in cleanup()
57 err = bpf_xdp_attach(ifindex, -1, XDP_FLAGS_REPLACE, &opts); in cleanup()
91 static void parse_options(int argc, char *argv[], unsigned int *ifindex, __u32 *prog_id, in parse_options() argument
114 *ifindex = 0; in parse_options()
133 *ifindex = if_nametoindex(optarg); in parse_options()
134 if (*ifindex == 0) in parse_options()
182 if (*ifindex != 0 && *prog_id != 0) in parse_options()
184 if (*ifindex == 0 && *prog_id == 0) in parse_options()
[all …]
/linux-6.6.21/include/trace/events/
Dxdp.h39 __field(int, ifindex)
45 __entry->ifindex = dev->ifindex;
51 __entry->ifindex)
62 __field(int, ifindex)
70 __entry->ifindex = dev->ifindex;
78 __entry->ifindex,
103 __field(int, ifindex)
111 u32 ifindex = 0, map_index = index;
118 ifindex = ((struct _bpf_dtab_netdev *)tgt)->dev->ifindex;
120 ifindex = index;
[all …]
/linux-6.6.21/drivers/net/ethernet/mellanox/mlx5/core/en/tc/
Dint_port.c13 int ifindex; member
106 int ifindex, in mlx5e_int_port_lookup() argument
115 if (int_port->ifindex == ifindex && int_port->type == type) { in mlx5e_int_port_lookup()
125 int ifindex, enum mlx5e_tc_int_port_type type, in mlx5e_int_port_metadata_alloc() argument
128 u32 mapped_key[2] = {type, ifindex}; in mlx5e_int_port_metadata_alloc()
151 int ifindex, in mlx5e_int_port_add() argument
174 err = mlx5e_int_port_metadata_alloc(priv, ifindex, type, &match_metadata); in mlx5e_int_port_add()
177 ifindex); in mlx5e_int_port_add()
190 int_port->ifindex = ifindex; in mlx5e_int_port_add()
265 int ifindex, in mlx5e_tc_int_port_get() argument
[all …]
/linux-6.6.21/tools/lib/bpf/
Dnetlink.c40 int ifindex; member
47 int ifindex; member
286 static int __bpf_set_link_xdp_fd_replace(int ifindex, int fd, int old_fd, in __bpf_set_link_xdp_fd_replace() argument
298 req.ifinfo.ifi_index = ifindex; in __bpf_set_link_xdp_fd_replace()
322 int bpf_xdp_attach(int ifindex, int prog_fd, __u32 flags, const struct bpf_xdp_attach_opts *opts) in bpf_xdp_attach() argument
335 err = __bpf_set_link_xdp_fd_replace(ifindex, prog_fd, old_prog_fd, flags); in bpf_xdp_attach()
339 int bpf_xdp_detach(int ifindex, __u32 flags, const struct bpf_xdp_attach_opts *opts) in bpf_xdp_detach() argument
341 return bpf_xdp_attach(ifindex, -1, flags, opts); in bpf_xdp_detach()
367 if (xdp_id->ifindex && xdp_id->ifindex != ifinfo->ifi_index) in get_xdp_info()
412 __u32 ifindex; in parse_xdp_features() local
[all …]
/linux-6.6.21/drivers/net/vxlan/
Dvxlan_multicast.c21 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); in vxlan_igmp_join() local
29 .imr_ifindex = ifindex, in vxlan_igmp_join()
42 ret = ipv6_stub->ipv6_sock_mc_join(sk, ifindex, in vxlan_igmp_join()
55 int ifindex = (rifindex ? : vxlan->default_dst.remote_ifindex); in vxlan_igmp_leave() local
63 .imr_ifindex = ifindex, in vxlan_igmp_leave()
76 ret = ipv6_stub->ipv6_sock_mc_drop(sk, ifindex, in vxlan_igmp_leave()
85 static bool vxlan_group_used_match(union vxlan_addr *ip, int ifindex, in vxlan_group_used_match() argument
94 if (rifindex != ifindex) in vxlan_group_used_match()
101 union vxlan_addr *ip, int ifindex) in vxlan_group_used_by_vnifilter() argument
106 if (vxlan_group_used_match(ip, ifindex, in vxlan_group_used_by_vnifilter()
[all …]
/linux-6.6.21/drivers/net/netdevsim/
Dhwstats.c57 int ifindex) in nsim_dev_hwslist_find_hwsdev() argument
62 if (hwsdev->netdev->ifindex == ifindex) in nsim_dev_hwslist_find_hwsdev()
121 hwsdev = nsim_dev_hwslist_find_hwsdev(hwsdev_list, dev->ifindex); in nsim_dev_hwstats_event_off_xstats()
163 hwsdev = nsim_dev_hwslist_find_hwsdev(hwsdev_list, dev->ifindex); in __nsim_dev_hwstats_event_unregister()
216 int ifindex, in nsim_dev_hwstats_enable_ifindex() argument
232 hwsdev = nsim_dev_hwslist_find_hwsdev(hwsdev_list, ifindex); in nsim_dev_hwstats_enable_ifindex()
236 netdev = dev_get_by_index(net, ifindex); in nsim_dev_hwstats_enable_ifindex()
272 int ifindex, in nsim_dev_hwstats_disable_ifindex() argument
281 hwsdev = nsim_dev_hwslist_find_hwsdev(hwsdev_list, ifindex); in nsim_dev_hwstats_disable_ifindex()
305 int ifindex, in nsim_dev_hwstats_fail_ifindex() argument
[all …]

12345678910>>...18