* [PATCH net] bonding: fix enslavement slave link notifications
@ 2016-07-05 9:09 Saeed Mahameed
2016-07-05 19:13 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Saeed Mahameed @ 2016-07-05 9:09 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Jay Vosburgh, Veaceslav Falico, Andy Gospodarek,
Jiri Pirko, Aviv Heller, Saeed Mahameed
From: Aviv Heller <avivh@mellanox.com>
Currently, link notifications are not sent by
bond_set_slave_link_state() upon enslavement if
the slave is enslaved when up.
This happens because slave->link default init value
is 0, which is the same as BOND_LINK_UP, resulting
in bond_set_slave_link_state() ignoring this transition.
This patch sets the default value of slave->link to
BOND_LINK_NOCHANGE, assuring it will count as a state
transition and thus trigger notification logic.
Signed-off-by: Aviv Heller <avivh@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/bonding/bond_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 941ec99..a2afa3b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1584,6 +1584,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
/* check for initial state */
+ new_slave->link = BOND_LINK_NOCHANGE;
if (bond->params.miimon) {
if (bond_check_dev_link(bond, slave_dev, 0) == BMSR_LSTATUS) {
if (bond->params.updelay) {
--
2.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] bonding: fix enslavement slave link notifications
2016-07-05 9:09 [PATCH net] bonding: fix enslavement slave link notifications Saeed Mahameed
@ 2016-07-05 19:13 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-05 19:13 UTC (permalink / raw)
To: saeedm; +Cc: netdev, j.vosburgh, vfalico, gospo, jiri, avivh
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Tue, 5 Jul 2016 12:09:47 +0300
> From: Aviv Heller <avivh@mellanox.com>
>
> Currently, link notifications are not sent by
> bond_set_slave_link_state() upon enslavement if
> the slave is enslaved when up.
>
> This happens because slave->link default init value
> is 0, which is the same as BOND_LINK_UP, resulting
> in bond_set_slave_link_state() ignoring this transition.
>
> This patch sets the default value of slave->link to
> BOND_LINK_NOCHANGE, assuring it will count as a state
> transition and thus trigger notification logic.
>
> Signed-off-by: Aviv Heller <avivh@mellanox.com>
> Reviewed-by: Jiri Pirko <jiri@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-05 19:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05 9:09 [PATCH net] bonding: fix enslavement slave link notifications Saeed Mahameed
2016-07-05 19:13 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).