Home
last modified time | relevance | path

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

12

/net/bridge/
Dbr_stp.c34 br_info(p->br, "port %u(%s) entered %s state\n", in br_log_state()
40 struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no) in br_get_port() argument
44 list_for_each_entry_rcu(p, &br->port_list, list) { in br_get_port()
56 struct net_bridge *br; in br_should_become_root_port() local
60 br = p->br; in br_should_become_root_port()
65 if (memcmp(&br->bridge_id, &p->designated_root, 8) <= 0) in br_should_become_root_port()
71 rp = br_get_port(br, root_port); in br_should_become_root_port()
103 static void br_root_port_block(const struct net_bridge *br, in br_root_port_block() argument
107 br_notice(br, "port %u(%s) tried to become root port (blocked)", in br_root_port_block()
114 if (br->forward_delay > 0) in br_root_port_block()
[all …]
Dbr_stp_timer.c21 static int br_is_designated_for_some_port(const struct net_bridge *br) in br_is_designated_for_some_port() argument
25 list_for_each_entry(p, &br->port_list, list) { in br_is_designated_for_some_port()
27 !memcmp(&p->designated_bridge, &br->bridge_id, 8)) in br_is_designated_for_some_port()
36 struct net_bridge *br = (struct net_bridge *)arg; in br_hello_timer_expired() local
38 br_debug(br, "hello timer expired\n"); in br_hello_timer_expired()
39 spin_lock(&br->lock); in br_hello_timer_expired()
40 if (br->dev->flags & IFF_UP) { in br_hello_timer_expired()
41 br_config_bpdu_generation(br); in br_hello_timer_expired()
43 mod_timer(&br->hello_timer, round_jiffies(jiffies + br->hello_time)); in br_hello_timer_expired()
45 spin_unlock(&br->lock); in br_hello_timer_expired()
[all …]
Dbr_stp_if.c46 void br_stp_enable_bridge(struct net_bridge *br) in br_stp_enable_bridge() argument
50 spin_lock_bh(&br->lock); in br_stp_enable_bridge()
51 mod_timer(&br->hello_timer, jiffies + br->hello_time); in br_stp_enable_bridge()
52 mod_timer(&br->gc_timer, jiffies + HZ/10); in br_stp_enable_bridge()
54 br_config_bpdu_generation(br); in br_stp_enable_bridge()
56 list_for_each_entry(p, &br->port_list, list) { in br_stp_enable_bridge()
61 spin_unlock_bh(&br->lock); in br_stp_enable_bridge()
65 void br_stp_disable_bridge(struct net_bridge *br) in br_stp_disable_bridge() argument
69 spin_lock_bh(&br->lock); in br_stp_disable_bridge()
70 list_for_each_entry(p, &br->port_list, list) { in br_stp_disable_bridge()
[all …]
Dbr_multicast.c35 static void br_multicast_start_querier(struct net_bridge *br);
134 struct net_bridge_mdb_entry *br_mdb_get(struct net_bridge *br, in br_mdb_get() argument
137 struct net_bridge_mdb_htable *mdb = rcu_dereference(br->mdb); in br_mdb_get()
140 if (br->multicast_disabled) in br_mdb_get()
224 struct net_bridge *br = mp->br; in br_multicast_group_expired() local
227 spin_lock(&br->multicast_lock); in br_multicast_group_expired()
228 if (!netif_running(br->dev) || timer_pending(&mp->timer)) in br_multicast_group_expired()
236 mdb = mlock_dereference(br->mdb, br); in br_multicast_group_expired()
244 spin_unlock(&br->multicast_lock); in br_multicast_group_expired()
247 static void br_multicast_del_pg(struct net_bridge *br, in br_multicast_del_pg() argument
[all …]
Dbr_device.c28 struct net_bridge *br = netdev_priv(dev); in br_dev_xmit() local
32 struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats); in br_dev_xmit()
44 if (!br_allowed_ingress(br, br_get_vlan_info(br), skb, &vid)) in br_dev_xmit()
59 br_flood_deliver(br, skb); in br_dev_xmit()
62 br_flood_deliver(br, skb); in br_dev_xmit()
65 if (br_multicast_rcv(br, NULL, skb)) { in br_dev_xmit()
70 mdst = br_mdb_get(br, skb, vid); in br_dev_xmit()
74 br_flood_deliver(br, skb); in br_dev_xmit()
75 } else if ((dst = __br_fdb_get(br, dest, vid)) != NULL) in br_dev_xmit()
78 br_flood_deliver(br, skb); in br_dev_xmit()
[all …]
Dbr_sysfs_br.c35 struct net_bridge *br = to_bridge(d); in store_bridge_parm() local
40 if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN)) in store_bridge_parm()
47 err = (*set)(br, val); in store_bridge_parm()
55 struct net_bridge *br = to_bridge(d); in show_forward_delay() local
56 return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); in show_forward_delay()
101 struct net_bridge *br = to_bridge(d); in show_ageing_time() local
102 return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); in show_ageing_time()
105 static int set_ageing_time(struct net_bridge *br, unsigned long val) in set_ageing_time() argument
107 br->ageing_time = clock_t_to_jiffies(val); in set_ageing_time()
123 struct net_bridge *br = to_bridge(d); in show_stp_state() local
[all …]
Dbr_if.c68 struct net_bridge *br = p->br; in br_port_carrier_check() local
74 if (!netif_running(br->dev)) in br_port_carrier_check()
77 spin_lock_bh(&br->lock); in br_port_carrier_check()
85 spin_unlock_bh(&br->lock); in br_port_carrier_check()
106 p->br = NULL; in destroy_nbp()
131 struct net_bridge *br = p->br; in del_nbp() local
134 sysfs_remove_link(br->ifobj, p->dev->name); in del_nbp()
138 spin_lock_bh(&br->lock); in del_nbp()
140 spin_unlock_bh(&br->lock); in del_nbp()
145 br_fdb_delete_by_port(br, p, 1); in del_nbp()
[all …]
Dbr_fdb.c30 static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
32 static void fdb_notify(struct net_bridge *br,
59 static inline unsigned long hold_time(const struct net_bridge *br) in hold_time() argument
61 return br->topology_change ? br->forward_delay : br->ageing_time; in hold_time()
64 static inline int has_expired(const struct net_bridge *br, in has_expired() argument
68 time_before_eq(fdb->updated + hold_time(br), jiffies); in has_expired()
85 static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f) in fdb_delete() argument
88 fdb_notify(br, f, RTM_DELNEIGH); in fdb_delete()
94 struct net_bridge *br = p->br; in br_fdb_changeaddr() local
98 spin_lock_bh(&br->hash_lock); in br_fdb_changeaddr()
[all …]
Dbr_private.h74 struct net_bridge *br; member
109 struct net_bridge *br; member
130 struct net_bridge *br; member
303 #define br_printk(level, br, format, args...) \ argument
304 printk(level "%s: " format, (br)->dev->name, ##args)
315 #define br_debug(br, format, args...) \ argument
316 pr_debug("%s: " format, (br)->dev->name, ##args)
321 static inline int br_is_root_bridge(const struct net_bridge *br) in br_is_root_bridge() argument
323 return !memcmp(&br->bridge_id, &br->designated_root, 8); in br_is_root_bridge()
332 static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br) in br_netpoll_info() argument
[all …]
Dbr_ioctl.c41 static void get_port_ifindices(struct net_bridge *br, int *ifindices, int num) in get_port_ifindices() argument
45 list_for_each_entry(p, &br->port_list, list) { in get_port_ifindices()
58 static int get_fdb_entries(struct net_bridge *br, void __user *userbuf, in get_fdb_entries() argument
75 num = br_fdb_fillbuf(br, buf, maxnum, offset); in get_fdb_entries()
86 static int add_del_if(struct net_bridge *br, int ifindex, int isadd) in add_del_if() argument
88 struct net *net = dev_net(br->dev); in add_del_if()
100 ret = br_add_if(br, dev); in add_del_if()
102 ret = br_del_if(br, dev); in add_del_if()
114 struct net_bridge *br = netdev_priv(dev); in old_dev_ioctl() local
123 return add_del_if(br, args[1], args[0] == BRCTL_ADD_IF); in old_dev_ioctl()
[all …]
Dbr_vlan.c39 struct net_bridge *br; in __vlan_add() local
51 br = p->br; in __vlan_add()
54 br = v->parent.br; in __vlan_add()
55 dev = br->dev; in __vlan_add()
72 err = br_fdb_insert(br, p, dev->dev_addr, vid); in __vlan_add()
74 br_err(br, "failed insert local address into bridge " in __vlan_add()
115 rcu_assign_pointer(v->parent.br->vlan_info, NULL); in __vlan_del()
129 rcu_assign_pointer(v->parent.br->vlan_info, NULL); in __vlan_flush()
149 struct sk_buff *br_handle_vlan(struct net_bridge *br, in br_handle_vlan() argument
155 if (!br->vlan_enabled) in br_handle_vlan()
[all …]
Dbr_notify.c36 struct net_bridge *br; in br_device_event() local
51 br = p->br; in br_device_event()
55 dev_set_mtu(br->dev, br_min_mtu(br)); in br_device_event()
59 spin_lock_bh(&br->lock); in br_device_event()
61 changed_addr = br_stp_recalculate_bridge_id(br); in br_device_event()
62 spin_unlock_bh(&br->lock); in br_device_event()
65 call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev); in br_device_event()
74 netdev_update_features(br->dev); in br_device_event()
78 spin_lock_bh(&br->lock); in br_device_event()
79 if (br->dev->flags & IFF_UP) in br_device_event()
[all …]
Dbr_input.c30 struct net_bridge *br = netdev_priv(brdev); in br_pass_frame_up() local
31 struct br_cpu_netstats *brstats = this_cpu_ptr(br->stats); in br_pass_frame_up()
43 !br_allowed_egress(br, br_get_vlan_info(br), skb)) { in br_pass_frame_up()
48 skb = br_handle_vlan(br, br_get_vlan_info(br), skb); in br_pass_frame_up()
64 struct net_bridge *br; in br_handle_frame_finish() local
73 if (!br_allowed_ingress(p->br, nbp_get_vlan_info(p), skb, &vid)) in br_handle_frame_finish()
77 br = p->br; in br_handle_frame_finish()
78 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid); in br_handle_frame_finish()
81 br_multicast_rcv(br, p, skb)) in br_handle_frame_finish()
87 BR_INPUT_SKB_CB(skb)->brdev = br->dev; in br_handle_frame_finish()
[all …]
Dbr_mdb.c19 struct net_bridge *br = netdev_priv(dev); in br_rports_fill_info() local
23 if (!br->multicast_router || hlist_empty(&br->router_list)) in br_rports_fill_info()
30 hlist_for_each_entry_rcu(p, &br->router_list, rlist) { in br_rports_fill_info()
45 struct net_bridge *br = netdev_priv(dev); in br_mdb_fill_info() local
51 if (br->multicast_disabled) in br_mdb_fill_info()
54 mdb = rcu_dereference(br->mdb); in br_mdb_fill_info()
316 static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, in br_mdb_add_group() argument
325 mdb = mlock_dereference(br->mdb, br); in br_mdb_add_group()
328 mp = br_multicast_new_group(br, port, group); in br_mdb_add_group()
335 (p = mlock_dereference(*pp, br)) != NULL; in br_mdb_add_group()
[all …]
Dbr_stp_bpdu.c53 llc_mac_hdr_init(skb, p->dev->dev_addr, p->br->group_addr); in br_send_bpdu()
80 if (p->br->stp_enabled != BR_KERNEL_STP) in br_send_config_bpdu()
125 if (p->br->stp_enabled != BR_KERNEL_STP) in br_send_tcn_bpdu()
145 struct net_bridge *br; in br_stp_rcv() local
160 br = p->br; in br_stp_rcv()
161 spin_lock(&br->lock); in br_stp_rcv()
163 if (br->stp_enabled != BR_KERNEL_STP) in br_stp_rcv()
166 if (!(br->dev->flags & IFF_UP)) in br_stp_rcv()
172 if (!ether_addr_equal(dest, br->group_addr)) in br_stp_rcv()
176 br_notice(br, "BPDU received on blocked port %u(%s)\n", in br_stp_rcv()
[all …]
Dbr_netlink.c74 const struct net_bridge *br; in br_fill_ifinfo() local
80 br = port->br; in br_fill_ifinfo()
82 br = netdev_priv(dev); in br_fill_ifinfo()
84 br_debug(br, "br_fill_info event %d port %s master %s\n", in br_fill_ifinfo()
85 event, dev->name, br->dev->name); in br_fill_ifinfo()
100 nla_put_u32(skb, IFLA_MASTER, br->dev->ifindex) || in br_fill_ifinfo()
129 pv = br_get_vlan_info(br); in br_fill_ifinfo()
177 br_debug(port->br, "port %u(%s) event %d\n", in br_ifinfo_notify()
225 static int br_afspec(struct net_bridge *br, in br_afspec() argument
253 err = br_vlan_add(p->br, vinfo->vid, in br_afspec()
[all …]
Dbr_forward.c34 br_allowed_egress(p->br, nbp_get_vlan_info(p), skb) && in should_deliver()
67 skb = br_handle_vlan(to->br, nbp_get_vlan_info(to), skb); in __br_deliver()
73 if (unlikely(netpoll_tx_running(to->br->dev))) { in __br_deliver()
96 skb = br_handle_vlan(to->br, nbp_get_vlan_info(to), skb); in __br_forward()
174 static void br_flood(struct net_bridge *br, struct sk_buff *skb, in br_flood() argument
184 list_for_each_entry_rcu(p, &br->port_list, list) { in br_flood()
206 void br_flood_deliver(struct net_bridge *br, struct sk_buff *skb) in br_flood_deliver() argument
208 br_flood(br, skb, NULL, __br_deliver); in br_flood_deliver()
212 void br_flood_forward(struct net_bridge *br, struct sk_buff *skb, in br_flood_forward() argument
215 br_flood(br, skb, skb2, __br_forward); in br_flood_forward()
[all …]
Dbr_sysfs_if.c153 br_fdb_delete_by_port(p->br, p, 0); // Don't delete local entry in store_flush()
234 if (p->dev && p->br && brport_attr->store) { in brport_store()
235 spin_lock_bh(&p->br->lock); in brport_store()
237 spin_unlock_bh(&p->br->lock); in brport_store()
258 struct net_bridge *br = p->br; in br_sysfs_addif() local
262 err = sysfs_create_link(&p->kobj, &br->dev->dev.kobj, in br_sysfs_addif()
274 return sysfs_create_link(br->ifobj, &p->kobj, p->sysfs_name); in br_sysfs_addif()
280 struct net_bridge *br = p->br; in br_sysfs_renameif() local
289 err = sysfs_rename_link(br->ifobj, &p->kobj, in br_sysfs_renameif()
292 netdev_notice(br->dev, "unable to rename link %s to %s", in br_sysfs_renameif()
Dbr_private_stp.h48 return !memcmp(&p->designated_bridge, &p->br->bridge_id, 8) && in br_is_designated_port()
54 extern void br_become_root_bridge(struct net_bridge *br);
62 extern void br_transmit_tcn(struct net_bridge *br);
63 extern void br_topology_change_detection(struct net_bridge *br);
Dbr_netfilter.c162 void br_netfilter_rtable_init(struct net_bridge *br) in br_netfilter_rtable_init() argument
164 struct rtable *rt = &br->fake_rtable; in br_netfilter_rtable_init()
167 rt->dst.dev = br->dev; in br_netfilter_rtable_init()
179 return port ? &port->br->fake_rtable : NULL; in bridge_parent_rtable()
187 return port ? port->br->dev : NULL; in bridge_parent()
532 struct net_device *vlan, *br; in brnf_get_logical_dev() local
534 br = bridge_parent(dev); in brnf_get_logical_dev()
536 return br; in brnf_get_logical_dev()
538 vlan = __vlan_find_dev_deep(br, skb->vlan_proto, in brnf_get_logical_dev()
541 return vlan ? vlan : br; in brnf_get_logical_dev()
[all …]
DMakefile7 bridge-y := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
/net/bridge/netfilter/
Debt_redirect.c29 br_port_get_rcu(par->in)->br->dev->dev_addr, ETH_ALEN); in ebt_redirect_tg()
Debt_ulog.c204 strcpy(pm->indev, br_port_get_rcu(in)->br->dev->name); in ebt_ulog_packet()
214 strcpy(pm->outdev, br_port_get_rcu(out)->br->dev->name); in ebt_ulog_packet()
/net/netfilter/
Dnfnetlink_log.c447 htonl(br_port_get_rcu(indev)->br->dev->ifindex))) in __build_packet_message()
478 htonl(br_port_get_rcu(outdev)->br->dev->ifindex))) in __build_packet_message()
Dnfnetlink_queue_core.c394 htonl(br_port_get_rcu(indev)->br->dev->ifindex))) in nfqnl_build_packet_message()
424 htonl(br_port_get_rcu(outdev)->br->dev->ifindex))) in nfqnl_build_packet_message()

12