All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] bonding: restrict up state in 802.3ad mode
@ 2015-12-17  8:03 zyjzyj2000
  2015-12-17 21:57 ` Jay Vosburgh
  0 siblings, 1 reply; 52+ messages in thread
From: zyjzyj2000 @ 2015-12-17  8:03 UTC (permalink / raw)
  To: j.vosburgh, vfalico, gospo, netdev, Boris.Shteinbock

From: Zhu Yanjun <zyjzyj2000@gmail.com>

In 802.3ad mode, the speed and duplex is needed. But in some NIC,
there is a time span between NIC up state and getting speed and duplex.
As such, sometimes a slave in 802.3ad mode is in up state without
speed and duplex. This will make bonding in 802.3ad mode can not
work well. 
To make bonding driver be compatible with more NICs, it is
necessary to restrict the up state in 802.3ad mode.

Signed-off-by: Zhu Yanjun <zyjzyj2000@gmail.com>
---
 drivers/net/bonding/bond_main.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 9e0f8a7..0a80fb3 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1991,6 +1991,25 @@ static int bond_miimon_inspect(struct bonding *bond)
 
 		link_state = bond_check_dev_link(bond, slave->dev, 0);
 
+		/* Since some NIC has time span between netif_running and
+		 * getting speed and duples. That is, after a NIC is up (netif_running),
+		 * there is a time span before this NIC is negotiated with speed and duplex.
+		 * During this time span, the slave in 802.3ad is configured without speed
+		 * and duplex. This 802.3ad bonding will not work because it needs slave's speed
+		 * and duplex to generate key field.
+		 * As such, we restrict up in 802.3ad mode to: netif_running && peed != SPEED_UNKNOWN &&
+		 * duplex != DUPLEX_UNKNOWN
+		 */
+		if ((BMSR_LSTATUS == link_state) &&
+		    (BOND_MODE(bond) == BOND_MODE_8023AD)) {
+			bond_update_speed_duplex(slave);
+			if ((slave->speed == SPEED_UNKNOWN) ||
+			    (slave->duplex == DUPLEX_UNKNOWN)) {
+				link_state = 0;
+				netdev_info(bond->dev, "In 802.3ad mode, it is not enough to up without speed and duplex");
+			}
+		}
+
 		switch (slave->link) {
 		case BOND_LINK_UP:
 			if (link_state)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2016-01-29  7:05 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17  8:03 [PATCH 1/1] bonding: restrict up state in 802.3ad mode zyjzyj2000
2015-12-17 21:57 ` Jay Vosburgh
2015-12-18  4:36   ` zyjzyj2000
2015-12-18  4:36     ` [PATCH 1/1] bonding: delay up state without speed and duplex " zyjzyj2000
2015-12-18  4:54       ` Jay Vosburgh
2015-12-18 13:37       ` Sergei Shtylyov
2015-12-28  8:43   ` [PATCH 1/1] bonding: restrict up state " Michal Kubecek
2015-12-28  9:19     ` zhuyj
2016-01-06  1:26       ` Tantilov, Emil S
2016-01-06  3:05         ` zhuyj
2016-01-07  2:43           ` Tantilov, Emil S
2016-01-07  3:33             ` zhuyj
2016-01-07  5:02               ` Tantilov, Emil S
2016-01-07  6:15                 ` zyjzyj2000
2016-01-07  6:22                   ` zhuyj
2016-01-07  6:33                   ` Jay Vosburgh
2016-01-07 15:27                     ` Tantilov, Emil S
2016-01-08  1:28                     ` [RFC PATCH net-next] bonding: Use notifiers for slave link state detection Jay Vosburgh
2016-01-08  4:36                       ` zhuyj
2016-01-08  6:12                         ` Jay Vosburgh
2016-01-08  7:41                           ` (unknown), zyjzyj2000
2016-01-08  7:41                             ` [PATCH 1/1] bonding: utilize notifier callbacks to detect slave link state changes zyjzyj2000
2016-01-08 10:18                               ` zhuyj
2016-01-09  1:35                       ` [RFC PATCH net-next] bonding: Use notifiers for slave link state detection Tantilov, Emil S
2016-01-09  2:19                         ` Jay Vosburgh
2016-01-11  9:03                           ` zhuyj
2016-01-13  2:54                             ` zhuyj
2016-01-13 17:03                           ` Tantilov, Emil S
2016-01-20  5:13                             ` [PATCH 1/1] " zyjzyj2000
2016-01-20  5:13                               ` zyjzyj2000
2016-01-21 10:16                             ` zyjzyj2000
2016-01-21 10:16                               ` zyjzyj2000
2016-01-25 16:37                                 ` Tantilov, Emil S
2016-01-26  0:43                                 ` Jay Vosburgh
2016-01-26  3:19                                   ` zhuyj
2016-01-26  6:00                                     ` Jay Vosburgh
2016-01-26  6:26                                       ` zhuyj
2016-01-26  6:45                                         ` zhuyj
2016-01-27 20:00                                       ` Tantilov, Emil S
2016-01-28  8:44                                         ` zyjzyj2000
2016-01-29  7:05                                       ` zhuyj
2016-01-25 16:33                               ` Tantilov, Emil S
2016-01-25 18:00                                 ` David Miller
2016-01-25 18:37                                   ` Tantilov, Emil S
2016-01-08  2:29                     ` [PATCH 1/1] bonding: restrict up state in 802.3ad mode zhuyj
2016-01-07  6:53                   ` Michal Kubecek
2016-01-07  7:37                     ` zhuyj
2016-01-07  7:59                       ` Michal Kubecek
2016-01-07  8:35                         ` zhuyj
2016-01-07  7:47             ` zhuyj
2016-01-07 18:28               ` Tantilov, Emil S
2016-01-08  6:09                 ` zhuyj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.