/linux/security/selinux/ |
A D | netif.c | 68 int ifindex) in sel_netif_find() argument 70 int idx = sel_netif_hashfn(ns, ifindex); in sel_netif_find() 75 netif->nsec.ifindex == ifindex) in sel_netif_find() 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() 162 new->nsec.ifindex = ifindex; in sel_netif_sid_slow() 173 __func__, ifindex); in sel_netif_sid_slow() 196 netif = sel_netif_find(ns, ifindex); in sel_netif_sid() 204 return sel_netif_sid_slow(ns, ifindex, sid); in sel_netif_sid() [all …]
|
/linux/net/l3mdev/ |
A D | l3mdev.c | 81 int ifindex = -EINVAL; in l3mdev_ifindex_lookup_by_table_id() local 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() 194 if (!ifindex) in l3mdev_fib_table_by_index() 280 int ifindex; in l3mdev_update_flow() local 288 if (ifindex) { in l3mdev_update_flow() 289 fl->flowi_oif = ifindex; in l3mdev_update_flow() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
A D | test_check_mtu.c | 37 __u32 ifindex = 0; in xdp_use_helper() local 42 ifindex = GLOBAL_USER_IFINDEX; in xdp_use_helper() 63 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_exceed_mtu() local 90 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_minus_delta() local 114 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_input_len() local 136 __u32 ifindex = GLOBAL_USER_IFINDEX; in xdp_input_len_exceed() local 178 __u32 ifindex = GLOBAL_USER_IFINDEX; in tc_exceed_mtu() local 205 __u32 ifindex = GLOBAL_USER_IFINDEX; in tc_exceed_mtu_da() local 230 __u32 ifindex = GLOBAL_USER_IFINDEX; in tc_minus_delta() local 252 __u32 ifindex = GLOBAL_USER_IFINDEX; in tc_input_len() local [all …]
|
A D | kfree_skb.c | 28 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 …]
|
A D | test_xdp_bpf2bpf.c | 12 int ifindex; member 33 int ifindex; member 51 meta.ifindex = xdp->rxq->dev->ifindex; in BPF_PROG() 58 test_result_fentry = xdp->rxq->dev->ifindex; in BPF_PROG()
|
/linux/include/net/ |
A D | l3mdev.h | 67 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() 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() 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() 131 u32 l3mdev_fib_table_by_index(struct net *net, int ifindex); 148 if (ifindex == 0) in netif_index_is_l3_master() [all …]
|
/linux/samples/bpf/ |
A D | tc_l2_redirect_kern.c | 65 int key = 0, *ifindex; in _l2_to_iptun_ingress_forward() local 73 if (!ifindex) in _l2_to_iptun_ingress_forward() 88 return bpf_redirect(*ifindex, BPF_F_INGRESS); 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 124 if (!ifindex) in _l2_to_iptun_ingress_redirect() 147 return bpf_redirect(*ifindex, 0); in _l2_to_iptun_ingress_redirect() 157 int key = 0, *ifindex; in _l2_to_ip6tun_ingress_redirect() local 163 if (!ifindex) in _l2_to_ip6tun_ingress_redirect() 177 *ifindex); in _l2_to_ip6tun_ingress_redirect() [all …]
|
A D | xdp_redirect_map_multi_user.c | 54 unsigned int ifindex; in update_mac_map() local 58 ifindex = ifaces[i]; in update_mac_map() 60 ret = get_mac_addr(ifindex, mac_addr); in update_mac_map() 63 ifindex); in update_mac_map() 67 ret = bpf_map_update_elem(mac_map_fd, &ifindex, mac_addr, 0); in update_mac_map() 70 ifindex); in update_mac_map() 88 unsigned int ifindex; in main() local 190 ifindex = ifaces[i]; in main() 195 if (sample_install_xdp(ingress_prog, ifindex, generic, force) < 0) { in main() 210 devmap_val.ifindex = ifindex; in main() [all …]
|
A D | xdp_adjust_tail_user.c | 28 static int ifindex = -1; variable 36 if (ifindex > -1) { in int_exit() 37 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 42 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 108 ifindex = if_nametoindex(optarg); in main() 109 if (!ifindex) in main() 110 ifindex = atoi(optarg); in main() 145 if (!ifindex) { in main() 176 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main()
|
A D | xdp_tx_iptunnel_user.c | 25 static int ifindex = -1; variable 34 if (ifindex > -1) { in int_exit() 35 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 40 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 184 ifindex = if_nametoindex(optarg); in main() 185 if (!ifindex) in main() 186 ifindex = atoi(optarg); in main() 256 if (!ifindex) { in main() 291 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main() 305 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in main()
|
A D | xdp_sample.bpf.c | 100 return xdp_redirect_collect_stat(dev->ifindex, err); in BPF_PROG() 108 return xdp_redirect_collect_stat(dev->ifindex, err); in BPF_PROG() 116 return xdp_redirect_collect_stat(dev->ifindex, err); in BPF_PROG() 124 return xdp_redirect_collect_stat(dev->ifindex, err); in BPF_PROG() 188 if (!IN_SET(from_match, dev->ifindex)) in BPF_PROG() 190 if (!IN_SET(to_match, dev->ifindex)) in BPF_PROG() 213 idx_in = from_dev->ifindex; in BPF_PROG() 214 idx_out = to_dev->ifindex; in BPF_PROG() 245 idx_in = from_dev->ifindex; in BPF_PROG() 246 idx_out = to_dev->ifindex; in BPF_PROG()
|
A D | xdp1_user.c | 21 static int ifindex; variable 29 if (bpf_get_link_xdp_id(ifindex, &curr_prog_id, xdp_flags)) { in int_exit() 34 bpf_set_link_xdp_fd(ifindex, -1, xdp_flags); in int_exit() 119 ifindex = if_nametoindex(argv[optind]); in main() 120 if (!ifindex) { in main() 146 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main()
|
/linux/net/can/ |
A D | bcm.c | 103 int ifindex; member 127 int ifindex; member 178 if (!ifindex) in bcm_proc_getifname() 292 can_skb_prv(skb)->ifindex = dev->ifindex; in bcm_can_tx() 853 if (!ifindex) in bcm_tx_setup() 955 op->ifindex = ifindex; in bcm_tx_setup() 1127 op->ifindex = ifindex; in bcm_rx_setup() 1258 can_skb_prv(skb)->ifindex = dev->ifindex; in bcm_tx_send() 1410 if (bo->bound && bo->ifindex == dev->ifindex) { in bcm_notify() 1426 if (bo->bound && bo->ifindex == dev->ifindex) { in bcm_notify() [all …]
|
A D | raw.c | 85 int ifindex; member 278 if (ro->ifindex != dev->ifindex) in raw_notify() 291 ro->ifindex = 0; in raw_notify() 403 ro->ifindex = 0; in raw_release() 422 int ifindex; in raw_bind() local 452 ifindex = dev->ifindex; in raw_bind() 458 ifindex = 0; in raw_bind() 481 ro->ifindex = ifindex; in raw_bind() 777 int ifindex; in raw_sendmsg() local 791 ifindex = ro->ifindex; in raw_sendmsg() [all …]
|
/linux/net/ipv6/ |
A D | addrlabel.c | 35 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 161 int prefixlen, int ifindex, in ip6addrlbl_alloc() argument 195 newp->ifindex = ifindex; in ip6addrlbl_alloc() 215 p->ifindex == newp->ifindex && in __ip6addrlbl_add() 267 int ifindex) in __ip6addrlbl_del() argument 278 p->ifindex == ifindex && in __ip6addrlbl_del() 291 int ifindex) in ip6addrlbl_del() argument [all …]
|
/linux/tools/bpf/bpftool/ |
A D | net.c | 31 int ifindex; member 56 int ifindex; member 224 .t.tcm_ifindex = ifindex, in netlink_get_class() 263 .t.tcm_ifindex = ifindex, in netlink_get_qdisc() 302 .t.tcm_ifindex = ifindex, in netlink_get_filter() 447 filter_info.ifindex = dev->ifindex; in show_dev_tc_bpf() 522 int ifindex; in net_parse_dev() local 528 if (!ifindex) in net_parse_dev() 537 return ifindex; in net_parse_dev() 579 if (ifindex < 1) { in do_attach() [all …]
|
A D | feature.c | 483 const char *define_prefix, __u32 ifindex) in probe_prog_type() argument 490 if (ifindex) in probe_prog_type() 531 __u32 ifindex) in probe_map_type() argument 602 if (ifindex) in probe_helpers_for_progtype() 635 ifindex); in probe_helpers_for_progtype() 702 __u32 ifindex) in section_program_types() argument 759 ifindex); in section_helpers() 903 __u32 ifindex = 0; in do_probe() local 928 ifindex = if_nametoindex(ifname); in do_probe() 929 if (!ifindex) { in do_probe() [all …]
|
/linux/include/trace/events/ |
A D | xdp.h | 38 __field(int, ifindex) 44 __entry->ifindex = dev->ifindex; 50 __entry->ifindex) 61 __field(int, ifindex) 69 __entry->ifindex = dev->ifindex; 77 __entry->ifindex, 117 ifindex = ((struct _bpf_dtab_netdev *)tgt)->dev->ifindex; 119 ifindex = index; 125 __entry->ifindex = dev->ifindex; 369 __entry->ifindex = rxq->dev->ifindex; [all …]
|
A D | qdisc.h | 26 __field( int, ifindex ) 38 __entry->ifindex = txq->dev ? txq->dev->ifindex : 0; 45 __entry->ifindex, __entry->handle, __entry->parent, 59 __field(int, ifindex) 68 __entry->ifindex = txq->dev ? txq->dev->ifindex : 0; 74 __entry->ifindex, __entry->handle, __entry->parent, __entry->skbaddr)
|
/linux/tools/lib/bpf/ |
A D | libbpf_probes.c | 25 static int get_vendor_id(int ifindex) in get_vendor_id() argument 31 if (!if_indextoname(ifindex, ifname)) in get_vendor_id() 122 xattr.prog_ifindex = ifindex; in probe_load() 279 if (ifindex) in bpf_probe_map_type() 296 attr.map_ifindex = ifindex; in bpf_probe_map_type() 314 __u32 ifindex) in bpf_probe_helper() argument 324 ifindex); in bpf_probe_helper() 327 if (ifindex) { in bpf_probe_helper() 328 switch (get_vendor_id(ifindex)) { in bpf_probe_helper() 346 bool bpf_probe_large_insn_limit(__u32 ifindex) in bpf_probe_large_insn_limit() argument [all …]
|
A D | netlink.c | 31 int ifindex; member 196 req.ifinfo.ifi_index = ifindex; in __bpf_set_link_xdp_fd_replace() 268 if (xdp_id->ifindex && xdp_id->ifindex != ifinfo->ifi_index) in get_xdp_info() 328 xdp_id.ifindex = ifindex; in bpf_get_link_xdp_info() 460 OPTS_GET(hook, ifindex, 0) <= 0) in bpf_tc_hook_create() 569 ifindex = OPTS_GET(hook, ifindex, 0); in bpf_tc_attach() 595 req.tc.tcm_ifindex = ifindex; in bpf_tc_attach() 642 ifindex = OPTS_GET(hook, ifindex, 0); in __bpf_tc_detach() 670 req.tc.tcm_ifindex = ifindex; in __bpf_tc_detach() 714 ifindex = OPTS_GET(hook, ifindex, 0); in bpf_tc_query() [all …]
|
/linux/tools/testing/selftests/bpf/ |
A D | xdp_redirect_multi.c | 46 static int get_mac_addr(unsigned int ifindex, void *mac_addr) in get_mac_addr() argument 56 if (!if_indextoname(ifindex, ifname)) in get_mac_addr() 97 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_set_link_xdp_fd(ifindex, prog_fd, xdp_flags); in main() [all …]
|
/linux/drivers/net/ethernet/mellanox/mlx5/core/en/tc/ |
A D | int_port.c | 13 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() 151 int ifindex, in mlx5e_int_port_add() argument 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 416 int ifindex; in mlx5e_tc_int_port_dev_fwd() local 430 ifindex = int_port->ifindex; in mlx5e_tc_int_port_dev_fwd() 438 ifindex); in mlx5e_tc_int_port_dev_fwd() [all …]
|
/linux/tools/testing/selftests/net/ |
A D | nettest.c | 91 int ifindex; member 388 int ifindex = 0; in check_device() local 394 ifindex = get_ifidx(name); in check_device() 468 ifindex = htonl(ifindex); in set_unicast_if() 474 rc = setsockopt(sd, level, opt, &ifindex, sizeof(ifindex)); in set_unicast_if() 580 if (args->ifindex < 0) { in resolve_devices() 837 int ifindex = 0; in get_index_from_cmsg() local 861 if (ifindex) { in get_index_from_cmsg() 863 ifindex, buf); in get_index_from_cmsg() 865 return ifindex; in get_index_from_cmsg() [all …]
|
/linux/net/bridge/ |
A D | br_mdb.c | 239 int ifindex; in __mdb_fill_info() local 243 ifindex = p->key.port->dev->ifindex; in __mdb_fill_info() 247 ifindex = mp->br->dev->ifindex; in __mdb_fill_info() 252 e.ifindex = ifindex; in __mdb_fill_info() 440 bpm->ifindex = dev->ifindex; in br_mdb_dump() 478 bpm->ifindex = dev->ifindex; in nlmsg_populate_mdb_fill() 598 bpm->ifindex = dev->ifindex; in nlmsg_populate_rtr_fill() 640 int ifindex; in br_rtr_notify() local 643 ifindex = pmctx ? pmctx->port->dev->ifindex : 0; in br_rtr_notify() 1009 if (entry->ifindex != br->dev->ifindex) { in br_mdb_add() [all …]
|