13 #include <linux/kernel.h>
22 #define MESSAGE_AGE_INCR ((HZ / 256) + 1)
24 static const char *
const br_port_state_names[] = {
34 br_info(p->
br,
"port %u(%s) entered %s state\n",
36 br_port_state_names[p->
state]);
62 br_is_designated_port(p))
104 static void br_root_selection(
struct net_bridge *br)
110 if (br_should_become_root_port(p, root_port))
160 if (br_is_root_bridge(br))
196 static void br_record_config_timeout_values(
struct net_bridge *br,
212 static int br_should_become_designated_port(
const struct net_bridge_port *p)
218 if (br_is_designated_port(p))
242 static void br_designated_port_selection(
struct net_bridge *br)
248 br_should_become_designated_port(p))
287 static void br_topology_change_acknowledged(
struct net_bridge *br)
296 int isroot = br_is_root_bridge(br);
301 br_info(br,
"topology change detected, %s\n",
302 isroot ?
"propagating" :
"sending tcn bpdu");
323 br_is_designated_port(p))
337 br_root_selection(br);
338 br_designated_port_selection(br);
400 unsigned int liveports = 0;
411 br_make_forwarding(p);
412 }
else if (br_is_designated_port(p)) {
414 br_make_forwarding(p);
447 was_root = br_is_root_bridge(br);
449 if (br_supersedes_port_info(p, bpdu)) {
450 br_record_config_information(p, bpdu);
454 if (!br_is_root_bridge(br) && was_root) {
466 br_record_config_timeout_values(br, bpdu);
469 br_topology_change_acknowledged(br);
471 }
else if (br_is_designated_port(p)) {
479 if (br_is_designated_port(p)) {
480 br_info(p->
br,
"port %u(%s) received tcn bpdu\n",
484 br_topology_change_acknowledge(p);
496 spin_lock_bh(&br->
lock);
498 if (br_is_root_bridge(br))
500 spin_unlock_bh(&br->
lock);
511 spin_lock_bh(&br->
lock);
513 if (br_is_root_bridge(br))
515 spin_unlock_bh(&br->
lock);
528 spin_lock_bh(&br->
lock);
530 if (br_is_root_bridge(br))
532 spin_unlock_bh(&br->
lock);