Commit 7c25b16d authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: bridge: log port STP state on change

Remove the shared br_log_state function and print the info directly in
br_set_state, where the net_bridge_port state is actually changed.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37a6351a
...@@ -598,7 +598,6 @@ static int br_set_port_state(struct net_bridge_port *p, u8 state) ...@@ -598,7 +598,6 @@ static int br_set_port_state(struct net_bridge_port *p, u8 state)
return -ENETDOWN; return -ENETDOWN;
br_set_state(p, state); br_set_state(p, state);
br_log_state(p);
br_port_state_selection(p->br); br_port_state_selection(p->br);
return 0; return 0;
} }
......
...@@ -900,7 +900,6 @@ static inline void br_nf_core_fini(void) {} ...@@ -900,7 +900,6 @@ static inline void br_nf_core_fini(void) {}
#endif #endif
/* br_stp.c */ /* br_stp.c */
void br_log_state(const struct net_bridge_port *p);
void br_set_state(struct net_bridge_port *p, unsigned int state); void br_set_state(struct net_bridge_port *p, unsigned int state);
struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no); struct net_bridge_port *br_get_port(struct net_bridge *br, u16 port_no);
void br_init_port(struct net_bridge_port *p); void br_init_port(struct net_bridge_port *p);
......
...@@ -30,13 +30,6 @@ static const char *const br_port_state_names[] = { ...@@ -30,13 +30,6 @@ static const char *const br_port_state_names[] = {
[BR_STATE_BLOCKING] = "blocking", [BR_STATE_BLOCKING] = "blocking",
}; };
void br_log_state(const struct net_bridge_port *p)
{
br_info(p->br, "port %u(%s) entered %s state\n",
(unsigned int) p->port_no, p->dev->name,
br_port_state_names[p->state]);
}
void br_set_state(struct net_bridge_port *p, unsigned int state) void br_set_state(struct net_bridge_port *p, unsigned int state)
{ {
struct switchdev_attr attr = { struct switchdev_attr attr = {
...@@ -52,6 +45,10 @@ void br_set_state(struct net_bridge_port *p, unsigned int state) ...@@ -52,6 +45,10 @@ void br_set_state(struct net_bridge_port *p, unsigned int state)
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
br_warn(p->br, "error setting offload STP state on port %u(%s)\n", br_warn(p->br, "error setting offload STP state on port %u(%s)\n",
(unsigned int) p->port_no, p->dev->name); (unsigned int) p->port_no, p->dev->name);
else
br_info(p->br, "port %u(%s) entered %s state\n",
(unsigned int) p->port_no, p->dev->name,
br_port_state_names[p->state]);
} }
/* called under bridge lock */ /* called under bridge lock */
...@@ -126,7 +123,6 @@ static void br_root_port_block(const struct net_bridge *br, ...@@ -126,7 +123,6 @@ static void br_root_port_block(const struct net_bridge *br,
(unsigned int) p->port_no, p->dev->name); (unsigned int) p->port_no, p->dev->name);
br_set_state(p, BR_STATE_LISTENING); br_set_state(p, BR_STATE_LISTENING);
br_log_state(p);
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
if (br->forward_delay > 0) if (br->forward_delay > 0)
...@@ -407,7 +403,6 @@ static void br_make_blocking(struct net_bridge_port *p) ...@@ -407,7 +403,6 @@ static void br_make_blocking(struct net_bridge_port *p)
br_topology_change_detection(p->br); br_topology_change_detection(p->br);
br_set_state(p, BR_STATE_BLOCKING); br_set_state(p, BR_STATE_BLOCKING);
br_log_state(p);
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
del_timer(&p->forward_delay_timer); del_timer(&p->forward_delay_timer);
...@@ -431,7 +426,6 @@ static void br_make_forwarding(struct net_bridge_port *p) ...@@ -431,7 +426,6 @@ static void br_make_forwarding(struct net_bridge_port *p)
else else
br_set_state(p, BR_STATE_LEARNING); br_set_state(p, BR_STATE_LEARNING);
br_log_state(p);
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
if (br->forward_delay != 0) if (br->forward_delay != 0)
......
...@@ -102,7 +102,6 @@ void br_stp_enable_port(struct net_bridge_port *p) ...@@ -102,7 +102,6 @@ void br_stp_enable_port(struct net_bridge_port *p)
{ {
br_init_port(p); br_init_port(p);
br_port_state_selection(p->br); br_port_state_selection(p->br);
br_log_state(p);
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
} }
...@@ -118,7 +117,6 @@ void br_stp_disable_port(struct net_bridge_port *p) ...@@ -118,7 +117,6 @@ void br_stp_disable_port(struct net_bridge_port *p)
p->topology_change_ack = 0; p->topology_change_ack = 0;
p->config_pending = 0; p->config_pending = 0;
br_log_state(p);
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
del_timer(&p->message_age_timer); del_timer(&p->message_age_timer);
......
...@@ -98,7 +98,6 @@ static void br_forward_delay_timer_expired(unsigned long arg) ...@@ -98,7 +98,6 @@ static void br_forward_delay_timer_expired(unsigned long arg)
br_topology_change_detection(br); br_topology_change_detection(br);
netif_carrier_on(br->dev); netif_carrier_on(br->dev);
} }
br_log_state(p);
rcu_read_lock(); rcu_read_lock();
br_ifinfo_notify(RTM_NEWLINK, p); br_ifinfo_notify(RTM_NEWLINK, p);
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment