Home
last modified time | relevance | path

Searched refs:br (Results 1 – 25 of 56) sorted by relevance

123

/net/bridge/
Dbr_stp.c46 if (br_opt_get(p->br, BROPT_MST_ENABLED)) { in br_set_state()
49 br_warn(p->br, "error setting MST state on port %u(%s)\n", in br_set_state()
54 br_warn(p->br, "error setting offload STP state on port %u(%s)\n", in br_set_state()
57 br_info(p->br, "port %u(%s) entered %s state\n", in br_set_state()
61 if (p->br->stp_enabled == BR_KERNEL_STP) { in br_set_state()
88 struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no) in br_get_port() argument
92 list_for_each_entry_rcu(p, &br->port_list, list, in br_get_port()
93 lockdep_is_held(&br->lock)) { in br_get_port()
105 struct net_bridge *br; in br_should_become_root_port() local
109 br = p->br; in br_should_become_root_port()
[all …]
Dbr_stp_if.c43 err = __set_ageing_time(p->dev, p->br->ageing_time); in br_init_port()
49 void br_stp_enable_bridge(struct net_bridge *br) in br_stp_enable_bridge() argument
53 spin_lock_bh(&br->lock); in br_stp_enable_bridge()
54 if (br->stp_enabled == BR_KERNEL_STP) in br_stp_enable_bridge()
55 mod_timer(&br->hello_timer, jiffies + br->hello_time); in br_stp_enable_bridge()
56 mod_delayed_work(system_long_wq, &br->gc_work, HZ / 10); in br_stp_enable_bridge()
58 br_config_bpdu_generation(br); in br_stp_enable_bridge()
60 list_for_each_entry(p, &br->port_list, list) { in br_stp_enable_bridge()
65 spin_unlock_bh(&br->lock); in br_stp_enable_bridge()
69 void br_stp_disable_bridge(struct net_bridge *br) in br_stp_disable_bridge() argument
[all …]
Dbr_stp_timer.c17 static int br_is_designated_for_some_port(const struct net_bridge *br) in br_is_designated_for_some_port() argument
21 list_for_each_entry(p, &br->port_list, list) { in br_is_designated_for_some_port()
23 !memcmp(&p->designated_bridge, &br->bridge_id, 8)) in br_is_designated_for_some_port()
32 struct net_bridge *br = from_timer(br, t, hello_timer); in br_hello_timer_expired() local
34 br_debug(br, "hello timer expired\n"); in br_hello_timer_expired()
35 spin_lock(&br->lock); in br_hello_timer_expired()
36 if (br->dev->flags & IFF_UP) { in br_hello_timer_expired()
37 br_config_bpdu_generation(br); in br_hello_timer_expired()
39 if (br->stp_enabled == BR_KERNEL_STP) in br_hello_timer_expired()
40 mod_timer(&br->hello_timer, in br_hello_timer_expired()
[all …]
Dbr_if.c76 struct net_bridge *br = p->br; in br_port_carrier_check() local
83 if (!netif_running(br->dev)) in br_port_carrier_check()
86 spin_lock_bh(&br->lock); in br_port_carrier_check()
98 spin_unlock_bh(&br->lock); in br_port_carrier_check()
112 br_fdb_unsync_static(p->br, p); in br_port_set_promisc()
131 err = br_fdb_sync_static(p->br, p); in br_port_clear_promisc()
144 void br_manage_promisc(struct net_bridge *br) in br_manage_promisc() argument
152 if ((br->dev->flags & IFF_PROMISC) || !br_vlan_enabled(br->dev)) in br_manage_promisc()
155 list_for_each_entry(p, &br->port_list, list) { in br_manage_promisc()
170 (br->auto_cnt == 0 || in br_manage_promisc()
[all …]
Dbr_device.c32 struct net_bridge *br = netdev_priv(dev); in br_dev_xmit() local
33 struct net_bridge_mcast *brmctx = &br->multicast_ctx; in br_dev_xmit()
66 if (!br_allowed_ingress(br, br_vlan_group_rcu(br), skb, &vid, in br_dev_xmit()
73 br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) { in br_dev_xmit()
74 br_do_proxy_suppress_arp(skb, br, vid, NULL); in br_dev_xmit()
77 br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) && in br_dev_xmit()
85 br_do_suppress_nd(skb, br, vid, NULL, msg); in br_dev_xmit()
90 br_flood(br, skb, BR_PKT_BROADCAST, false, true, vid); in br_dev_xmit()
93 br_flood(br, skb, BR_PKT_MULTICAST, false, true, vid); in br_dev_xmit()
106 br_flood(br, skb, BR_PKT_MULTICAST, false, true, vid); in br_dev_xmit()
[all …]
Dbr_sysfs_br.c33 int (*set)(struct net_bridge *br, unsigned long val, in store_bridge_parm() argument
36 struct net_bridge *br = to_bridge(d); in store_bridge_parm() local
41 if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN)) in store_bridge_parm()
51 err = (*set)(br, val, &extack); in store_bridge_parm()
53 netdev_state_change(br->dev); in store_bridge_parm()
56 br_err(br, "%s\n", extack._msg); in store_bridge_parm()
58 br_warn(br, "%s\n", extack._msg); in store_bridge_parm()
69 struct net_bridge *br = to_bridge(d); in forward_delay_show() local
70 return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); in forward_delay_show()
73 static int set_forward_delay(struct net_bridge *br, unsigned long val, in set_forward_delay() argument
[all …]
Dbr_fdb.c53 int br_fdb_hash_init(struct net_bridge *br) in br_fdb_hash_init() argument
55 return rhashtable_init(&br->fdb_hash_tbl, &br_fdb_rht_params); in br_fdb_hash_init()
58 void br_fdb_hash_fini(struct net_bridge *br) in br_fdb_hash_fini() argument
60 rhashtable_destroy(&br->fdb_hash_tbl); in br_fdb_hash_fini()
66 static inline unsigned long hold_time(const struct net_bridge *br) in hold_time() argument
68 return br->topology_change ? br->forward_delay : br->ageing_time; in hold_time()
71 static inline int has_expired(const struct net_bridge *br, in has_expired() argument
76 time_before_eq(fdb->updated + hold_time(br), jiffies); in has_expired()
86 static int fdb_to_nud(const struct net_bridge *br, in fdb_to_nud() argument
93 else if (has_expired(br, fdb)) in fdb_to_nud()
[all …]
Dbr_vlan.c68 vg = br_vlan_group(v->br); in __vlan_flags_update()
103 static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br, in __vlan_vid_add() argument
114 return vlan_vid_add(dev, br->vlan_proto, v->vid); in __vlan_vid_add()
126 vg = br_vlan_group(v->br); in __vlan_add_list()
144 static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br, in __vlan_vid_del() argument
154 vlan_vid_del(dev, br->vlan_proto, v->vid); in __vlan_vid_del()
162 br_vlan_get_master(struct net_bridge *br, u16 vid, in br_vlan_get_master() argument
168 vg = br_vlan_group(br); in br_vlan_get_master()
174 if (br_vlan_add(br, vid, 0, &changed, extack)) in br_vlan_get_master()
205 vg = br_vlan_group(masterv->br); in br_vlan_put_master()
[all …]
Dbr.c34 struct net_bridge *br; in br_device_event() local
59 br = p->br; in br_device_event()
63 br_mtu_auto_adjust(br); in br_device_event()
67 if (br->dev->addr_assign_type == NET_ADDR_SET) in br_device_event()
70 err = dev_pre_changeaddr_notify(br->dev, in br_device_event()
78 spin_lock_bh(&br->lock); in br_device_event()
80 changed_addr = br_stp_recalculate_bridge_id(br); in br_device_event()
81 spin_unlock_bh(&br->lock); in br_device_event()
84 call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); in br_device_event()
93 netdev_update_features(br->dev); in br_device_event()
[all …]
Dbr_private.h102 struct net_bridge *br; member
138 struct net_bridge *br; member
220 struct net_bridge *br; member
333 struct net_bridge *br; member
367 struct net_bridge *br; member
380 struct net_bridge *br; member
622 #define br_printk(level, br, format, args...) \ argument
623 printk(level "%s: " format, (br)->dev->name, ##args)
634 #define br_debug(br, format, args...) \ argument
635 pr_debug("%s: " format, (br)->dev->name, ##args)
[all …]
Dbr_mrp.c36 static struct net_bridge_port *br_mrp_get_port(struct net_bridge *br, in br_mrp_get_port() argument
42 list_for_each_entry(port, &br->port_list, list) { in br_mrp_get_port()
52 static struct br_mrp *br_mrp_find_id(struct net_bridge *br, u32 ring_id) in br_mrp_find_id() argument
57 hlist_for_each_entry_rcu(mrp, &br->mrp_list, list, in br_mrp_find_id()
68 static struct br_mrp *br_mrp_find_in_id(struct net_bridge *br, u32 in_id) in br_mrp_find_in_id() argument
73 hlist_for_each_entry_rcu(mrp, &br->mrp_list, list, in br_mrp_find_in_id()
84 static bool br_mrp_unique_ifindex(struct net_bridge *br, u32 ifindex) in br_mrp_unique_ifindex() argument
88 hlist_for_each_entry_rcu(mrp, &br->mrp_list, list, in br_mrp_unique_ifindex()
108 static struct br_mrp *br_mrp_find_port(struct net_bridge *br, in br_mrp_find_port() argument
114 hlist_for_each_entry_rcu(mrp, &br->mrp_list, list, in br_mrp_find_port()
[all …]
Dbr_ioctl.c39 static void get_port_ifindices(struct net_bridge *br, int *ifindices, int num) in get_port_ifindices() argument
43 list_for_each_entry(p, &br->port_list, list) { in get_port_ifindices()
56 static int get_fdb_entries(struct net_bridge *br, void __user *userbuf, in get_fdb_entries() argument
73 num = br_fdb_fillbuf(br, buf, maxnum, offset); in get_fdb_entries()
85 static int add_del_if(struct net_bridge *br, int ifindex, int isadd) in add_del_if() argument
87 struct net *net = dev_net(br->dev); in add_del_if()
99 ret = br_add_if(br, dev, NULL); in add_del_if()
101 ret = br_del_if(br, dev); in add_del_if()
147 struct net_bridge *br = netdev_priv(dev); in br_dev_siocdevprivate() local
160 return add_del_if(br, args[1], args[0] == BRCTL_ADD_IF); in br_dev_siocdevprivate()
[all …]
Dbr_netlink.c98 struct net_bridge *br = NULL; in br_get_link_af_size_filtered() local
110 br = netdev_priv(dev); in br_get_link_af_size_filtered()
111 vg = br_vlan_group_rcu(br); in br_get_link_af_size_filtered()
128 if (!br) in br_get_link_af_size_filtered()
132 br_cfm_mep_count(br, &num_cfm_mep_infos); in br_get_link_af_size_filtered()
133 br_cfm_peer_mep_count(br, &num_cfm_peer_mep_infos); in br_get_link_af_size_filtered()
461 struct net_bridge *br; in br_fill_ifinfo() local
466 br = port->br; in br_fill_ifinfo()
468 br = netdev_priv(dev); in br_fill_ifinfo()
470 br_debug(br, "br_fill_info event %d port %s master %s\n", in br_fill_ifinfo()
[all …]
Dbr_multicast.c82 static void br_multicast_find_del_pg(struct net_bridge *br,
90 br_sg_port_find(struct net_bridge *br, in br_sg_port_find() argument
93 lockdep_assert_held_once(&br->multicast_lock); in br_sg_port_find()
95 return rhashtable_lookup_fast(&br->sg_port_tbl, sg_p, in br_sg_port_find()
99 static struct net_bridge_mdb_entry *br_mdb_ip_get_rcu(struct net_bridge *br, in br_mdb_ip_get_rcu() argument
102 return rhashtable_lookup(&br->mdb_hash_tbl, dst, br_mdb_rht_params); in br_mdb_ip_get_rcu()
105 struct net_bridge_mdb_entry *br_mdb_ip_get(struct net_bridge *br, in br_mdb_ip_get() argument
110 lockdep_assert_held_once(&br->multicast_lock); in br_mdb_ip_get()
113 ent = rhashtable_lookup(&br->mdb_hash_tbl, dst, br_mdb_rht_params); in br_mdb_ip_get()
119 static struct net_bridge_mdb_entry *br_mdb_ip4_get(struct net_bridge *br, in br_mdb_ip4_get() argument
[all …]
Dbr_mrp_switchdev.c8 br_mrp_switchdev_port_obj(struct net_bridge *br, in br_mrp_switchdev_port_obj() argument
14 err = switchdev_port_obj_add(br->dev, obj, NULL); in br_mrp_switchdev_port_obj()
16 err = switchdev_port_obj_del(br->dev, obj); in br_mrp_switchdev_port_obj()
31 int br_mrp_switchdev_add(struct net_bridge *br, struct br_mrp *mrp) in br_mrp_switchdev_add() argument
34 .obj.orig_dev = br->dev, in br_mrp_switchdev_add()
45 return switchdev_port_obj_add(br->dev, &mrp_obj.obj, NULL); in br_mrp_switchdev_add()
48 int br_mrp_switchdev_del(struct net_bridge *br, struct br_mrp *mrp) in br_mrp_switchdev_del() argument
51 .obj.orig_dev = br->dev, in br_mrp_switchdev_del()
61 return switchdev_port_obj_del(br->dev, &mrp_obj.obj); in br_mrp_switchdev_del()
65 br_mrp_switchdev_set_ring_role(struct net_bridge *br, struct br_mrp *mrp, in br_mrp_switchdev_set_ring_role() argument
[all …]
Dbr_input.c36 struct net_bridge *br = netdev_priv(brdev); in br_pass_frame_up() local
41 vg = br_vlan_group_rcu(br); in br_pass_frame_up()
61 skb = br_handle_vlan(br, NULL, vg, skb); in br_pass_frame_up()
65 br_multicast_count(br, NULL, skb, br_multicast_igmp_type(skb), in br_pass_frame_up()
86 struct net_bridge *br; in br_handle_frame_finish() local
94 br = p->br; in br_handle_frame_finish()
96 if (br_mst_is_enabled(br)) { in br_handle_frame_finish()
105 brmctx = &p->br->multicast_ctx; in br_handle_frame_finish()
107 if (!br_allowed_ingress(p->br, nbp_vlan_group_rcu(p), skb, &vid, in br_handle_frame_finish()
113 br_fdb_find_rcu(br, eth_hdr(skb)->h_source, vid); in br_handle_frame_finish()
[all …]
Dbr_cfm.c7 static struct br_cfm_mep *br_mep_find(struct net_bridge *br, u32 instance) in br_mep_find() argument
11 hlist_for_each_entry(mep, &br->mep_list, head) in br_mep_find()
18 static struct br_cfm_mep *br_mep_find_ifindex(struct net_bridge *br, in br_mep_find_ifindex() argument
23 hlist_for_each_entry_rcu(mep, &br->mep_list, head, in br_mep_find_ifindex()
44 static struct net_bridge_port *br_mep_get_port(struct net_bridge *br, in br_mep_get_port() argument
49 list_for_each_entry(port, &br->port_list, list) in br_mep_get_port()
145 br_info_notify(event, port->br, NULL, filter); in br_cfm_notify()
379 struct net_bridge *br; in br_cfm_frame_rx() local
392 br = port->br; in br_cfm_frame_rx()
393 mep = br_mep_find_ifindex(br, port->dev->ifindex); in br_cfm_frame_rx()
[all …]
Dbr_private_mrp.h66 int br_mrp_add(struct net_bridge *br, struct br_mrp_instance *instance);
67 int br_mrp_del(struct net_bridge *br, struct br_mrp_instance *instance);
72 int br_mrp_set_ring_state(struct net_bridge *br,
74 int br_mrp_set_ring_role(struct net_bridge *br, struct br_mrp_ring_role *role);
75 int br_mrp_start_test(struct net_bridge *br, struct br_mrp_start_test *test);
76 int br_mrp_set_in_state(struct net_bridge *br, struct br_mrp_in_state *state);
77 int br_mrp_set_in_role(struct net_bridge *br, struct br_mrp_in_role *role);
78 int br_mrp_start_in_test(struct net_bridge *br,
82 int br_mrp_switchdev_add(struct net_bridge *br, struct br_mrp *mrp);
83 int br_mrp_switchdev_del(struct net_bridge *br, struct br_mrp *mrp);
[all …]
Dbr_switchdev.c125 static void br_switchdev_fdb_populate(struct net_bridge *br, in br_switchdev_fdb_populate() argument
138 item->info.dev = (!p || item->is_local) ? br->dev : p->dev; in br_switchdev_fdb_populate()
143 br_switchdev_fdb_notify(struct net_bridge *br, in br_switchdev_fdb_notify() argument
162 br_switchdev_fdb_populate(br, &item, fdb, NULL); in br_switchdev_fdb_notify()
203 struct net_bridge *br = joining->br; in nbp_switchdev_hwdom_set() local
208 list_for_each_entry(p, &br->port_list, list) { in nbp_switchdev_hwdom_set()
215 hwdom = find_next_zero_bit(&br->busy_hwdoms, BR_HWDOM_MAX, 1); in nbp_switchdev_hwdom_set()
219 set_bit(hwdom, &br->busy_hwdoms); in nbp_switchdev_hwdom_set()
226 struct net_bridge *br = leaving->br; in nbp_switchdev_hwdom_put() local
230 list_for_each_entry(p, &br->port_list, list) { in nbp_switchdev_hwdom_put()
[all …]
Dbr_cfm_netlink.c90 static int br_mep_create_parse(struct net_bridge *br, struct nlattr *attr, in br_mep_create_parse() argument
127 return br_cfm_mep_create(br, instance, &create, extack); in br_mep_create_parse()
130 static int br_mep_delete_parse(struct net_bridge *br, struct nlattr *attr, in br_mep_delete_parse() argument
150 return br_cfm_mep_delete(br, instance, extack); in br_mep_delete_parse()
153 static int br_mep_config_parse(struct net_bridge *br, struct nlattr *attr, in br_mep_config_parse() argument
192 return br_cfm_mep_config_set(br, instance, &config, extack); in br_mep_config_parse()
195 static int br_cc_config_parse(struct net_bridge *br, struct nlattr *attr, in br_cc_config_parse() argument
233 return br_cfm_cc_config_set(br, instance, &config, extack); in br_cc_config_parse()
236 static int br_cc_peer_mep_add_parse(struct net_bridge *br, struct nlattr *attr, in br_cc_peer_mep_add_parse() argument
260 return br_cfm_cc_peer_mep_add(br, instance, peer_mep_id, extack); in br_cc_peer_mep_add_parse()
[all …]
Dbr_mrp_netlink.c31 static int br_mrp_instance_parse(struct net_bridge *br, struct nlattr *attr, in br_mrp_instance_parse() argument
62 return br_mrp_add(br, &inst); in br_mrp_instance_parse()
64 return br_mrp_del(br, &inst); in br_mrp_instance_parse()
134 static int br_mrp_ring_state_parse(struct net_bridge *br, struct nlattr *attr, in br_mrp_ring_state_parse() argument
158 return br_mrp_set_ring_state(br, &state); in br_mrp_ring_state_parse()
168 static int br_mrp_ring_role_parse(struct net_bridge *br, struct nlattr *attr, in br_mrp_ring_role_parse() argument
192 return br_mrp_set_ring_role(br, &role); in br_mrp_ring_role_parse()
205 static int br_mrp_start_test_parse(struct net_bridge *br, struct nlattr *attr, in br_mrp_start_test_parse() argument
238 return br_mrp_start_test(br, &test); in br_mrp_start_test_parse()
248 static int br_mrp_in_state_parse(struct net_bridge *br, struct nlattr *attr, in br_mrp_in_state_parse() argument
[all …]
Dbr_arp_nd_proxy.c27 void br_recalculate_neigh_suppress_enabled(struct net_bridge *br) in br_recalculate_neigh_suppress_enabled() argument
32 list_for_each_entry(p, &br->port_list, list) { in br_recalculate_neigh_suppress_enabled()
39 br_opt_toggle(br, BROPT_NEIGH_SUPPRESS_ENABLED, neigh_suppress); in br_recalculate_neigh_suppress_enabled()
43 static void br_arp_send(struct net_bridge *br, struct net_bridge_port *p, in br_arp_send() argument
71 vg = br_vlan_group_rcu(br); in br_arp_send()
125 void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br, in br_do_proxy_suppress_arp() argument
128 struct net_device *dev = br->dev; in br_do_proxy_suppress_arp()
160 if (br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) { in br_do_proxy_suppress_arp()
176 vlandev = __vlan_find_dev_deep_rcu(br->dev, skb->vlan_proto, in br_do_proxy_suppress_arp()
182 if (br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) && in br_do_proxy_suppress_arp()
[all …]
Dbr_mdb.c86 list_for_each_entry_rcu(p, &brmctx->br->port_list, list) { in br_rports_fill_info()
188 lockdep_is_held(&p->key.port->br->multicast_lock)) { in __mdb_fill_srcs()
247 ifindex = mp->br->dev->ifindex; in __mdb_fill_info()
278 dump_srcs_mode = !!(mp->br->multicast_ctx.multicast_igmp_version == 3); in __mdb_fill_info()
288 dump_srcs_mode = !!(mp->br->multicast_ctx.multicast_mld_version == 2); in __mdb_fill_info()
322 struct net_bridge *br = netdev_priv(dev); in br_mdb_fill_info() local
326 if (!br_opt_get(br, BROPT_MULTICAST_ENABLED)) in br_mdb_fill_info()
333 hlist_for_each_entry_rcu(mp, &br->mdb_list, mdb_node) { in br_mdb_fill_info()
386 struct net_bridge *br = netdev_priv(dev); in br_mdb_dump() local
406 err = br_rports_fill_info(skb, &br->multicast_ctx); in br_mdb_dump()
[all …]
Dbr_vlan_options.c95 struct net_bridge *br; in br_vlan_modify_state() local
105 br = v->br; in br_vlan_modify_state()
107 br = v->port->br; in br_vlan_modify_state()
109 if (br->stp_enabled == BR_KERNEL_STP) { in br_vlan_modify_state()
114 if (br_opt_get(br, BROPT_MST_ENABLED)) { in br_vlan_modify_state()
193 static int br_vlan_process_one_opts(const struct net_bridge *br, in br_vlan_process_one_opts() argument
263 int br_vlan_process_options(const struct net_bridge *br, in br_vlan_process_options() argument
278 vg = br_vlan_group(br); in br_vlan_process_options()
300 err = br_vlan_process_one_opts(br, p, vg, v, tb, &changed, in br_vlan_process_options()
315 br_vlan_notify(br, p, curr_start->vid, in br_vlan_process_options()
[all …]
Dbr_mst.c29 const struct net_bridge *br; in br_mst_get_info() local
36 br = netdev_priv(dev); in br_mst_get_info()
37 if (!br_opt_get(br, BROPT_MST_ENABLED)) in br_mst_get_info()
40 vg = br_vlan_group(br); in br_mst_get_info()
60 if (!p || !br_opt_get(p->br, BROPT_MST_ENABLED)) in br_mst_get_state()
155 .orig_dev = mv->br->dev, in br_mst_vlan_set_msti()
169 err = switchdev_port_attr_set(mv->br->dev, &attr, NULL); in br_mst_vlan_set_msti()
175 list_for_each_entry(p, &mv->br->port_list, list) { in br_mst_vlan_set_msti()
197 int br_mst_set_enabled(struct net_bridge *br, bool on, in br_mst_set_enabled() argument
202 .orig_dev = br->dev, in br_mst_set_enabled()
[all …]

123