diff options
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index c6807e473ab7..2fca8e84ab10 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -982,6 +982,17 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker) return 0; } +static void ad_cond_set_peer_notif(struct port *port) +{ + struct bonding *bond = port->slave->bond; + + if (bond->params.broadcast_neighbor && rtnl_trylock()) { + bond->send_peer_notif = bond->params.num_peer_notif * + max(1, bond->params.peer_notif_delay); + rtnl_unlock(); + } +} + /** * ad_mux_machine - handle a port's mux state machine * @port: the port we're looking at @@ -1378,7 +1389,7 @@ static void ad_tx_machine(struct port *port) /* check if tx timer expired, to verify that we do not send more than * 3 packets per second */ - if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) { + if (!port->sm_tx_timer_counter || !(--port->sm_tx_timer_counter)) { /* check if there is something to send */ if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { __update_lacpdu_from_port(port); @@ -1393,12 +1404,13 @@ static void ad_tx_machine(struct port *port) * again until demanded */ port->ntt = false; + + /* restart tx timer(to verify that we will not + * exceed AD_MAX_TX_IN_SECOND + */ + port->sm_tx_timer_counter = ad_ticks_per_sec / AD_MAX_TX_IN_SECOND; } } - /* restart tx timer(to verify that we will not exceed - * AD_MAX_TX_IN_SECOND - */ - port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; } } @@ -2061,6 +2073,8 @@ static void ad_enable_collecting_distributing(struct port *port, __enable_port(port); /* Slave array needs update */ *update_slave_arr = true; + /* Should notify peers if possible */ + ad_cond_set_peer_notif(port); } } |